Skip to content

Commit f755ecd

Browse files
committed
Backport warning to shutil.unpack_archive docs
1 parent 3e2c2f9 commit f755ecd

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

Doc/library/shutil.rst

+7
Original file line numberDiff line numberDiff line change
@@ -665,6 +665,13 @@ provided. They rely on the :mod:`zipfile` and :mod:`tarfile` modules.
665665

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

668+
.. warning::
669+
670+
Never extract archives from untrusted sources without prior inspection.
671+
It is possible that files are created outside of the path specified in
672+
the *extract_dir* argument, e.g. members that have absolute filenames
673+
starting with "/" or filenames with two dots "..".
674+
668675
.. versionchanged:: 3.7
669676
Accepts a :term:`path-like object` for *filename* and *extract_dir*.
670677

0 commit comments

Comments
 (0)