{"id":"CVE-2024-12224","aliases":["CVE-2024-12224","GHSA-h97m-ww89-6jmq","RUSTSEC-2024-0421"],"related":[],"kind":"vulnerability","state":"published","title":"idna accepts Punycode labels that do not produce any non-ASCII when decoded","summary":"Improper Validation of Unsafe Equivalence in punycode by the idna crate from Servo rust-url allows an attacker to create a punycode hostname that one part of a system might treat as distinct while another part of that system would treat as equivalent to another hostname.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"Improper Validation of Unsafe Equivalence in punycode by the idna crate from Servo rust-url allows an attacker to create a punycode hostname that one part of a system might treat as distinct while another part of that system would treat as equivalent to another hostname.","source":"cvelist"},{"lang":"en","text":"`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.\n\nConcretely, `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.\n\nIn 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.\n\n## Remedy\n\nUpgrade to `idna` 1.0.3 or later, if depending on `idna` directly, or to `url` 2.5.4 or later, if depending on `idna` via `url`. (This issue was fixed in `idna` 1.0.0, but versions earlier than 1.0.3 are not recommended for other reasons.)\n\nWhen upgrading, please take a moment to read about [alternative Unicode back ends for `idna`](https://docs.rs/crate/idna_adapter/latest).\n\nIf you are using Rust earlier than 1.81 in combination with SQLx 0.8.2 or earlier, please also read an [issue](https://github.com/servo/rust-url/issues/992) about combining them with `url` 2.5.4 and `idna` 1.0.3.\n\n## Additional information\n\nThis issue resulted from `idna` 0.5.0 and earlier implementing the UTS 46 specification literally on this point and the specification having this bug. The specification bug has been fixed in [revision 33 of UTS 46](https://www.unicode.org/reports/tr46/tr46-33.html#Modifications).\n\n## Acknowledgements\n\nThanks to kageshiron for recognizing the security implications of this behavior.","format":"markdown","source":"ghsa"},{"lang":"es","text":"La validación incorrecta de equivalencia insegura en punycode por parte del crate idna de Servo rust-url permite que un atacante cree un nombre de host punycode que una parte de un sistema podría tratar como distinto mientras que otra parte de ese sistema trataría como equivalente a otro nombre de host.","source":"nvd"}],"published":"2024-12-09T12:00:00.000Z","modified":"2026-09-10T03:50:21.562Z","severity":{"scorer":"mozilla","scheme":"CVSS:4.0","vector":"CVSS:4.0/AV:N/AC:H/AT:P/PR:L/UI:N/VC:N/VI:N/VA:N/SC:H/SI:L/SA:N","score":5.1,"rating":"MEDIUM"},"severities":[{"scorer":"mozilla","scheme":"CVSS:4.0","vector":"CVSS:4.0/AV:N/AC:H/AT:P/PR:L/UI:N/VC:N/VI:N/VA:N/SC:H/SI:L/SA:N","score":5.1,"rating":"MEDIUM"},{"scorer":"GitHub","scheme":"CVSS:4.0","vector":"CVSS:4.0/AV:N/AC:H/AT:N/PR:N/UI:N/VC:L/VI:L/VA:N/SC:N/SI:N/SA:N","rating":"MEDIUM"},{"scorer":"NVD","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H","score":8.8,"rating":"HIGH"}],"cwes":["CWE-352","CWE-697","CWE-1289"],"affected":[{"ranges":[{"type":"rust","introduced":"0","fixed":"1.0.0","status":"affected"}],"vendor":"servo","product":"rust-url","package":"idna","repo":"https://github.com/servo/rust-url/","source":"cvelist"},{"ranges":[{"type":"semver","introduced":"0","status":"affected","fixed":"1.0.0"}],"ecosystem":"crates.io","package":"idna","purl":"pkg:cargo/idna","source":"ghsa"},{"ranges":[{"type":"semver","introduced":"0.0.0-0","status":"affected","fixed":"1.0.0"}],"ecosystem":"crates.io","package":"idna","purl":"pkg:cargo/idna","source":"rustsec"},{"ranges":[{"status":"affected","fixed":"1.0.0"}],"vendor":"servo","product":"idna","cpe":"cpe:2.3:a:servo:idna:*:*:*:*:*:rust:*:*","source":"nvd"}],"references":[{"url":"https://rustsec.org/advisories/RUSTSEC-2024-0421.html","tags":["advisory","third-party-advisory","vendor-advisory","web"],"sources":["cvelist","ghsa","rustsec","nvd"]},{"url":"https://bugzilla.mozilla.org/show_bug.cgi?id=1887898","tags":["exploit","issue-tracking","web"],"sources":["cvelist","ghsa","rustsec","nvd"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2024-12224","tags":["advisory"],"sources":["ghsa"]},{"url":"https://github.com/servo/rust-url","tags":["package"],"sources":["ghsa"]},{"url":"https://crates.io/crates/idna","tags":["package"],"sources":["rustsec"]}],"credits":[],"assigner":"mozilla","ssvc":{"scorer":"CISA-ADP","exploitation":"poc","automatable":"no","technicalImpact":"partial","date":"2025-05-30T12:46:53.443Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2024-12224","url":"https://www.cve.org/CVERecord?id=CVE-2024-12224","licence":"CVE Terms of Use","modified":"2025-05-30T12:46:56.887Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-h97m-ww89-6jmq","url":"https://github.com/advisories/GHSA-h97m-ww89-6jmq","licence":"CC-BY-4.0","modified":"2026-09-10T03:50:21.562Z"},{"source":"rustsec","name":"RustSec Advisory Database","id":"RUSTSEC-2024-0421","url":"https://rustsec.org/advisories/RUSTSEC-2024-0421.html","licence":"CC0-1.0","modified":"2025-10-28T06:02:18.000Z"},{"source":"nvd","name":"NVD","id":"CVE-2024-12224","url":"https://nvd.nist.gov/vuln/detail/CVE-2024-12224","licence":"Public domain","modified":"2026-06-17T06:59:17.020Z"}],"updatedAt":"2026-11-25T22:58:52.706Z","epss":{"score":0.00234,"percentile":0.1535,"date":"2026-12-01T12:00:22.000Z"}}