@orbit-build/cli 0.4.9 → 0.4.10
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/index.js +29 -2
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -253968,11 +253968,12 @@ import fs3 from "fs";
|
|
|
253968
253968
|
import os22 from "os";
|
|
253969
253969
|
import path22 from "path";
|
|
253970
253970
|
var DANGEROUS_COMMAND_REGEXES = [
|
|
253971
|
-
/\brm\s
|
|
253972
|
-
/\brm\
|
|
253971
|
+
/\brm\b[^\r\n;&|]*\s-[a-z]*r[a-z]*(?=\s|$)/i,
|
|
253972
|
+
/\brm\b[^\r\n;&|]*--recursive\b/i,
|
|
253973
253973
|
/\bdel\s+\/s\b/i,
|
|
253974
253974
|
/\b(?:rmdir|rd)\s+\/s\b/i,
|
|
253975
253975
|
/\bremove-item\b.*(?:-recurse|-force)\b/i,
|
|
253976
|
+
/\b(?:ri|rmdir|rd|del|erase)\b[^\r\n;&|]*(?:-recurse\b|\s-r[a-z]*(?=\s|$))/i,
|
|
253976
253977
|
/\bchmod\s+-R\b/i,
|
|
253977
253978
|
/\bchown\s+-R\b/i,
|
|
253978
253979
|
/\bsudo\b/i,
|
|
@@ -254390,6 +254391,32 @@ var PermissionEngine = class {
|
|
|
254390
254391
|
risk
|
|
254391
254392
|
};
|
|
254392
254393
|
}
|
|
254394
|
+
const linkedWorkspaceEscape = commandPaths.pathTokens.find((token) => {
|
|
254395
|
+
const resolved = resolveCommandPathCandidate(token, workspaceRoot);
|
|
254396
|
+
if (resolved === null || !checkWorkspaceBoundary(workspaceRoot, resolved) || !fs3.existsSync(workspaceRoot)) {
|
|
254397
|
+
return false;
|
|
254398
|
+
}
|
|
254399
|
+
try {
|
|
254400
|
+
resolveSafePath(workspaceRoot, resolved);
|
|
254401
|
+
return false;
|
|
254402
|
+
} catch {
|
|
254403
|
+
return true;
|
|
254404
|
+
}
|
|
254405
|
+
});
|
|
254406
|
+
if (linkedWorkspaceEscape) {
|
|
254407
|
+
if (mode === "strict") {
|
|
254408
|
+
return {
|
|
254409
|
+
action: "deny",
|
|
254410
|
+
reason: `Command path "${linkedWorkspaceEscape}" does not resolve safely inside the workspace, blocked under strict mode.`,
|
|
254411
|
+
risk
|
|
254412
|
+
};
|
|
254413
|
+
}
|
|
254414
|
+
return {
|
|
254415
|
+
action: "ask",
|
|
254416
|
+
reason: `Command path "${linkedWorkspaceEscape}" does not resolve safely inside the workspace. It may traverse a symbolic link or junction.`,
|
|
254417
|
+
risk
|
|
254418
|
+
};
|
|
254419
|
+
}
|
|
254393
254420
|
const outsidePath = commandPaths.pathTokens.find((token) => {
|
|
254394
254421
|
const resolved = resolveCommandPathCandidate(token, workspaceRoot);
|
|
254395
254422
|
return resolved !== null && !checkWorkspaceBoundary(workspaceRoot, resolved) && !trustedRoots.some(
|