Skip to content

Mitigate Zip Slip / Path Traversal (CWE-22) Vulnerability in Archive Extraction#516

Open
sahvx655-wq wants to merge 2 commits into
apache:masterfrom
sahvx655-wq:mitigate-zip-slip
Open

Mitigate Zip Slip / Path Traversal (CWE-22) Vulnerability in Archive Extraction#516
sahvx655-wq wants to merge 2 commits into
apache:masterfrom
sahvx655-wq:mitigate-zip-slip

Conversation

@sahvx655-wq
Copy link
Copy Markdown

This PR prevents Zip Slip / Path Traversal issues during ZIP and JAR archive extraction by validating archive entry paths before writing files to disk. Entries that would resolve outside the intended extraction directory are rejected, ensuring extraction remains confined to the target location.

In addition to the implementation changes, regression tests have been added to verify that malicious archives containing traversal entries (for example, ../../evil.txt) are rejected and cause extraction to fail safely.

@paulrutter
Copy link
Copy Markdown
Contributor

@sahvx655-wq before you start creating more PR's, let's first establish what the problem is you're trying to solve.
Every PR should be accompanied with a Jira ticket in https://issues.apache.org/jira/projects/FELIX/summary.

Can you start there first and create tickets for the things you're trying to address?
I want to prevent having PR's that no-one exactly knows the reason for.

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.

2 participants