Advisory Database
  • Advisories
  • Dependency Scanning
  1. cargo
  2. ›
  3. idna
  4. ›
  5. CVE-2024-12224

CVE-2024-12224: `idna` accepts Punycode labels that do not produce any non-ASCII when decoded

December 9, 2024

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

  • bugzilla.mozilla.org/show_bug.cgi?id=1887898
  • github.com/advisories/GHSA-h97m-ww89-6jmq
  • github.com/servo/rust-url
  • nvd.nist.gov/vuln/detail/CVE-2024-12224
  • rustsec.org/advisories/RUSTSEC-2024-0421.html

Code Behaviors & Features

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 →

Affected versions

All versions before 1.0.0

Fixed versions

  • 1.0.0

Solution

Upgrade to version 1.0.0 or above.

Weakness

  • CWE-697: Incorrect Comparison

Source file

cargo/idna/CVE-2024-12224.yml

Spotted a mistake? Edit the file on GitLab.

  • Site Repo
  • About GitLab
  • Terms
  • Privacy Statement
  • Contact

Page generated Wed, 14 May 2025 12:16:05 +0000.