Safe artifact extraction against traversal, links, and special files #2

Closed
opened 2026-06-16 17:54:53 +00:00 by stephen · 0 comments
Owner

Why

download-artifact extracts tar archives from shared storage with tar -xf into the destination. A malicious archive can attempt traversal, symlink overwrite, hardlinks, or special files unless entries are prevalidated.

Verified

  • src/lib/artifact-tar.js runs tar -xf - -C <dest> with no visible entry validation.
  • Upload creates relative archives, but cross-run/cross-repo download trusts storage metadata and object contents.
  • No existing download-artifact-action issues are filed.

Build

  • List and validate archive entries before extraction.
  • Reject absolute paths, .., symlink/hardlink escapes, device nodes, and ownership surprises.
  • Add malicious tar fixture tests.
## Why download-artifact extracts tar archives from shared storage with `tar -xf` into the destination. A malicious archive can attempt traversal, symlink overwrite, hardlinks, or special files unless entries are prevalidated. ## Verified - `src/lib/artifact-tar.js` runs `tar -xf - -C <dest>` with no visible entry validation. - Upload creates relative archives, but cross-run/cross-repo download trusts storage metadata and object contents. - No existing download-artifact-action issues are filed. ## Build - List and validate archive entries before extraction. - Reject absolute paths, `..`, symlink/hardlink escapes, device nodes, and ownership surprises. - Add malicious tar fixture tests.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
rasterstate/download-artifact-action#2
No description provided.