@raytrace-cli/sdk 0.2.8 → 0.2.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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/client.mjs +1 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@raytrace-cli/sdk",
3
- "version": "0.2.8",
3
+ "version": "0.2.10",
4
4
  "description": "TypeScript/JavaScript SDK for RayTrace cloud sandboxes: create, run commands, stop, start and destroy over the /v1 API",
5
5
  "type": "module",
6
6
  "license": "MIT",
package/src/client.mjs CHANGED
@@ -62,7 +62,7 @@ function buildTarGzWithModes(files, modes = new Map()) {
62
62
  }
63
63
  for (const [rawPath, content] of entries) {
64
64
  const rel = String(rawPath).replace(/^\/+/, '');
65
- if (!rel || rel.includes('..') || Buffer.byteLength(rel, 'utf8') > 99) {
65
+ if (!rel || rel.split(/[\\/]/).includes('..') || Buffer.byteLength(rel, 'utf8') > 99) {
66
66
  throw new Error(`Invalid archive file path: ${rawPath}`);
67
67
  }
68
68
  const data = Buffer.isBuffer(content) ? content : Buffer.from(content);