@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/cron.cjs
CHANGED
|
@@ -851,6 +851,11 @@ var init_atomic_write = __esm({
|
|
|
851
851
|
warnedNfsDirs = /* @__PURE__ */ new Set();
|
|
852
852
|
}
|
|
853
853
|
});
|
|
854
|
+
function isInside(target, base) {
|
|
855
|
+
if (target === base) return true;
|
|
856
|
+
const prefix = base.endsWith(path.sep) ? base : base + path.sep;
|
|
857
|
+
return target.startsWith(prefix);
|
|
858
|
+
}
|
|
854
859
|
function safePathJoin(base, ...parts) {
|
|
855
860
|
if (base === "") {
|
|
856
861
|
throw new Error("safePathJoin: base must be non-empty");
|
|
@@ -861,8 +866,7 @@ function safePathJoin(base, ...parts) {
|
|
|
861
866
|
}
|
|
862
867
|
const baseResolved = path.resolve(base);
|
|
863
868
|
const target = path.resolve(base, ...parts);
|
|
864
|
-
|
|
865
|
-
if (target !== baseResolved && !target.startsWith(prefix)) {
|
|
869
|
+
if (!isInside(target, baseResolved)) {
|
|
866
870
|
throw new PathTraversalError(parts.join("/"), target);
|
|
867
871
|
}
|
|
868
872
|
return target;
|
|
@@ -887,7 +891,7 @@ function assertNoSymlinkEscape(path$1, base) {
|
|
|
887
891
|
}
|
|
888
892
|
const resolved = realpathOfDeepestExisting(path$1);
|
|
889
893
|
if (resolved === void 0) return;
|
|
890
|
-
if (resolved
|
|
894
|
+
if (!isInside(resolved, baseResolved)) {
|
|
891
895
|
throw new PathTraversalError(`symlink ${path$1}`, resolved);
|
|
892
896
|
}
|
|
893
897
|
}
|