You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix: prevent tar-slip path traversal in archive extraction (#5979)
* fix: prevent tar-slip path traversal in archive extraction
Add a shared SafeArchivePath helper in pkg/archiveutil that validates tar entry paths before writing them. Use it in all hand-rolled tar extractors (pkg/archives, pkg/util, pkg/archiveutil, pkg/image, pkg/upstream) and add regression tests for dot-dot and absolute path traversal attempts.
* fix: detect symlink escapes in archive extraction
SafeArchivePath now walks each parent component of the target path and rejects any existing symlink as a potential escape. This prevents an archive entry like link/pwned from being written outside the extraction root when dest/link points to a directory outside the root.
Add a regression test that creates a symlink in the destination and verifies the entry is rejected.
0 commit comments