Skip to content

Add optional TAR symlink traversal rejection - #548

Open
wilx wants to merge 1 commit into
codehaus-plexus:masterfrom
wilx:symlink-traversal-policy
Open

wilx wants to merge 1 commit into
codehaus-plexus:masterfrom
wilx:symlink-traversal-policy

Conversation

@wilx

@wilx wilx commented Nov 21, 2026

Copy link
Copy Markdown

Make extraction containment checks consistent across platforms, including paths with symlinked parents, .. components, or nonexistent output files.

Add TarUnArchiver.setFailOnSymlinkTraversal(true) to reject intermediate symlinks in selected, mapped destinations before overwrite decisions or filesystem changes. This prevents redirected writes even within the destination directory. The default permits contained directory symlinks; both settings enforce destination containment.

Extract the shared physical path resolver and per-extraction directory cache from #493 for independent review. Final symlink destinations are rejected, file/directory collisions fail, and symlink targets retain their metadata. This PR contains no hard-link feature changes.

Validation: JDK 17 build, formatting, and Javadoc passed; 656 tests, zero failures/errors, 22 skipped. Covers TAR, ZIP, and all six TAR compression modes. Windows and macOS execution remain unvalidated.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant