bpo-21109: Add SafeTarFile by epicfaace · Pull Request #15244 · python/cpython (original) (raw)

Skip to content

Sign in

Appearance settings

View all features

View all solutions

View all resources

Provide feedback

We read every piece of feedback, and take your input very seriously.

Include my email address so I can be contacted

Saved searches

Use saved searches to filter your results more quickly

Sign in

Sign up

Appearance settings

python / cpython Public

Additional navigation options

Closed

epicfaace wants to merge 15 commits intopython:mainfrom

epicfaace:tar

ConversationCommits (15)ChecksFiles changed

Closed

bpo-21109: Add SafeTarFile#15244

epicfaace wants to merge 15 commits intopython:mainfrom

epicfaace:tar

Conversation

@epicfaace

Copy link Copy Markdown

Contributor

@epicfaace epicfaace commented

Aug 13, 2019

edited by bedevere-bot

Loading

Working off of the patch in bpo-21109; adding the tests so that all tests that apply to FileTest also apply to SafeFileTest. It's a bit tricky in this case because of multiple inheritance of the test classes.

https://bugs.python.org/issue21109

epicfaace added 9 commits

August 13, 2019 00:28

@epicfaace

[apply safetarfile-4.diff](/python/cpython/pull/15244/commits/7b28c5d2097a4c394a1fe919aa180b66deed86db "apply safetarfile-4.diff")

[7b28c5d](/python/cpython/pull/15244/commits/7b28c5d2097a4c394a1fe919aa180b66deed86db)

@epicfaace

[doc: remove duplicate message](/python/cpython/pull/15244/commits/12a50748e9c2c7984963d5bda3669e32eff337b3 "doc: remove duplicate message")

[12a5074](/python/cpython/pull/15244/commits/12a50748e9c2c7984963d5bda3669e32eff337b3)

@epicfaace

[add TarFileTest and SafeTarFileTest](/python/cpython/pull/15244/commits/a95ce6ad92d7b404a1c488401a3c140cc851b14a "add TarFileTest and SafeTarFileTest")

[a95ce6a](/python/cpython/pull/15244/commits/a95ce6ad92d7b404a1c488401a3c140cc851b14a)

@epicfaace

[test: fix inheritance of tests to make it easier to extend](/python/cpython/pull/15244/commits/a3bcc18b916b33d15fc1b539d9de4340eba239cf "test: fix inheritance of tests to make it easier to extend")

[a3bcc18](/python/cpython/pull/15244/commits/a3bcc18b916b33d15fc1b539d9de4340eba239cf)

@epicfaace

[add test inheritance of TarFileTest to all testcases](/python/cpython/pull/15244/commits/2f8990dfdc123c91fb636a123fd12827abf97d92 "add test inheritance of TarFileTest to all testcases")

[2f8990d](/python/cpython/pull/15244/commits/2f8990dfdc123c91fb636a123fd12827abf97d92)

@epicfaace

[test: replace tarfile.open with tarfile_open](/python/cpython/pull/15244/commits/769eb3291ab74984acfef53b836af93a92993d0a "test: replace tarfile.open with tarfile_open")

[769eb32](/python/cpython/pull/15244/commits/769eb3291ab74984acfef53b836af93a92993d0a)

@epicfaace

[test: replace tarfile.TarFile with self.tarfile_module](/python/cpython/pull/15244/commits/8e522b4155f795df45b1beeae442656c001261d4 "test: replace tarfile.TarFile with self.tarfile_module")

[8e522b4](/python/cpython/pull/15244/commits/8e522b4155f795df45b1beeae442656c001261d4)

@epicfaace

[test: make taropen generic](/python/cpython/pull/15244/commits/8f361c11ed2a4c39873332468cb1082d468b9596 "test: make taropen generic")

[8f361c1](/python/cpython/pull/15244/commits/8f361c11ed2a4c39873332468cb1082d468b9596)

@epicfaace

[Rename to -base because there's already a class called SafeTarFileTest](/python/cpython/pull/15244/commits/b6862c619e6eaaa187ab3e80e1f545bcd5de1916 "Rename to -base because there's already a class called SafeTarFileTest")

[b6862c6](/python/cpython/pull/15244/commits/b6862c619e6eaaa187ab3e80e1f545bcd5de1916)

@the-knights-who-say-ni the-knights-who-say-ni added the CLA signed label

Aug 13, 2019

@bedevere-bot bedevere-bot added the awaiting review label

Aug 13, 2019

epicfaace added 6 commits

August 13, 2019 04:44

@epicfaace

[Add some tests for SafeTarFile](/python/cpython/pull/15244/commits/bfe20da2aaf56756dbb7e240b41a7d525bd8bb4d "Add some tests for SafeTarFile")

[bfe20da](/python/cpython/pull/15244/commits/bfe20da2aaf56756dbb7e240b41a7d525bd8bb4d)

@epicfaace

[test: move safetarfile to another test module](/python/cpython/pull/15244/commits/6011e26ce7b9ab876214c8b479e18a246d2d2282 "test: move safetarfile to another test module")

[6011e26](/python/cpython/pull/15244/commits/6011e26ce7b9ab876214c8b479e18a246d2d2282)

@epicfaace

[keep only working safetarfile tests](/python/cpython/pull/15244/commits/18f7b301c842949738404094fe52e4b95e9906e3 "keep only working safetarfile tests")

[18f7b30](/python/cpython/pull/15244/commits/18f7b301c842949738404094fe52e4b95e9906e3)

@epicfaace

[add ustarreadtests](/python/cpython/pull/15244/commits/c58262bf184752b82559f18f227de511965062ab "add ustarreadtests")

[c58262b](/python/cpython/pull/15244/commits/c58262bf184752b82559f18f227de511965062ab)

@epicfaace

[enable one failing safetarfile test](/python/cpython/pull/15244/commits/b3fa18aa3a53329639f6666afb035e6605975c3a "enable one failing safetarfile test")

[b3fa18a](/python/cpython/pull/15244/commits/b3fa18aa3a53329639f6666afb035e6605975c3a)

@epicfaace

[Update tarfile.rst](/python/cpython/pull/15244/commits/14b88fe7e1a1af7978dc818b959e6b3a51cf6834 "Update tarfile.rst")

[14b88fe](/python/cpython/pull/15244/commits/14b88fe7e1a1af7978dc818b959e6b3a51cf6834)

@DanielGarcia DanielGarcia mannequin mentioned this pull request

Apr 10, 2022

tarfile: Traversal attack vulnerability#65308

Closed

@ezio-melotti ezio-melotti removed the CLA signed label

Jul 13, 2022

@encukou

Copy link Copy Markdown

Member

encukou commented

Jun 19, 2025

Superseded by PEP-706. A safe(r) option is now the default.
Thank you for this attempt!

@encukou encukou closed this

Jun 19, 2025

This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters

[ Show hidden characters]({{ revealButtonHref }})

Sign up for free to join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@ethanfurman ethanfurman Awaiting requested review from ethanfurman ethanfurman will be requested when the pull request is marked ready for review ethanfurman is a code owner

Assignees

No one assigned

Labels

awaiting review

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

5 participants

@epicfaace @encukou @the-knights-who-say-ni @ezio-melotti @bedevere-bot