When str.lower() is a security vulnerability in Python
Scored daily by a customisable AI persona to surface the most relevant engineering leadership news.
Python security vulnerability with str.lower() is actionable for developers and touches on software engineering practices.
Python's `str.lower()` call in the IDNA 2003 implementation (via `stringprep` module) introduces a security vulnerability because it uses the Python interpreter's current Unicode version for case-folding, rather than the Unicode 3.2.0 rules mandated by the StringPrep specification (RFC 3454). This mismatch, tracked as CVE-2026-17084, can cause inconsistent domain name normalization, potentially enabling homograph attacks or bypassing security checks. The fix involved creating exception tables to force Unicode 3.2.0 behavior for specific codepoints, ensuring compliance with the IDNA 2003 standard.
Seth Michael Larson