[3.14] gh-155292: Don't consider Unicode codepoint attributes outside RFC 3454 (GH-155293) - #156020
Conversation
…RFC 3454 (pythonGH-155293) Due to a bug, some Unicode codepoint attributes were considered for characters not yet defined in Unicode 3.2.0 or attributes which changed in later Unicode versions. RFC 3454 (StringPrep) requires using Unicode 3.2.0 strictly. Co-authored-by: Stan Ulbrych <89152624+stanfromireland@users.noreply.github.com> Co-authored-by: Petr Viktorin <encukou@gmail.com> (cherry picked from commit 7e109d0)
|
Note that #144815 wasn't backported to 3.14, so unassigned characters don't have bidi values. |
Backport the pending upstream 3.14 backport of the stringprep fix (python/cpython#156020, upstream issue gh-155292): the stringprep module consulted the live Unicode database instead of the Unicode 3.2.0 snapshot mandated by RFC 3454, causing IDNA 2003 mismatches for codepoints added or changed since Unicode 3.2.0. The patch is the squashed, content-identical form of the two PR commits and applies onto the v3.14.7 tag. Signed-off-by: Markus Boehme <markus.boehme@chainguard.dev> Export: c199cf44388ce56624c8472d0abf63865c7e7ccc
… for CVE-2026-17084 (#293385) * fix(python-3.10): backport fix for CVE-2026-17084 The stringprep module consulted the live Unicode database instead of the Unicode 3.2.0 snapshot mandated by RFC 3454, causing IDNA 2003 mismatches for codepoints added or changed since Unicode 3.2.0 (upstream issue gh-155292). Upstream has no 3.10 backport PR yet: the fix is queued behind the still-open 3.14 backport python/cpython#156020, which carries needs-backport labels for 3.10 through 3.13. The patch is derived from that PR, with the unidata_version canary assert in Lib/stringprep.py re-pinned to Unicode 13.0.0 as shipped with Python 3.10, and the "old = False" test class attribute defined, which the new test expects but only 3.13+ provide (introduced by the gh-142681 test refactor that was never backported to security-only branches). The patch content is otherwise identical to the upstream PR. Signed-off-by: Markus Boehme <markus.boehme@chainguard.dev> * fix(python-3.11): backport fix for CVE-2026-17084 The stringprep module consulted the live Unicode database instead of the Unicode 3.2.0 snapshot mandated by RFC 3454, causing IDNA 2003 mismatches for codepoints added or changed since Unicode 3.2.0 (upstream issue gh-155292). Upstream has no 3.11 backport PR yet: the fix is queued behind the still-open 3.14 backport python/cpython#156020, which carries needs-backport labels for 3.10 through 3.13. The patch is derived from that PR, with the unidata_version canary assert in Lib/stringprep.py re-pinned to Unicode 14.0.0 as shipped with Python 3.11, and the "old = False" test class attribute defined, which the new test expects but only 3.13+ provide (introduced by the gh-142681 test refactor that was never backported to security-only branches). The patch content is otherwise identical to the upstream PR. Signed-off-by: Markus Boehme <markus.boehme@chainguard.dev> * fix(python-3.12): backport fix for CVE-2026-17084 The stringprep module consulted the live Unicode database instead of the Unicode 3.2.0 snapshot mandated by RFC 3454, causing IDNA 2003 mismatches for codepoints added or changed since Unicode 3.2.0 (upstream issue gh-155292). Upstream has no 3.12 backport PR yet: the fix is queued behind the still-open 3.14 backport python/cpython#156020, which carries needs-backport labels for 3.10 through 3.13. The patch is derived from that PR, with the unidata_version canary assert in Lib/stringprep.py re-pinned to Unicode 15.0.0 as shipped with Python 3.12, and the "old = False" test class attribute defined, which the new test expects but only 3.13+ provide (introduced by the gh-142681 test refactor that was never backported to security-only branches). The patch content is otherwise identical to the upstream PR. Signed-off-by: Markus Boehme <markus.boehme@chainguard.dev> * fix(python-3.13): backport fix for CVE-2026-17084 The stringprep module consulted the live Unicode database instead of the Unicode 3.2.0 snapshot mandated by RFC 3454, causing IDNA 2003 mismatches for codepoints added or changed since Unicode 3.2.0 (upstream issue gh-155292). Upstream has no 3.13 backport PR yet: the fix is queued behind the still-open 3.14 backport python/cpython#156020, which carries needs-backport labels for 3.10 through 3.13. The patch is derived from that PR, with the unidata_version canary assert in Lib/stringprep.py re-pinned to Unicode 15.1.0 as shipped with Python 3.13. The patch content is otherwise identical to the upstream PR. Signed-off-by: Markus Boehme <markus.boehme@chainguard.dev> --------- Signed-off-by: Markus Boehme <markus.boehme@chainguard.dev> Export: 3ab7270fc25d4029c29fb582a68088006a22dd9e
sethmlarson
left a comment
There was a problem hiding this comment.
LGTM, thanks Petr! 🙏
|
Thanks @encukou for the PR 🌮🎉.. I'm working now to backport this PR to: 3.10, 3.11, 3.12, 3.13. |
|
Sorry, @encukou, I could not cleanly backport this to |
|
Sorry, @encukou, I could not cleanly backport this to |
|
GH-156922 is a backport of this pull request to the 3.13 branch. |
|
Sorry, @encukou, I could not cleanly backport this to |
|
GH-156930 is a backport of this pull request to the 3.12 branch. |
|
GH-156931 is a backport of this pull request to the 3.11 branch. |
|
GH-156932 is a backport of this pull request to the 3.10 branch. |
Due to a bug, some Unicode codepoint attributes were considered for characters not yet defined in Unicode 3.2.0 or attributes which changed in later Unicode versions. RFC 3454 (StringPrep) requires using Unicode 3.2.0 strictly.
(cherry picked from commit 7e109d0)