LowGHSA-22h5-pq3x-2gf2CVE-2025-27221

URI allows for userinfo Leakage in URI#join, URI#merge, and URI#+

Published 3 Mar 2025 · Updated 10 Sept 2026

Is your project on an affected uri?

Private repo? Upload its lockfile instead, or connect GitHub to check every repo.

Look after several Rails or Ruby apps? Indie watches up to 15 repos, private ones too, for $5 a month. See Indie

Affected packages

uriRubyGems
Affected
<0.11.3
Fixed in
0.11.3
Update to the fixed version for your release line, for example:bundle update --conservative uri # Gemfile: '>= 0.11.3'
uriRubyGems
Affected
>=0.12.0 <0.12.4
Fixed in
0.12.4
Update to the fixed version for your release line, for example:bundle update --conservative uri # Gemfile: '>= 0.12.4'
uriRubyGems
Affected
>=0.13.0 <0.13.2
Fixed in
0.13.2
Update to the fixed version for your release line, for example:bundle update --conservative uri # Gemfile: '>= 0.13.2'
uriRubyGems
Affected
>=1.0.0 <1.0.3
Fixed in
1.0.3
Update to the fixed version for your release line, for example:bundle update --conservative uri # Gemfile: '>= 1.0.3'

Details

There is a possibility for userinfo leakage by in the uri gem. This vulnerability has been assigned the CVE identifier CVE-2025-27221. We recommend upgrading the uri gem.

Details

The methods URI#join, URI#merge, and URI#+ retained userinfo, such as user:password, even after the host is replaced. When generating a URL to a malicious host from a URL containing secret userinfo using these methods, and having someone access that URL, an unintended userinfo leak could occur.

Please update URI gem to version 0.11.3, 0.12.4, 0.13.2, 1.0.3 or later.

Affected versions

uri gem versions < 0.11.3, 0.12.0 to 0.12.3, 0.13.0, 0.13.1 and 1.0.0 to 1.0.2.

Credits

Thanks to Tsubasa Irisawa (lambdasawa) for discovering this issue. Also thanks to nobu for additional fixes of this vulnerability.

Is GHSA-22h5-pq3x-2gf2 in any of your client repos?

Checking one package by hand is fine. Checking it across forty client projects is not. NPMscan reads the lockfiles in every GitHub repo you pick, finds each project with an affected uri, and gives you the command that fixes it.

More advisories for uri

  • LowCVE-2025-61594URI Credential Leakage Bypass over CVE-2025-27221 · 30 Dec 2025
  • MediumCVE-2023-36617URI gem has ReDoS vulnerability · 29 Jun 2023
  • HighCVE-2023-28755Ruby URI component ReDoS issue · 31 Mar 2023
uri security overview

References

Advisory data from OSV.dev (opens OSV.dev in a new tab), refreshed daily.