Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions HISTORY.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,18 @@
History
-------

2.10.post1 (2026-08-06)
+++++++++++++++++++++++

- ActiveState security release. Fix CVE-2024-3651 (GHSA-jjg7-2v4v-x38h):
specially crafted input to idna.encode() could consume an exceptional
amount of CPU because the joining-type scan in valid_contextj() was
quadratic in the label length. Labels containing a Non_Joining codepoint
between a joiner and its context were also wrongly accepted, contrary to
RFC 5892 Appendix A.1. Backported from upstream idna 3.7; the
joining_types table is regenerated from Unicode 13.0.0
extracted/DerivedJoiningType.txt.

2.10 (2020-06-27)
+++++++++++++++++

Expand Down
8 changes: 6 additions & 2 deletions idna/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -161,9 +161,11 @@ def valid_contextj(label, pos):
joining_type = idnadata.joining_types.get(ord(label[i]))
if joining_type == ord('T'):
continue
if joining_type in [ord('L'), ord('D')]:
elif joining_type in [ord('L'), ord('D')]:
ok = True
break
else:
break

if not ok:
return False
Expand All @@ -173,9 +175,11 @@ def valid_contextj(label, pos):
joining_type = idnadata.joining_types.get(ord(label[i]))
if joining_type == ord('T'):
continue
if joining_type in [ord('R'), ord('D')]:
elif joining_type in [ord('R'), ord('D')]:
ok = True
break
else:
break
return ok

if cp_value == 0x200d:
Expand Down
Loading