Skip to content

Commit 87b459e

Browse files
[3.15] gh-144133: Add warning about untrusted input to the idna codec (GH-155475) (#157561)
Co-authored-by: Stan Ulbrych <stan@python.org>
1 parent f507e69 commit 87b459e

1 file changed

Lines changed: 14 additions & 0 deletions

File tree

Doc/library/codecs.rst

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1383,6 +1383,15 @@ encodings.
13831383
| | | :mod:`encodings.idna`. |
13841384
| | | Only ``errors='strict'`` |
13851385
| | | is supported. |
1386+
| | | |
1387+
| | | .. warning:: |
1388+
| | | |
1389+
| | | This codec builds on |
1390+
| | | ``punycode``, whose |
1391+
| | | algorithms scale |
1392+
| | | poorly, so limit the |
1393+
| | | length of untrusted |
1394+
| | | input. |
13861395
+--------------------+---------+---------------------------+
13871396
| mbcs | ansi, | Windows only: Encode the |
13881397
| | dbcs | operand according to the |
@@ -1626,6 +1635,11 @@ Applications) and :rfc:`3492` (Nameprep: A Stringprep Profile for
16261635
Internationalized Domain Names (IDN)). It builds upon the ``punycode`` encoding
16271636
and :mod:`stringprep`.
16281637

1638+
.. warning::
1639+
1640+
This module builds on ``punycode``, whose algorithms scale poorly, so limit
1641+
the length of untrusted input.
1642+
16291643
If you need the IDNA 2008 standard from :rfc:`5891` and :rfc:`5895`, use the
16301644
third-party :pypi:`idna` module.
16311645

0 commit comments

Comments
 (0)