Backend: SDK upload extracts archives with no path-traversal protection (admin-only RCE risk) #118
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Fixed in
04ce096.POST /sdk/:vendornow:unzip -Z1/tar -tf) and rejects any entry with an absolute path or..traversal before extraction.SDK_ROOT/<vendor>.zgaetano referenced this issue2026-05-26 18:22:49 -04:00
Fix Plan — #118 Path traversal in SDK archive extraction
Root cause:
src/routes/sdk.js:91-128runsspawn("tar",…)/spawn("unzip",…)on user-uploaded archives without traversal protection. Malicious archive with../../etc/cron.d/backdoorwrites outsideSDK_ROOT.Fix:
Option A (quick): Add tar/unzip flags:
Option B (robust): Replace with JS
tarnpm package, validate every entry:Also fix
sdk.js:138— stripserr.messagefrom 500 response.Files:
src/routes/sdk.js:91-138,package.jsonEffort: ~2h (Option B)
**Priority: P0 — security (admin-only but RCE)