Skip to content

bpo-20749: Copy security warning to shutil #29184

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

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions Doc/library/shutil.rst
Original file line number Diff line number Diff line change
Expand Up @@ -657,6 +657,13 @@ provided. They rely on the :mod:`zipfile` and :mod:`tarfile` modules.
registered for that extension. In case none is found,
a :exc:`ValueError` is raised.

.. warning::

Never extract archives from untrusted sources without prior inspection.
It is possible that files are created outside of *path*, e.g. members
that have absolute filenames starting with ``"/"`` or filenames with two
dots ``".."``.

.. audit-event:: shutil.unpack_archive filename,extract_dir,format shutil.unpack_archive

.. versionchanged:: 3.7
Expand Down
1 change: 1 addition & 0 deletions Misc/ACKS
Original file line number Diff line number Diff line change
Expand Up @@ -1727,6 +1727,7 @@ Andrew Svetlov
Paul Swartz
Dennis Sweeney
Al Sweigart
Christopher Swenson
Sviatoslav Sydorenko
Thenault Sylvain
Péter Szabó
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Copied security warning from :func:`tarfile.extractall()` to
:func:`shutil.unpack_archive()`.