{"id":"CVE-2026-126348","aliases":["CVE-2026-126348","GHSA-9crm-g4mf-wc5j"],"related":[],"kind":"vulnerability","state":"published","title":"Addressable display_uri can show misleading hosts with invalid Punycode A-labels","summary":"Addressable is an alternative implementation to the URI implementation that is part of Ruby's standard library. From 2.0.0 until 2.9.1, the pure-Ruby Addressable::IDNA.to_unicode implementation decodes invalid Punycode A-labels instead of returning them unchanged. Labels that decode to ASCII text or fail to convert back to the same A-label can therefore make Addressable::URI#display_uri show a trusted-looking host while host, normalized_host, and the connection target retain the attacker-controlled encoded host. A trusted-name comparison using Addressable::IDNA.to_unicode output can also treat two different hosts as the same without displaying the URI. The native libidn implementation, to_ascii, and normalized_host are unaffected. This issue is fixed in version 2.9.1.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"Addressable is an alternative implementation to the URI implementation that is part of Ruby's standard library. From 2.0.0 until 2.9.1, the pure-Ruby Addressable::IDNA.to_unicode implementation decodes invalid Punycode A-labels instead of returning them unchanged. Labels that decode to ASCII text or fail to convert back to the same A-label can therefore make Addressable::URI#display_uri show a trusted-looking host while host, normalized_host, and the connection target retain the attacker-controlled encoded host. A trusted-name comparison using Addressable::IDNA.to_unicode output can also treat two different hosts as the same without displaying the URI. The native libidn implementation, to_ascii, and normalized_host are unaffected. This issue is fixed in version 2.9.1.","source":"cvelist"},{"lang":"en","text":"### Impact\n\n`Addressable::IDNA.to_unicode`, in the pure-Ruby IDNA implementation, decodes Punycode labels (labels beginning with `xn--`) that are not valid A-labels. Those labels are returned in decoded form, when they should be returned unchanged. That includes:\n\n- labels that decode to only ASCII characters, e.g. `xn--google-` decodes to `google`;\n- labels that decode to text that doesn't convert back to the same label (RFC 3490 §4.2), e.g. text that isn't in normalized form.\n\n`Addressable::URI#display_uri` uses `to_unicode`, so for `https://xn--google-.example.org/` it displays the host `google.example.org`, while `#host`, `#normalized_host` and any connection made from the URI use `xn--google-.example.org`. An attacker who controls a domain can therefore have a URI displayed as a host they don't control. Applications that compare the result of `to_unicode` against a list of trusted names can likewise treat two different hosts as the same.\n\nThe native IDNA implementation, used when libidn and the `idn-ruby` gem are installed, is not affected. `to_ascii` and `normalized_host` are not affected.\n\n### Affected Versions\n\nThis vulnerability affects Addressable >= 2.0.0, the first version with the pure-Ruby IDNA implementation, when that implementation is in use. It is fixed in 2.9.1, where such labels are returned unchanged, as with libidn.\n\n### Workarounds\n\n- Install libidn and the `idn-ruby` gem, so that Addressable uses the native IDNA implementation.\n- Don't make security decisions on `display_uri` or `to_unicode` output. Compare hosts using `normalized_host`.\n\n### Credits\n\nReported by @tonghuaroot.\n\n### For more information\n\nIf there are any questions or comments about this advisory:\n* [Open an issue](https://github.com/sporkmonger/addressable/issues)","format":"markdown","source":"ghsa"}],"published":"2026-11-12T21:57:55.237Z","modified":"2026-11-13T16:08:55.993Z","severity":{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:L/A:N","score":4.3,"rating":"MEDIUM"},"severities":[{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:L/A:N","score":4.3,"rating":"MEDIUM"},{"scorer":"GitHub","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:L/A:N","score":4.3,"rating":"MEDIUM"}],"cwes":["CWE-20","CWE-1007"],"affected":[{"ranges":[{"version":">= 2.0.0, < 2.9.1","status":"affected"}],"vendor":"sporkmonger","product":"addressable","source":"cvelist"},{"ranges":[{"type":"ecosystem","introduced":"2.0.0","status":"affected","fixed":"2.9.1"}],"ecosystem":"RubyGems","package":"addressable","purl":"pkg:gem/addressable","source":"ghsa"}],"references":[{"url":"https://github.com/sporkmonger/addressable/security/advisories/GHSA-9crm-g4mf-wc5j","tags":["web","x-refsource-confirm"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://github.com/sporkmonger/addressable/commit/b8a59cc0e03f8704f1d7c8122fc8f7ef8548362d","tags":["web","x-refsource-misc"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://github.com/sporkmonger/addressable/releases/tag/addressable-2.9.1","tags":["web","x-refsource-misc"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://github.com/rubysec/ruby-advisory-db/blob/master/gems/addressable/GHSA-9crm-g4mf-wc5j.yml","tags":["web"],"sources":["ghsa"]},{"url":"https://github.com/sporkmonger/addressable","tags":["package"],"sources":["ghsa"]}],"credits":[],"assigner":"GitHub_M","ssvc":{"scorer":"CISA-ADP","exploitation":"none","automatable":"no","technicalImpact":"partial","date":"2026-11-13T00:34:06.519Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2026-126348","url":"https://www.cve.org/CVERecord?id=CVE-2026-126348","licence":"CVE Terms of Use","modified":"2026-11-13T00:34:23.442Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-9crm-g4mf-wc5j","url":"https://github.com/advisories/GHSA-9crm-g4mf-wc5j","licence":"CC-BY-4.0","modified":"2026-11-12T23:00:05.713Z"},{"source":"nvd","name":"NVD","id":"CVE-2026-126348","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-126348","licence":"Public domain","modified":"2026-11-13T16:08:55.993Z"}],"updatedAt":"2026-11-25T22:59:50.570Z","epss":{"score":0.0027,"percentile":0.20611,"date":"2026-12-01T12:00:22.000Z"}}