Harden absolute-path tar restore against poisoned cache entries #3

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

Why

cache-action restores archives with tar -xpP, preserving absolute paths. That matches home-dir cache behavior, but a poisoned cache object can write outside the requested cache paths.

Verified

  • src/lib/tar.js uses tar -xpP -f - during restore.
  • SECURITY.md documents absolute-path preservation; no allowlist enforcement is visible.
  • No existing cache-action issues are filed.

Build

  • Validate archive entries before extraction against the requested path allowlist.
  • Reject symlinks/hardlinks/device entries that escape allowed paths.
  • Add malicious archive tests covering absolute paths and .. traversal.
## Why cache-action restores archives with `tar -xpP`, preserving absolute paths. That matches home-dir cache behavior, but a poisoned cache object can write outside the requested cache paths. ## Verified - `src/lib/tar.js` uses `tar -xpP -f -` during restore. - `SECURITY.md` documents absolute-path preservation; no allowlist enforcement is visible. - No existing cache-action issues are filed. ## Build - Validate archive entries before extraction against the requested path allowlist. - Reject symlinks/hardlinks/device entries that escape allowed paths. - Add malicious archive tests covering absolute paths and `..` traversal.
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/cache-action#3
No description provided.