@theokit/sdk 4.19.3 → 4.20.0
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/cron.cjs +7 -3
- package/dist/cron.cjs.map +1 -1
- package/dist/cron.js +8 -4
- package/dist/cron.js.map +1 -1
- package/dist/eval.cjs +7 -3
- package/dist/eval.cjs.map +1 -1
- package/dist/eval.js +8 -4
- package/dist/eval.js.map +1 -1
- package/dist/filesystem/index.cjs +7 -3
- package/dist/filesystem/index.cjs.map +1 -1
- package/dist/filesystem/index.js +7 -3
- package/dist/filesystem/index.js.map +1 -1
- package/dist/index.cjs +7 -3
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +7 -3
- package/dist/index.js.map +1 -1
- package/dist/internal/security/index.cjs +7 -3
- package/dist/internal/security/index.cjs.map +1 -1
- package/dist/internal/security/index.js +8 -4
- package/dist/internal/security/index.js.map +1 -1
- package/dist/path-safety.cjs +7 -3
- package/dist/path-safety.cjs.map +1 -1
- package/dist/path-safety.js +8 -4
- package/dist/path-safety.js.map +1 -1
- package/dist/sandbox/bwrap.d.cts +75 -0
- package/dist/sandbox/bwrap.d.ts +75 -0
- package/dist/sandbox/index.cjs +473 -12
- package/dist/sandbox/index.cjs.map +1 -1
- package/dist/sandbox/index.d.cts +3 -0
- package/dist/sandbox/index.d.ts +3 -0
- package/dist/sandbox/index.js +456 -14
- package/dist/sandbox/index.js.map +1 -1
- package/dist/sandbox/linux-sandbox.d.cts +88 -0
- package/dist/sandbox/linux-sandbox.d.ts +88 -0
- package/dist/sandbox/seccomp.d.cts +10 -0
- package/dist/sandbox/seccomp.d.ts +10 -0
- package/dist/skills.cjs +7 -3
- package/dist/skills.cjs.map +1 -1
- package/dist/skills.js +7 -3
- package/dist/skills.js.map +1 -1
- package/dist/workflow.cjs.map +1 -1
- package/dist/workflow.js.map +1 -1
- package/package.json +2 -2
package/dist/eval.cjs
CHANGED
|
@@ -850,6 +850,11 @@ var init_atomic_write = __esm({
|
|
|
850
850
|
warnedNfsDirs = /* @__PURE__ */ new Set();
|
|
851
851
|
}
|
|
852
852
|
});
|
|
853
|
+
function isInside(target, base) {
|
|
854
|
+
if (target === base) return true;
|
|
855
|
+
const prefix = base.endsWith(path.sep) ? base : base + path.sep;
|
|
856
|
+
return target.startsWith(prefix);
|
|
857
|
+
}
|
|
853
858
|
function safePathJoin(base, ...parts) {
|
|
854
859
|
if (base === "") {
|
|
855
860
|
throw new Error("safePathJoin: base must be non-empty");
|
|
@@ -860,8 +865,7 @@ function safePathJoin(base, ...parts) {
|
|
|
860
865
|
}
|
|
861
866
|
const baseResolved = path.resolve(base);
|
|
862
867
|
const target = path.resolve(base, ...parts);
|
|
863
|
-
|
|
864
|
-
if (target !== baseResolved && !target.startsWith(prefix)) {
|
|
868
|
+
if (!isInside(target, baseResolved)) {
|
|
865
869
|
throw new PathTraversalError(parts.join("/"), target);
|
|
866
870
|
}
|
|
867
871
|
return target;
|
|
@@ -886,7 +890,7 @@ function assertNoSymlinkEscape(path$1, base) {
|
|
|
886
890
|
}
|
|
887
891
|
const resolved = realpathOfDeepestExisting(path$1);
|
|
888
892
|
if (resolved === void 0) return;
|
|
889
|
-
if (resolved
|
|
893
|
+
if (!isInside(resolved, baseResolved)) {
|
|
890
894
|
throw new PathTraversalError(`symlink ${path$1}`, resolved);
|
|
891
895
|
}
|
|
892
896
|
}
|