Skip to content

When str.lower() is a security vulnerability in Python

7 relevance
Score Breakdown
technical depth
8
novelty
7
actionability
7
community
6
strategic
5
personal
7

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.

Security sethmlarson.dev
When str.lower() is a security vulnerability in Python
Summary

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.

Author

Seth Michael Larson