CVE-2026-141539: Addressable native IDNA backend truncates a host at a pct-encoded NUL when normalizing

Published Dec 1, 2026
·
Updated

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#normalizedhost 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 #tos keep the host as written, while #normalize, #normalizedhost, #normalizedauthority, #normalizedsite, #origin and #displayuri 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: Open an issue

Other sources

Addressable is an alternative implementation to the URI implementation that is part of Ruby's standard library. From 2.2.5 until 2.10.0, With the native IDNA backend, Addressable::URI#normalizedhost passes a percent-encoded NUL after decoding to libidn, which truncates the remainder of the label. An application that checks the original host but uses normalize, origin, displayuri, or normalizedhost can be made to send a request to a shortened host that it intended to block. This issue is fixed in version 2.10.0.

— MITRE

Affected Software

2 affected componentsFixes available
rubygems/addressable>=2.2.5<2.10.0
rubygems/addressable>=2.2.5<=2.9.2
2.10.0

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Upgrade

    Upgrade rubygems/addressable to a version that resolves this vulnerability.

    Fixed in 2.10.0
  2. Upgrade

    Upgrade Addressable to a version that resolves this vulnerability.

    Fixed in 2.10.0
  3. Remove

    Remove idn-ruby from your environment.

    Remove the idn-ruby gem so Addressable uses the pure-Ruby IDNA backend.

  4. Compensating control

    Reject any URI whose host contains %00.

  5. Compensating control

    Check the same host representation that the request uses; for requests made from uri.normalize or uri.origin, check uri.normalize.host rather than uri.host.

Event History

Dec 1, 2026
CVE Published
via MITRE·09:47 PM
Data Sourced
via MITRE·09:47 PM
DescriptionSeverityWeakness
Data Sourced
via NVD·10:18 PM
DescriptionSeverityWeakness
Advisory Published
via GitHub·11:50 PM
Data Sourced
via GitHub·11:50 PM
DescriptionSeverityWeaknessAffected Software

Frequently Asked Questions

1

Which deployments are affected?

Addressable versions from 2.2.5 up to, but not including, 2.10.0 are affected when using the native IDNA backend. The issue applies where an application validates an original host and later uses a normalized host value.

2

What does an attacker need to exploit this?

An attacker needs to supply a host containing a percent-encoded NUL and reach an application flow that checks the original host but uses normalize, origin, display_uri, or normalized_host for the resulting request. The decoded NUL can cause libidn to truncate the rest of the label, changing the destination host.

3

What should be done if the application cannot be upgraded immediately?

Avoid using normalized Addressable host values to make requests when authorization or blocklist decisions were made against the original host. Ensure the host value used for validation is the same value used for the outbound request, and reject percent-encoded NULs in host input.

4

How can I determine whether an application is exposed?

Review uses of Addressable::URI#normalized_host and related normalize, origin, or display_uri methods. Exposure exists if a host is checked before normalization but a normalized result is subsequently used to select the request destination.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203