CVE-2025-27221: Infoleak

Published Mar 3, 2025
·
Updated

In the URI gem before 1.0.3 for Ruby, the URI handling methods (URI.join, URI#merge, URI#+) have an inadvertent leakage of authentication credentials because userinfo is retained even after changing the host.

Other sources

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.

— GitHub

This CVE was automatically created from a reference found in an email or other text. If you are reading this, then this CVE entry is probably erroneous, since this text should be replaced by the official CVE description automatically.

— Launchpad

Affected Software

32 affected componentsFixes available
rubygems/uri>=1.0.0<1.0.3
1.0.3
rubygems/uri>=0.13.0<0.13.2
0.13.2
rubygems/uri>=0.12.0<0.12.4
0.12.4
rubygems/uri<0.11.3
0.11.3
ruby-lang Uri Ruby<0.11.3
ruby-lang Uri Ruby>=0.12.0<0.12.4
ruby-lang Uri Ruby>=0.13.0<0.13.2
ruby-lang Uri Ruby>=1.0.0<1.0.3
debian/ruby3.1*
debian/ruby3.3<3.3.7-2
3.3.7-2
debian/ruby3.3<3.3.7-2
3.3.7-2
debian/rubygems<3.3.15-2+deb12u1
3.3.15-2+deb12u1
debian/rubygems<3.6.6-1
3.6.6-1
debian/rubygems<3.6.6-1
3.6.6-1
debian/ruby3.1<=3.1.2-7+deb12u1, <=3.1.7+really3.1.2-0+deb12u1
debian/ruby3.3
3.3.7-2
debian/rubygems
3.2.5-2+deb11u13.3.15-2+deb12u13.6.6-1
debian/ruby2.7
2.7.4-1+deb11u5
ubuntu/jruby*
ubuntu/ruby2.3<2.3.1-2~ubuntu16.04.16+esm10
2.3.1-2~ubuntu16.04.16+esm10
ubuntu/jruby*
ubuntu/ruby2.5<2.5.1-1ubuntu1.16+esm4
2.5.1-1ubuntu1.16+esm4
ubuntu/jruby*
ubuntu/ruby2.7<2.7.0-5ubuntu1.18
2.7.0-5ubuntu1.18
ubuntu/jruby*
ubuntu/ruby3.0<3.0.2-7ubuntu2.10
3.0.2-7ubuntu2.10
ubuntu/jruby*
ubuntu/ruby3.2<3.2.3-1ubuntu0.24.04.5
3.2.3-1ubuntu0.24.04.5
ubuntu/jruby*
ubuntu/ruby3.3<3.3.7-1ubuntu2
3.3.7-1ubuntu2
ubuntu/jruby*
ubuntu/jruby*

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Upgrade

    Upgrade rubygems/uri to a version that resolves this vulnerability.

    Fixed in 1.0.3
  2. Upgrade

    Upgrade rubygems/uri to a version that resolves this vulnerability.

    Fixed in 0.13.2
  3. Upgrade

    Upgrade rubygems/uri to a version that resolves this vulnerability.

    Fixed in 0.12.4
  4. Upgrade

    Upgrade rubygems/uri to a version that resolves this vulnerability.

    Fixed in 0.11.3
  5. Upgrade

    Upgrade debian/ruby3.3 to a version that resolves this vulnerability.

    Fixed in 3.3.7-2
  6. Upgrade

    Upgrade debian/rubygems to a version that resolves this vulnerability.

    Fixed in 3.3.15-2+deb12u1
  7. Upgrade

    Upgrade debian/rubygems to a version that resolves this vulnerability.

    Fixed in 3.6.6-1
  8. Upgrade

    Upgrade debian/rubygems to a version that resolves this vulnerability.

    Fixed in 3.2.5-2+deb11u1Fixed in 3.3.15-2+deb12u1Fixed in 3.6.6-1
  9. Upgrade

    Upgrade debian/ruby2.7 to a version that resolves this vulnerability.

    Fixed in 2.7.4-1+deb11u5
  10. Upgrade

    Upgrade ubuntu/ruby2.3 to a version that resolves this vulnerability.

    Fixed in 2.3.1-2~ubuntu16.04.16+esm10
  11. Upgrade

    Upgrade ubuntu/ruby2.5 to a version that resolves this vulnerability.

    Fixed in 2.5.1-1ubuntu1.16+esm4
  12. Upgrade

    Upgrade ubuntu/ruby2.7 to a version that resolves this vulnerability.

    Fixed in 2.7.0-5ubuntu1.18
  13. Upgrade

    Upgrade ubuntu/ruby3.0 to a version that resolves this vulnerability.

    Fixed in 3.0.2-7ubuntu2.10
  14. Upgrade

    Upgrade ubuntu/ruby3.2 to a version that resolves this vulnerability.

    Fixed in 3.2.3-1ubuntu0.24.04.5
  15. Upgrade

    Upgrade ubuntu/ruby3.3 to a version that resolves this vulnerability.

    Fixed in 3.3.7-1ubuntu2
  16. Upgrade

    Upgrade ruby/uri to a version that resolves this vulnerability.

    Fixed in 0.11.3
  17. Upgrade

    Upgrade ruby/uri to a version that resolves this vulnerability.

    Fixed in 0.12.4
  18. Upgrade

    Upgrade ruby/uri to a version that resolves this vulnerability.

    Fixed in 0.13.2
  19. Upgrade

    Upgrade ruby/uri to a version that resolves this vulnerability.

    Fixed in 1.0.3

Event History

Mar 3, 2025
CVE Published
via MITRE·12:00 AM
Data Sourced
via MITRE·12:00 AM
Description
Advisory Published
via GitHub·10:07 PM
Data Sourced
via GitHub·10:07 PM
DescriptionWeaknessAffected Software
Advisory Published
via GitHub·10:08 PM
Mar 4, 2025
Data Sourced
via Red Hat·12:01 AM
DescriptionSeverityAffected Software
Data Sourced
via OSV·12:15 AM
DescriptionSeverityAffected Software
Data Sourced
via NVD·12:15 AM
DescriptionSeverityWeakness
Data Sourced
via GitHub·02:44 AM
Severity
Updated
via GitHub·02:44 AM
Weakness
Data Sourced
via MITRE·04:39 PM
SeverityWeakness
Mar 5, 2025
Data Sourced
via NVD·02:05 PM
Affected Software
Updated
via NVD·02:05 PM
SeverityWeakness
Event
via NVD·02:05 PM
Updated
via NVD·02:58 PM
Affected Software
Mar 30, 2025
Event
via FIRST·12:00 AM
Aug 1, 2025
Updated
via NVD·02:06 AM
Affected Software
Nov 3, 2025
Updated
via NVD·10:18 PM
Affected Software
Nov 21, 2026
Updated
via OSV·08:00 PM
Affected Software
Nov 22, 2026
Updated
via OSV·10:00 PM
Affected Software

Peer vulnerabilities

Found alongside the following vulnerabilities.

Frequently Asked Questions

1

What is the severity of CVE-2025-27221?

CVE-2025-27221 poses a risk of userinfo leakage, which can lead to unauthorized access to sensitive information.

2

How do I fix CVE-2025-27221?

To remediate CVE-2025-27221, upgrade the uri gem to version 1.0.3, 0.13.2, 0.12.4, or 0.11.3 as applicable.

3

What is the impact of CVE-2025-27221 on my application?

CVE-2025-27221 can lead to leaking sensitive user credentials, compromising user privacy and security.

4

Which versions of the uri gem are affected by CVE-2025-27221?

CVE-2025-27221 affects versions of the uri gem prior to 1.0.3, 0.13.2, 0.12.4, and 0.11.3.

5

Is there a workaround for CVE-2025-27221 if I cannot upgrade?

No specific workarounds are recommended for CVE-2025-27221; upgrading to the fixed versions is the only effective solution.

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