CVE-2026-126348: Addressable display_uri can show misleading hosts with invalid Punycode A-labels

Published Nov 12, 2026
·
Updated

Impact

Addressable::IDNA.tounicode, 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:

- labels that decode to only ASCII characters, e.g. xn--google- decodes to google; - 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.

Addressable::URI#displayuri uses tounicode, so for https://xn--google-.example.org/ it displays the host google.example.org, while #host, #normalizedhost 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 tounicode against a list of trusted names can likewise treat two different hosts as the same.

The native IDNA implementation, used when libidn and the idn-ruby gem are installed, is not affected. toascii and normalizedhost are not affected.

Affected Versions

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

Workarounds

- Install libidn and the idn-ruby gem, so that Addressable uses the native IDNA implementation. - Don't make security decisions on displayuri or tounicode output. Compare hosts using normalizedhost.

Credits

Reported by @tonghuaroot.

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.0.0 until 2.9.1, the pure-Ruby Addressable::IDNA.tounicode 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#displayuri show a trusted-looking host while host, normalizedhost, and the connection target retain the attacker-controlled encoded host. A trusted-name comparison using Addressable::IDNA.tounicode output can also treat two different hosts as the same without displaying the URI. The native libidn implementation, toascii, and normalizedhost are unaffected. This issue is fixed in version 2.9.1.

— MITRE

Affected Software

1 affected componentFixes available
rubygems/addressable>=2.0.0<2.9.1
2.9.1

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.9.1
  2. Upgrade

    Upgrade Addressable to a version that resolves this vulnerability.

    Fixed in 2.9.1
  3. Compensating control

    Do not make security decisions based on Addressable display_uri or to_unicode output; compare hosts using normalized_host instead.

  4. Compensating control

    Install libidn and the idn-ruby gem so Addressable uses the native IDNA implementation.

Event History

Nov 12, 2026
CVE Published
via MITRE·09:57 PM
Data Sourced
via MITRE·09:57 PM
DescriptionSeverityWeakness
Data Sourced
via NVD·10:19 PM
DescriptionSeverityWeakness
Advisory Published
via GitHub·10:44 PM
Data Sourced
via GitHub·10:44 PM
DescriptionSeverityWeaknessAffected Software

Frequently Asked Questions

1

Which deployments are exposed to this issue?

Deployments using Addressable's pure-Ruby IDNA implementation are affected. The native IDNA implementation is not affected when both libidn and the idn-ruby gem are installed.

2

What does an attacker need to exploit this?

An attacker needs control of a domain containing an invalid Punycode A-label and must cause a user or application to use a URI containing that host. Exploitation is relevant where the application displays display_uri or compares to_unicode output to trusted host names.

3

What can be used safely if an immediate update is not possible?

Do not make trust decisions based on Addressable::IDNA.to_unicode or Addressable::URI#display_uri. Use to_ascii or normalized_host for host handling, as they are not affected.

4

How can I identify potentially affected behavior?

Check whether the application uses the pure-Ruby IDNA implementation and uses to_unicode or display_uri for display or hostname allowlisting. Affected behavior can be observed when a URI such as https://xn--google-.example.org/ displays google.example.org while its host and normalized_host remain xn--google-.example.org.

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