Vulnerabilities in pkg:gem/uri

PACKAGE
Advisory Identifier: GHSA-j4pr-3wm6-xx2r
Advisory Summary

CVE-2025-61594 is a LOW (CVSS 7.5) uri credential leakage bypass over vulnerability (CWE-212: Improper Removal of Sensitive Information Before Storage or Transfer) affecting Uri libraries in the RubyGems ecosystem. The issue involves uri credential leakage bypass over cve-2025-27221. Remediation is available by upgrading affected packages to version 0.12.5, 0.13.3, 1.0.4.

4 Known Advisory Record(s)
Package Vulnerability Intelligence

pkg:gem/uri

4 Known Advisory Record(s)

Vulnerability advisories affecting package pkg:gem/uri. Select an advisory below to view technical details or fixes.

Advisory ID CVE / NVD Severity Summary
GHSA-j4pr-3wm6-xx2r CVE-2025-61594 LOW URI Credential Leakage Bypass over CVE-2025-27221
GHSA-hww2-5g85-429m CVE-2023-36617 MODERATE URI gem has ReDoS vulnerability
GHSA-hv5j-3h9f-99c2 CVE-2023-28755 HIGH Ruby URI component ReDoS issue
GHSA-22h5-pq3x-2gf2 CVE-2025-27221 LOW URI allows for userinfo Leakage in URI#join, URI#merge, and URI#+

CVE-2025-61594 at a Glance

CVE Identifier CVE-2025-61594
GHSA Identifier GHSA-j4pr-3wm6-xx2r
Severity LOW
CVSS v3.1 Base Score 7.5
CWE Classification CWE-212: Improper Removal of Sensitive Information Before Storage or Transfer
Affected Product Uri
Package Ecosystem RubyGems
Published Date
Last Updated

Security Impact

CVSS: 7.5

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

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

How to Fix CVE-2025-61594

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

uri fixed: 0.12.5
Upgrade uri to 0.12.5
uri fixed: 0.13.3
Upgrade uri to 0.13.3
uri fixed: 1.0.4
Upgrade uri to 1.0.4
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 uri

How to Check if You Are Affected

To determine whether your application is affected by CVE-2025-61594, inspect your project dependencies for Uri:

inspect dependencies for uri

Analyze the terminal output to locate any version of Uri in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 0.12.5), 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-212: Improper Removal of Sensitive Information Before Storage or Transfer, where the product stores, transfers, or shares a resource that contains sensitive information, but it does not properly remove that information before the product makes the resource available to unauthorized actors. In Uri, 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 In affected URI version, a bypass exists for the fix to CVE-2025-27221 that can expose user credentials. When using the `+` operator to combine URIs, sensitive information like passwords from the original URI can be leaked, violating RFC3986 and making applications vulnerable to credential exposure. The vulnerability affects the `uri` gem bundled with the following Ruby series: * 0.12.4 and earlier (bundled in Ruby 3.2 series) * 0.13.2 and earlier (bundled in Ruby 3.3 series) * 1.0.3 and earlier (bundled in Ruby 3.4 series) ### Patches Upgrade to 0.12.5, 0.13.3 or 1.0.4 ### References * https://www.ruby-lang.org/en/news/2025/02/26/security-advisories/ * https://hackerone.com/reports/2957667

CVE-2025-61594 Affected Uri Versions

3 component(s)
Fixed Versions:
0.12.50.13.31.0.4
Product / Package Ecosystem Affected Versions Fixed Version
uri
RubyGems
< 0.12.5
0.12.5
uri
RubyGems
≥ 0.13.0
< 0.13.3
0.13.3
uri
RubyGems
≥ 1.0.0
< 1.0.4
1.0.4

References

Frequently Asked Questions

