{"id":"GHSA-mrrj-5mhw-rcf2","summary":"Addressable native IDNA backend truncates a host at a pct-encoded NUL when normalizing","details":"### Impact\n\nWith the native IDNA backend, which Addressable uses when the `idn-ruby` gem is installed, a host with a pct-encoded NUL is cut short when it is normalized. `Addressable::URI#normalized_host` decodes the host and passes each label to libidn, which reads the NUL as the end of the string and drops the rest of the label. `http://internal.example%00x/` normalizes to `http://internal.example/`.\n\n`#host` and `#to_s` keep the host as written, while `#normalize`, `#normalized_host`, `#normalized_authority`, `#normalized_site`, `#origin` and `#display_uri` give the shortened host, and `#==` treats the URI as equal to one with the shortened host. An application that checks one form and uses the other can be made to send a request to a host it meant to block: a denylist check of `uri.host` lets `internal.example%00x` through, and a request built from `uri.normalize` or `uri.origin` goes to `internal.example`. An application would need to mix the two to be vulnerable.\n\nThe pure-Ruby IDNA backend, used when `idn-ruby` isn't installed, keeps the NUL and isn't affected.\n\n### Affected Versions\n\nThis vulnerability affects Addressable \u003e= 2.2.5 when the `idn-ruby` gem is installed. It is fixed in 2.10.0, where the native backend leaves a label with a NUL unchanged, as the pure-Ruby backend does.\n\n### Workarounds\n\n- Check the same host you use: if the request is made from `uri.normalize` or `uri.origin`, check `uri.normalize.host`, not `uri.host`.\n- Reject a URI whose host contains `%00`.\n- Remove the `idn-ruby` gem, so Addressable uses the pure-Ruby backend.\n\n### Credits\n\nFound by Bob Aman (@sporkmonger).\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)","aliases":["CVE-2026-141539"],"modified":"2026-12-02T00:00:04.150555235Z","published":"2026-12-01T23:50:07Z","database_specific":{"github_reviewed":true,"github_reviewed_at":"2026-12-01T23:50:07Z","nvd_published_at":null,"cwe_ids":["CWE-158","CWE-626"],"severity":"MODERATE"},"references":[{"type":"WEB","url":"https://github.com/sporkmonger/addressable/security/advisories/GHSA-mrrj-5mhw-rcf2"},{"type":"WEB","url":"https://github.com/sporkmonger/addressable/commit/19da0e8a2f4aed2328b25cbde83d7053890d8972"},{"type":"PACKAGE","url":"https://github.com/sporkmonger/addressable"},{"type":"WEB","url":"https://github.com/sporkmonger/addressable/releases/tag/addressable-2.10.0"}],"affected":[{"package":{"name":"addressable","ecosystem":"RubyGems","purl":"pkg:gem/addressable"},"ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"2.2.5"},{"fixed":"2.10.0"}]}],"versions":["2.2.5","2.2.6","2.2.7","2.2.8","2.3.2","2.3.3","2.3.4","2.3.5","2.3.6","2.3.7","2.3.8","2.4.0","2.5.0","2.5.1","2.5.2","2.6.0","2.7.0","2.8.0","2.8.1","2.8.10","2.8.2","2.8.3","2.8.4","2.8.5","2.8.6","2.8.7","2.8.8","2.8.9","2.9.0","2.9.1","2.9.2"],"database_specific":{"last_known_affected_version_range":"\u003c= 2.9.2","source":"https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2026/12/GHSA-mrrj-5mhw-rcf2/GHSA-mrrj-5mhw-rcf2.json"}}],"schema_version":"1.9.2","severity":[{"type":"CVSS_V3","score":"CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:L/I:L/A:N"}]}