Skip to content

tarfile data/tar filter bypass via hard link to a symlink #157190

Description

@StanFromIreland

On CPython 3.13.15 for Linux, an attacker-controlled tar archive extracted with the tar or data filter can make tarfile change the permissions and modification time of an existing file outside the extraction directory. The archive also leaves a path inside the extracted tree that resolves to the outside file. Opening that path returns the outside file's content.

This was incidentally fixed by 5a57248 for 3.14+ which changed os.link to use AT_SYMLINK_FOLLOW.

Linked PRs

Activity

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

Metadata

Metadata

Labels

3.10only security fixes3.11only security fixes3.12only security fixes3.13bugs and security fixesstdlibStandard Library Python modules in the Lib/ directorytype-securityA security issue

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions