-
Notifications
You must be signed in to change notification settings - Fork 36
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
Investigate potential issue reported by bandit #694
Comments
One simple fix starting with Python 3.12 would be to use the extraction filter "data". This will be the default in Python 3.14. The question is whether we need to make it configurable or not. Do we have legitimate use case of a different extraction filter? See https://docs.python.org/3/library/tarfile.html#tarfile-extraction-filter |
I have a testcase which reproduces the issue. Working on a fix. |
As reported by `bandit` B202 handler, the `tarfile.extractall()` method is not safe with some file paths. We previously ignored this handler, and decided to handle things in the `e3.archive` module now. The `tarfile.data_filter()` is now used when it exists, and a fallback handling absolute paths and traversal paths has been created. Ref: #694
Issue should be fixed by the commit mentioned above: 31ee075 |
We had to revert the commit because of a bug in |
See https://bandit.readthedocs.io/en/1.7.8/plugins/b202_tarfile_unsafe_members.html
The text was updated successfully, but these errors were encountered: