]> granicus.if.org Git - python/commitdiff
Warn about possible risks when extracting untrusted archives.
authorLars Gustäbel <lars@gustaebel.de>
Thu, 30 Aug 2007 20:24:31 +0000 (20:24 +0000)
committerLars Gustäbel <lars@gustaebel.de>
Thu, 30 Aug 2007 20:24:31 +0000 (20:24 +0000)
Doc/library/tarfile.rst

index a0cd6732997633cf2038f97c38588d4f5d070567..f7e339f7fdb7525f6b992291fcdc6fff41e76fbb 100644 (file)
@@ -337,6 +337,13 @@ object, see :ref:`tarinfo-objects` for details.
    reset each time a file is created in it. And, if a directory's permissions do
    not allow writing, extracting files to it will fail.
 
+   .. 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 ``".."``.
+
    .. versionadded:: 2.5
 
 
@@ -353,6 +360,10 @@ object, see :ref:`tarinfo-objects` for details.
       are some issues you must take care of yourself. See the description for
       :meth:`extractall` above.
 
+   .. warning::
+
+      See the warning for :meth:`extractall`.
+
 
 .. method:: TarFile.extractfile(member)