Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix false positive ZipSlip when an archive starts with dot #54

Merged
merged 3 commits into from
Mar 11, 2024

Conversation

yahavi
Copy link
Member

@yahavi yahavi commented Mar 10, 2024

  • All tests passed. If this feature is not already covered by the tests, I added new tests.
  • This pull request is on the dev branch.
  • I used gofmt for formatting the code before submitting the pull request.
  • I labeled this pull request with one of the following: 'breaking change', 'new feature', 'bug', or 'ignore for release'

Certain archives may have the "." designated as the root directory:
image

In this scenario, we verify if the combination of the extraction path and "/" serves as the prefix of the archive entry. Moreover, in this case, there exists an entry in the archive that matches the extraction path precisely.

To resolve this issue, the PR removes the "/" from the extraction path prior to inspecting the archive.

@yahavi yahavi added the bug Something isn't working label Mar 10, 2024
@yahavi yahavi self-assigned this Mar 10, 2024
@yahavi yahavi requested review from eyalbe4 and sverdlov93 March 10, 2024 16:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants