Skip to content

Commit 8404e15

Browse files
[3.13] gh-144133: Add warning about untrusted input to the idna codec (GH-155475) (#157563)
(cherry picked from commit 37452c7) Co-authored-by: Stan Ulbrych <stan@python.org>
1 parent a471483 commit 8404e15

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
@@ -1369,6 +1369,15 @@ encodings.
13691369
| | | :mod:`encodings.idna`. |
13701370
| | | Only ``errors='strict'`` |
13711371
| | | is supported. |
1372+
| | | |
1373+
| | | .. warning:: |
1374+
| | | |
1375+
| | | This codec builds on |
1376+
| | | ``punycode``, whose |
1377+
| | | algorithms scale |
1378+
| | | poorly, so limit the |
1379+
| | | length of untrusted |
1380+
| | | input. |
13721381
+--------------------+---------+---------------------------+
13731382
| mbcs | ansi, | Windows only: Encode the |
13741383
| | dbcs | operand according to the |
@@ -1601,6 +1610,11 @@ Applications) and :rfc:`3492` (Nameprep: A Stringprep Profile for
16011610
Internationalized Domain Names (IDN)). It builds upon the ``punycode`` encoding
16021611
and :mod:`stringprep`.
16031612

1613+
.. warning::
1614+
1615+
This module builds on ``punycode``, whose algorithms scale poorly, so limit
1616+
the length of untrusted input.
1617+
16041618
If you need the IDNA 2008 standard from :rfc:`5891` and :rfc:`5895`, use the
16051619
third-party :pypi:`idna` module.
16061620

0 commit comments

Comments
 (0)