GHSA-mrrj-5mhw-rcf2

Suggest an improvement
Source
https://github.com/advisories/GHSA-mrrj-5mhw-rcf2
Import Source
https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2026/12/GHSA-mrrj-5mhw-rcf2/GHSA-mrrj-5mhw-rcf2.json
JSON Data
https://api.osv.dev/v1/vulns/GHSA-mrrj-5mhw-rcf2
Aliases
Published
2026-12-01T23:50:07Z
Modified
2026-12-02T00:00:04Z
Severity
  • 4.8 (Medium) CVSS_V3 - CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:L/I:L/A:N CVSS Calculator
Summary
Addressable native IDNA backend truncates a host at a pct-encoded NUL when normalizing
Details

Impact

With 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/.

#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.

The pure-Ruby IDNA backend, used when idn-ruby isn't installed, keeps the NUL and isn't affected.

Affected Versions

This vulnerability affects Addressable >= 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.

Workarounds

  • Check the same host you use: if the request is made from uri.normalize or uri.origin, check uri.normalize.host, not uri.host.
  • Reject a URI whose host contains %00.
  • Remove the idn-ruby gem, so Addressable uses the pure-Ruby backend.

Credits

Found by Bob Aman (@sporkmonger).

For more information

If there are any questions or comments about this advisory:

Database specific
{
    "cwe_ids":  [
        "CWE-158",
        "CWE-626"
    ],
    "github_reviewed":  true,
    "github_reviewed_at":  "2026-12-01T23:50:07Z",
    "nvd_published_at":  null,
    "severity":  "MODERATE"
}
References

Affected packages

RubyGems / addressable

Package

Name
addressable
Purl
pkg:gem/addressable

Affected ranges

Type
ECOSYSTEM
Events
Introduced
2.2.5
Fixed
2.10.0

Affected versions

2.*
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.2
2.8.3
2.8.4
2.8.5
2.8.6
2.8.7
2.8.8
2.8.9
2.8.10
2.9.0
2.9.1
2.9.2

Database specific

last_known_affected_version_range
"<= 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"