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

[3.8] bpo-41316: Make tarfile follow specs for FNAME (GH-21511) #22141

Merged
merged 1 commit into from
Oct 21, 2020

Conversation

miss-islington
Copy link
Contributor

@miss-islington miss-islington commented Sep 7, 2020

tarfile writes full path to FNAME field of GZIP format instead of just basename if user specified absolute path. Some archive viewers may process file incorrectly. Also it creates security issue because anyone can know structure of directories on system and know username or other personal information.

RFC1952 says about FNAME:
This is the original name of the file being compressed, with any directory components removed.

So tarfile must remove directory names from FNAME and write only basename of file.

Automerge-Triggered-By: @jaraco
(cherry picked from commit 22748a8)

Co-authored-by: Artem Bulgakov ArtemSBulgakov@ya.ru

https://bugs.python.org/issue41316

tarfile writes full path to FNAME field of GZIP format instead of just basename if user specified absolute path. Some archive viewers may process file incorrectly. Also it creates security issue because anyone can know structure of directories on system and know username or other personal information.

RFC1952 says about FNAME:
This is the original name of the file being compressed, with any directory components removed.

So tarfile must remove directory names from FNAME and write only basename of file.

Automerge-Triggered-By: @jaraco
(cherry picked from commit 22748a8)

Co-authored-by: Artem Bulgakov <ArtemSBulgakov@ya.ru>
@miss-islington miss-islington merged commit e866f33 into python:3.8 Oct 21, 2020
@miss-islington miss-islington deleted the backport-22748a8-3.8 branch October 21, 2020 05:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type-bug An unexpected behavior, bug, or error
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants