fullcourtdefense-cli 1.34.20 → 1.34.21
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/actionPolicyEngine.js +14 -1
- package/dist/version.json +1 -1
- package/package.json +1 -1
|
@@ -7475,10 +7475,23 @@ function provenCompoundDownload(command, detectedUrl) {
|
|
|
7475
7475
|
const pieces = raw.match(/"[^"\r\n]*"|'[^'\r\n]*'|[^\s"']+/g) || [];
|
|
7476
7476
|
if (pieces.join("").replace(/\s/g, "") !== raw.replace(/\s/g, "")) return false;
|
|
7477
7477
|
const tokens = pieces.map((piece) => piece.replace(/^["']|["']$/g, ""));
|
|
7478
|
-
|
|
7478
|
+
const program = tokens.shift() || "";
|
|
7479
|
+
if (!/^(?:curl(?:\.exe)?|wget(?:\.exe)?|Invoke-RestMethod|Invoke-WebRequest|irm|iwr)$/i.test(program)) return false;
|
|
7480
|
+
const isCurl = /^curl(?:\.exe)?$/i.test(program);
|
|
7479
7481
|
let urls = 0;
|
|
7480
7482
|
for (let i2 = 0; i2 < tokens.length; i2++) {
|
|
7481
7483
|
const token = tokens[i2];
|
|
7484
|
+
if (isCurl && /^(?:--max-time|--connect-timeout)$/.test(token) && /^\d+(?:\.\d+)?$/.test(tokens[i2 + 1] || "")) {
|
|
7485
|
+
i2++;
|
|
7486
|
+
continue;
|
|
7487
|
+
}
|
|
7488
|
+
if (isCurl && /^(?:-o|--output)$/.test(token)) {
|
|
7489
|
+
const output = tokens[i2 + 1] || "";
|
|
7490
|
+
const local = output.replace(/^[A-Za-z]:[\\/]/, "");
|
|
7491
|
+
if (!local || /^[-\\/]/.test(local) || /[^\w .\\/-]/.test(local) || /^(?:CON|PRN|AUX|NUL|COM\d|LPT\d)(?:\.|$)/i.test(local.split(/[\\/]/).pop() || "")) return false;
|
|
7492
|
+
i2++;
|
|
7493
|
+
continue;
|
|
7494
|
+
}
|
|
7482
7495
|
if (/^https?:\/\//i.test(token)) {
|
|
7483
7496
|
urls++;
|
|
7484
7497
|
continue;
|
package/dist/version.json
CHANGED