CVE-2024-12224: `idna` accepts Punycode labels that do not produce any non-ASCII when decoded
idna
0.5.0 and earlier accepts Punycode labels that do not produce any non-ASCII output, which means that either ASCII labels or the empty root label can be masked such that they appear unequal without IDNA processing or when processed with a different implementation and equal when processed with idna
0.5.0 or earlier.
Concretely, example.org
and xn--example-.org
become equal after processing by idna
0.5.0 or earlier. Also, example.org.xn--
and example.org.
become equal after processing by idna
0.5.0 or earlier.
In applications using idna
(but not in idna
itself) this may be able to lead to privilege escalation when host name comparison is part of a privilege check and the behavior is combined with a client that resolves domains with such labels instead of treating them as errors that preclude DNS resolution / URL fetching and with the attacker managing to introduce a DNS entry (and TLS certificate) for an xn--
-masked name that turns into the name of the target when processed by idna
0.5.0 or earlier.
References
Detect and mitigate CVE-2024-12224 with GitLab Dependency Scanning
Secure your software supply chain by verifying that all open source dependencies used in your projects contain no disclosed vulnerabilities. Learn more about Dependency Scanning →