What is CVE-2025-61594?
CVE-2025-61594 is a security vulnerability in Uri involving URI Credential Leakage Bypass over CVE-2025-27221 under CWE-212: Improper Removal of Sensitive Information Before Storage or Transfer.
Which Uri versions are affected?
Affected versions include releases prior to 0.12.5, 0.13.3, 1.0.4 across affected packages: uri.
What version fixes CVE-2025-61594?
Upgrading to 0.12.5, 0.13.3, 1.0.4 (or the latest patched release for your respective branch) resolves the vulnerability.
Is uri affected?
Yes, uri is affected in releases prior to 0.12.5, 0.13.3, 1.0.4. Upgrade your dependency to 0.12.5, 0.13.3, 1.0.4 or later.
What is the CVSS score of CVE-2025-61594?
CVE-2025-61594 has a CVSS v3.1 base score of 7.5 (LOW) with vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N.
What CWE is associated with CVE-2025-61594?
CVE-2025-61594 is classified under CWE-212: Improper Removal of Sensitive Information Before Storage or Transfer (The product stores, transfers, or shares a resource that contains sensitive information, but it does not properly remove that information before the product makes the resource available to unauthorized actors.).
How can I check RubyGems dependencies for CVE-2025-61594?
Run the dependency tree command: 'inspect dependencies for uri'. 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-j4pr-3wm6-xx2r",
  "modified" : "2026-05-29T21:45:59Z",
  "published" : "2025-12-30T21:07:14Z",
  "aliases" : [ "CVE-2025-61594" ],
  "summary" : "URI Credential Leakage Bypass over CVE-2025-27221",
  "details" : "### Impact\n\nIn affected URI version, a bypass exists for the fix to CVE-2025-27221 that can expose user credentials.\n\nWhen using the `+` operator to combine URIs, sensitive information like passwords from the original URI can be leaked, violating RFC3986 and making applications vulnerable to credential exposure.\n\nThe vulnerability affects the `uri` gem bundled with the following Ruby series:\n\n* 0.12.4 and earlier (bundled in Ruby 3.2 series)\n* 0.13.2 and earlier (bundled in Ruby 3.3 series)\n* 1.0.3 and earlier (bundled in Ruby 3.4 series)\n\n### Patches\n\nUpgrade to 0.12.5, 0.13.3 or 1.0.4\n\n### References\n\n* https://www.ruby-lang.org/en/news/2025/02/26/security-advisories/\n* https://hackerone.com/reports/2957667",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N"
  }, {
    "type" : "CVSS_V4",
    "score" : "CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:L/VI:N/VA:N/SC:N/SI:N/SA:N/E:U"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "RubyGems",
      "name" : "uri"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "0.12.5"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "RubyGems",
      "name" : "uri"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0.13.0"
      }, {
        "fixed" : "0.13.3"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "RubyGems",
      "name" : "uri"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "1.0.0"
      }, {
        "fixed" : "1.0.4"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/ruby/uri/security/advisories/GHSA-j4pr-3wm6-xx2r"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2025-61594"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/ruby/uri/commit/20157e3e29b125ff41f1d9662e2e3b1d066f5902"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/ruby/uri/commit/7e521b2da0833d964aab43019e735aea674e1c2c"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/ruby/uri/commit/d3116ca66a3b1c97dc7577f9d2d6e353f391cd6a"
  }, {
    "type" : "WEB",
    "url" : "https://hackerone.com/reports/2957667"
  }, {
    "type" : "ADVISORY",
    "url" : "https://github.com/advisories/GHSA-22h5-pq3x-2gf2"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/ruby/uri"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/rubysec/ruby-advisory-db/blob/master/gems/uri/CVE-2025-61594.yml"
  }, {
    "type" : "WEB",
    "url" : "https://www.ruby-lang.org/en/news/2025/02/26/security-advisories"
  }, {
    "type" : "WEB",
    "url" : "https://www.ruby-lang.org/en/news/2025/10/07/uri-cve-2025-61594"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-200", "CWE-212" ],
    "severity" : "LOW",
    "github_reviewed" : true,
    "github_reviewed_at" : "2025-12-30T21:07:14Z",
    "nvd_published_at" : "2025-12-30T21:15:43Z"
  }
}