Skip to content

Commit 8332ea3

Browse files
committed
Backport warning to shutil.unpack_archive docs
1 parent a11a198 commit 8332ea3

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

Doc/library/shutil.rst

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -562,6 +562,13 @@ provided. They rely on the :mod:`zipfile` and :mod:`tarfile` modules.
562562
The ``'data'`` filter will become the default for tar files
563563
in Python 3.14.
564564

565+
.. warning::
566+
567+
Never extract archives from untrusted sources without prior inspection.
568+
It is possible that files are created outside of the path specified in
569+
the *extract_dir* argument, e.g. members that have absolute filenames
570+
starting with "/" or filenames with two dots "..".
571+
565572
.. versionchanged:: 3.7
566573
Accepts a :term:`path-like object` for *filename* and *extract_dir*.
567574

0 commit comments

Comments
 (0)