Skip to content
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
Comment thread
swenson marked this conversation as resolved.
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()`.