@@ -40,9 +40,11 @@ Some facts and figures:
4040 Archives are extracted using a :ref:`filter <tarfile-extraction-filter>`,
4141 which makes it possible to either limit surprising/dangerous features,
4242 or to acknowledge that they are expected and the archive is fully trusted.
43- By default, archives are fully trusted, but this default is deprecated
44- and slated to change in Python 3.14.
4543
44+ .. versionchanged:: 3.14
45+ The default extraction filter was 'fully trusted' but is now 'data' which
46+ which disallows dangerous features like links to absolute paths or paths
47+ outside the destination.
4648
4749.. function:: open(name=None, mode='r', fileobj=None, bufsize=10240, **kwargs)
4850
@@ -495,19 +497,23 @@ be finalized; only the internally used file object will be closed. See the
495497 The *filter* argument specifies how ``members`` are modified or rejected
496498 before extraction.
497499 See :ref:`tarfile-extraction-filter` for details.
498- It is recommended to set this explicitly depending on which *tar* features
499- you need to support .
500+ It is recommended to set this explicitly only if unusual *tar* features
501+ are required .
500502
501503 .. warning::
502504
503- Never extract archives from untrusted sources without prior inspection.
505+ The default filter is set to ``filter='data'`` to prevent the most
506+ dangerous security issues, read the :ref:`tarfile-extraction-filter`
507+ section for details.
508+
509+ Never extract archives from untrusted sources without prior inspection,
510+ even when using the `data` filter, but especially if using the `tar` or
511+ `fully_trusted` filters.
512+
504513 It is possible that files are created outside of *path*, e.g. members
505514 that have absolute filenames starting with ``"/"`` or filenames with two
506515 dots ``".."``.
507516
508- Set ``filter='data'`` to prevent the most dangerous security issues,
509- and read the :ref:`tarfile-extraction-filter` section for details.
510-
511517 .. versionchanged:: 3.5
512518 Added the *numeric_owner* parameter.
513519
@@ -538,8 +544,9 @@ be finalized; only the internally used file object will be closed. See the
538544
539545 See the warning for :meth:`extractall`.
540546
541- Set ``filter='data'`` to prevent the most dangerous security issues,
542- and read the :ref:`tarfile-extraction-filter` section for details.
547+ The default filter is set to ``filter='data'`` to prevent the most
548+ dangerous security issues, read the :ref:`tarfile-extraction-filter`
549+ section for details.
543550
544551 .. versionchanged:: 3.2
545552 Added the *set_attrs* parameter.
@@ -603,12 +610,7 @@ be finalized; only the internally used file object will be closed. See the
603610 argument to :meth:`~TarFile.extract`.
604611
605612 If ``extraction_filter`` is ``None`` (the default),
606- calling an extraction method without a *filter* argument will raise a
607- ``DeprecationWarning``,
608- and fall back to the :func:`fully_trusted <fully_trusted_filter>` filter,
609- whose dangerous behavior matches previous versions of Python.
610-
611- In Python 3.14+, leaving ``extraction_filter=None`` will cause
613+ calling an extraction method without a *filter* argument will cause
612614 extraction methods to use the :func:`data <data_filter>` filter by default.
613615
614616 The attribute may be set on instances or overridden in subclasses.
@@ -992,12 +994,7 @@ can be:
992994
993995* ``None`` (default): Use :attr:`TarFile.extraction_filter`.
994996
995- If that is also ``None`` (the default), raise a ``DeprecationWarning``,
996- and fall back to the ``'fully_trusted'`` filter, whose dangerous behavior
997- matches previous versions of Python.
998-
999- In Python 3.14, the ``'data'`` filter will become the default instead.
1000- It's possible to switch earlier; see :attr:`TarFile.extraction_filter`.
997+ If that is also ``None`` (the default), the ``'data'`` filter will be used.
1001998
1002999* A callable which will be called for each extracted member with a
10031000 :ref:`TarInfo <tarinfo-objects>` describing the member and the destination
0 commit comments