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

path traversal bug related to the use of the tarfile module #731

Closed
d1b opened this issue Nov 23, 2012 · 3 comments
Closed

path traversal bug related to the use of the tarfile module #731

d1b opened this issue Nov 23, 2012 · 3 comments
Labels
auto-locked Outdated issues that have been locked by automation type: bug A confirmed bug or unintended behavior

Comments

@d1b
Copy link
Contributor

d1b commented Nov 23, 2012

pip/util.py is vulnerable to path traversal when un-taring a tarfile in the untar_file method.
Provided that a malicious tar file is comprised of two entries with different starting paths (has_leading_dir returns false on line 485) the code in untar_file takes the filename provided from the call to tar.getmembers(line 489) and copies over the zip file contents out on line 525 (shutil.copyfileobj(fp, destfp) ).

@xavfernandez xavfernandez added the type: bug A confirmed bug or unintended behavior label Oct 8, 2015
@dstufft
Copy link
Member

dstufft commented Mar 30, 2017

Duplicate of #3907.

@dstufft dstufft closed this as completed Mar 30, 2017
@d1b
Copy link
Contributor Author

d1b commented Apr 14, 2017

@dstufft shouldn't the other issue be a duplicate of this one given that this issue is older ? (I don't mind)

@dstufft
Copy link
Member

dstufft commented Apr 14, 2017

@d1b Yes generally, though I choose that one over this one because it worked as a stand in for both .zip and .tar while your two had one each.

@lock lock bot added the auto-locked Outdated issues that have been locked by automation label Jun 3, 2019
@lock lock bot locked as resolved and limited conversation to collaborators Jun 3, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
auto-locked Outdated issues that have been locked by automation type: bug A confirmed bug or unintended behavior
Projects
None yet
Development

No branches or pull requests

3 participants