Skip to content

[3.13] gh-146581: Fix vulnerability in shutil.unpack_archive() for ZIP files on Windows (GH-146591)#149065

Merged
serhiy-storchaka merged 1 commit intopython:3.13from
miss-islington:backport-fc829e8-3.13
Apr 27, 2026
Merged

[3.13] gh-146581: Fix vulnerability in shutil.unpack_archive() for ZIP files on Windows (GH-146591)#149065
serhiy-storchaka merged 1 commit intopython:3.13from
miss-islington:backport-fc829e8-3.13

Conversation

@miss-islington
Copy link
Copy Markdown
Contributor

@miss-islington miss-islington commented Apr 27, 2026

Use ZipFile.extractall() to sanitize file names and extract files.

Files with invalid names (e.g. absolute paths) are now skipped.

Files containing ".." in the name are no longer skipped.
(cherry picked from commit fc829e8)

Co-authored-by: Serhiy Storchaka storchaka@gmail.com

… files on Windows (pythonGH-146591)

Use ZipFile.extractall() to sanitize file names and extract files.

Files with invalid names (e.g. absolute paths) are now skipped.

Files containing ".." in the name are no longer skipped.
(cherry picked from commit fc829e8)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
@bedevere-app bedevere-app Bot added the type-security A security issue label Apr 27, 2026
@serhiy-storchaka serhiy-storchaka merged commit ab5ef98 into python:3.13 Apr 27, 2026
47 checks passed
@miss-islington miss-islington deleted the backport-fc829e8-3.13 branch April 27, 2026 19:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type-security A security issue

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants