⚠️

Disclaimer & Liability

The content provided on this website is for educational, research, and security awareness purposes only. Any unauthorized, illegal, or abusive use of the information, tools, and techniques discussed is solely the responsibility of the user. The author and publisher assume no liability for any damages, injuries, or consequences resulting from the misuse of this content.

CVE-2026-141539: Addressable Host-Validation Bypass via Encoded NUL Bytes | Alireza Bolbolabadi - Red Team Security
LOADING

CVE-2026-141539: Addressable Host-Validation Bypass via Encoded NUL Bytes

Executive summary

CVE-2026-141539 is a host-validation bypass vulnerability in Addressable, a Ruby gem that provides an alternative to the URI implementation included with Ruby's standard library. Versions 2.2.5 through versions earlier than 2.10.0 are affected when Addressable uses its native IDNA backend.

The flaw creates a mismatch between the hostname an application checks and the hostname it later uses to make a request. A crafted URI containing a percent-encoded NUL byte (%00) in its host component can be normalized into a shorter hostname, potentially bypassing application-level URL restrictions.

The vendor fix is available in Addressable 2.10.0. Although the published CVSS score is 4.8, exploitation depends on a specific validation pattern, and the supplied sources contain no evidence of active exploitation. The practical risk is therefore greatest for applications that enforce SSRF controls or destination allow-lists with Addressable.

Detailed analysis

Affected systems

CVE-2026-141539 affects applications that use Addressable 2.2.5 through versions earlier than 2.10.0 with the native IDNA backend. Addressable is a library rather than a standalone service, so exposure depends on whether it is included directly or transitively in a Ruby application and whether the application's request flow matches the vulnerable pattern.

Potentially relevant workloads include Ruby HTTP clients, crawlers, link checkers, OAuth integrations, web services, and other software that parses attacker-controlled URLs before making outbound requests.

The advisory identifies four affected APIs:

  • Addressable::URI#normalized_host

  • Addressable::URI#normalize

  • Addressable::URI#origin

  • Addressable::URI#display_uri

Root cause

The native IDNA path in Addressable::URI#normalized_host decodes a percent-encoded NUL byte before passing the host to libidn. Libidn treats the NUL as a C-string terminator, causing the remainder of the host label to be truncated.

A vulnerable request flow can arise when an application performs two different operations:

  1. It checks the original, unnormalized hostname against an allow-list, block-list, or SSRF policy.

  1. It later builds the outbound destination with normalized_host, normalize, origin, or display_uri.

Under those conditions, a URL containing %00 may pass a policy check as one hostname but resolve to a different, shorter hostname when the request is dispatched. This can cause the application to connect to a destination that its security policy did not evaluate as intended.

Security impact

The primary impact is an authorization or destination-validation bypass. Depending on how the affected application uses Addressable, this could permit requests to hosts outside an intended allow-list, bypass a block-list, or weaken an SSRF mitigation.

The supplied record does not establish universal remote compromise, authentication bypass, code execution, or data theft. Exploitation requires the vulnerable library version, the native IDNA backend, and an application pattern that validates one hostname representation while using another for the outbound request.

Exploitation status

The provided sources contain no evidence of exploitation in the wild. CVE-2026-141539 is also not identified as present in the CISA Known Exploited Vulnerabilities catalog based on the supplied risk assessment.

This absence of evidence limits claims of active exploitation but does not remove the need to assess applications that process untrusted URLs. The published CVSS score of 4.8 reflects a moderate technical rating, while the supplied editorial assessment classifies the real-world severity as low because the exploit requires a specific integration pattern and the native backend must be active.

Mitigation

Apply the upstream fix

Upgrade Addressable to 2.10.0 or later. This is the definitive remediation for the issue described in the advisory.

For Bundler-managed Ruby applications, update the dependency and regenerate the lockfile, then redeploy all affected artifacts. Container images, CI caches, and vendored dependencies may retain an older version even after application code has been updated.

Where Addressable is a transitive dependency, inspect Gemfile.lock and software bills of materials for versions in the affected range, >= 2.2.5, < 2.10.0.

Reduce exposure before upgrading

Applications that cannot immediately upgrade have several defensive options:

  • Reject hostnames containing percent-encoded NUL bytes or other suspicious control-character encodings before invoking Addressable.

  • Use the same normalized representation for both security decisions and request construction.

  • Evaluate the pure-Ruby IDNA backend, since the reported truncation behavior is specific to the native backend.

These measures reduce exposure but should not replace upgrading to Addressable 2.10.0.

Detection and review

Code and dependency review can focus on:

  • URIs containing %00 in the authority component.

  • Host-policy checks against raw or unnormalized URI values followed by request construction through normalized_host, normalize, origin, or display_uri.

  • Outbound requests whose destination differs from the hostname recorded by an allow-list, block-list, or SSRF control.

  • Build artifacts containing Addressable versions in the affected range.

Expert insight

The important issue is not merely that a hostname is parsed inconsistently; it is that parsing and policy enforcement operate on different representations of the same destination. Even if the normalized value is expected to represent the same host, transformations between validation and dispatch create a trust-boundary weakness.

The fix in Addressable 2.10.0 closes the upstream decoding and truncation behavior, but application owners should also review whether validation and dispatch consistently consume the same canonical value. That architectural review can uncover similar discrepancies involving other URI parsers, internationalized domain names, user-information components, ports, or scheme normalization.

The most credible exploitation scenario is an application accepting attacker-controlled URLs and enforcing a hostname restriction before dispatching a request. The absence of known exploitation reduces urgency relative to actively exploited vulnerabilities, but the flaw remains relevant to services designed to prevent access to internal or otherwise prohibited destinations.

Actionable recommendations

  • Upgrade Addressable to version 2.10.0 or later and regenerate dependency lockfiles.

  • Search Gemfile.lock and software bills of materials for Addressable versions in the range >= 2.2.5, < 2.10.0.

  • Review URI-processing paths that combine raw-host validation with normalized-host request construction.

  • Reject percent-encoded NUL bytes and other unexpected control-character encodings in host components.

  • Confirm whether the native IDNA backend is active in deployed environments.

  • Add regression tests using a host containing %00 and verify that policy evaluation and outbound routing use the same destination.

  • Rebuild and redeploy container images, CI artifacts, and cached builds to ensure the fixed dependency is actually present.

References

·
← News