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 of Directory Traversal vulnerability (CVE-2024-55587) #41

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

CSIRTTrizna
Copy link

Description

The ZipFile extract and extractall methods in libarchive are vulnerable to a directory traversal attack, allowing files to be written anywhere on disk, regardless of the intended target path.

This vulnerability stems from line 107 in libarchive/zip.py:

return self.readpath(name, os.path.join(path, name))

Here, os.path.join combines unsanitized user input (name) with the intended extraction path, making the method susceptible to malicious input.

Our fork addresses this issue by implementing the sanitize_filename method, which incorporates logic from the pyzipper project, a well-tested and secure solution.

Additionally, we have added docstrings to enhance code readability and maintainability.

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