@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.
Files changed (43) hide show
  1. package/dist/cron.cjs +7 -3
  2. package/dist/cron.cjs.map +1 -1
  3. package/dist/cron.js +8 -4
  4. package/dist/cron.js.map +1 -1
  5. package/dist/eval.cjs +7 -3
  6. package/dist/eval.cjs.map +1 -1
  7. package/dist/eval.js +8 -4
  8. package/dist/eval.js.map +1 -1
  9. package/dist/filesystem/index.cjs +7 -3
  10. package/dist/filesystem/index.cjs.map +1 -1
  11. package/dist/filesystem/index.js +7 -3
  12. package/dist/filesystem/index.js.map +1 -1
  13. package/dist/index.cjs +7 -3
  14. package/dist/index.cjs.map +1 -1
  15. package/dist/index.js +7 -3
  16. package/dist/index.js.map +1 -1
  17. package/dist/internal/security/index.cjs +7 -3
  18. package/dist/internal/security/index.cjs.map +1 -1
  19. package/dist/internal/security/index.js +8 -4
  20. package/dist/internal/security/index.js.map +1 -1
  21. package/dist/path-safety.cjs +7 -3
  22. package/dist/path-safety.cjs.map +1 -1
  23. package/dist/path-safety.js +8 -4
  24. package/dist/path-safety.js.map +1 -1
  25. package/dist/sandbox/bwrap.d.cts +75 -0
  26. package/dist/sandbox/bwrap.d.ts +75 -0
  27. package/dist/sandbox/index.cjs +473 -12
  28. package/dist/sandbox/index.cjs.map +1 -1
  29. package/dist/sandbox/index.d.cts +3 -0
  30. package/dist/sandbox/index.d.ts +3 -0
  31. package/dist/sandbox/index.js +456 -14
  32. package/dist/sandbox/index.js.map +1 -1
  33. package/dist/sandbox/linux-sandbox.d.cts +88 -0
  34. package/dist/sandbox/linux-sandbox.d.ts +88 -0
  35. package/dist/sandbox/seccomp.d.cts +10 -0
  36. package/dist/sandbox/seccomp.d.ts +10 -0
  37. package/dist/skills.cjs +7 -3
  38. package/dist/skills.cjs.map +1 -1
  39. package/dist/skills.js +7 -3
  40. package/dist/skills.js.map +1 -1
  41. package/dist/workflow.cjs.map +1 -1
  42. package/dist/workflow.js.map +1 -1
  43. 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
- const prefix = baseResolved.endsWith(path.sep) ? baseResolved : baseResolved + path.sep;
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 !== baseResolved && !resolved.startsWith(baseResolved + path.sep)) {
893
+ if (!isInside(resolved, baseResolved)) {
890
894
  throw new PathTraversalError(`symlink ${path$1}`, resolved);
891
895
  }
892
896
  }