Skip to content

gh-146581: Update docs for dangerous filenames in ZIP files#149994

Open
serhiy-storchaka wants to merge 1 commit into
python:mainfrom
serhiy-storchaka:unzip-docs-bad-filenames
Open

gh-146581: Update docs for dangerous filenames in ZIP files#149994
serhiy-storchaka wants to merge 1 commit into
python:mainfrom
serhiy-storchaka:unzip-docs-bad-filenames

Conversation

@serhiy-storchaka
Copy link
Copy Markdown
Member

@serhiy-storchaka serhiy-storchaka commented May 18, 2026

@read-the-docs-community
Copy link
Copy Markdown

Documentation build overview

📚 cpython-previews | 🛠️ Build #32738511 | 📁 Comparing 92d653a against main (bd6bf91)

  🔍 Preview build  

2 files changed
± library/shutil.html
± library/zipfile.html

Comment thread Doc/library/shutil.rst
@@ -750,7 +750,7 @@ provided. They rely on the :mod:`zipfile` and :mod:`tarfile` modules.
Never extract archives from untrusted sources without prior inspection.
It is possible that files are created outside of the path specified in
the *extract_dir* argument, e.g. members that have absolute filenames
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
the *extract_dir* argument, e.g. members that have absolute filenames
the *extract_dir* argument, for example, members that have absolute filenames

Can we fix this while we're here please. We should not have latin abbreviations.

Comment thread Doc/library/zipfile.rst
the :meth:`ZipFile.extract` and :meth:`ZipFile.extractall` methods, it is the
caller's responsibility to validate or sanitize filenames to prevent path traversal
vulnerabilities (e.g., filenames containing ".." or absolute paths). When handling
vulnerabilities (e.g., absolute paths or paths with ".." cmponents). When handling
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
vulnerabilities (e.g., absolute paths or paths with ".." cmponents). When handling
vulnerabilities (for example, absolute paths or paths with ".." components). When handling

Latin abbreviation here too, and a typo.

Comment thread Doc/library/zipfile.rst
@@ -412,8 +412,8 @@ ZipFile objects

Never extract archives from untrusted sources without prior inspection.
It is possible that files are created outside of *path*, e.g. members
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
It is possible that files are created outside of *path*, e.g. members
It is possible that files are created outside of *path*, for example, members

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

Labels

awaiting core review docs Documentation in the Doc dir needs backport to 3.13 bugs and security fixes needs backport to 3.14 bugs and security fixes needs backport to 3.15 pre-release feature fixes, bugs and security fixes skip news

Projects

Status: Todo

Development

Successfully merging this pull request may close these issues.

2 participants