CVE-2025-27221 URI allows for userinfo Leakage in URI#join, URI#merge, and URI#+
Attackers can leak authentication credentials when URI methods retain userinfo after host changes, affecting Ruby applications using the URI gem.
- Exploited in the wild
- Not known
- Login needed
- Not needed
- Attackable
- Local or same network only
- Victim action needed
- Not needed
- Fix
- Available
What is CVE-2025-27221?
CVE-2025-27221 is a low-severity vulnerability in ruby-lang URI, published on 3 Mar 2025. It can only be exploited from the same machine or local network, with no action from the victim.
Official description
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.
Weakness: CWE-212
Which versions are affected by CVE-2025-27221?
8 open source packages ship an affected version, including uri. It affects 1 product.
| Package | Affected | Fixed in |
|---|---|---|
uri RubyGems | All versions | 0.11.3 |
uri RubyGems | All versions | 0.11.3 |
uri RubyGems | From 0.12.0 | 0.12.4 |
uri RubyGems | From 0.12.0 | 0.12.4 |
uri RubyGems | From 0.13.0 | 0.13.2 |
uri RubyGems | From 0.13.0 | 0.13.2 |
2 more packages
uri RubyGems | From 1.0.0 | 1.0.3 |
uri RubyGems | From 1.0.0 | 1.0.3 |
Products include Ruby-Lang Uri.
How do I fix CVE-2025-27221?
Upgrade uri to a fixed version for your release line: 0.11.3, 0.12.4, 0.13.2 or 1.0.3.
Is CVE-2025-27221 being exploited?
There is no known exploitation of CVE-2025-27221 in the wild and no public exploit code.
Other vulnerabilities in ruby-lang URI
Sources
Also known as AZL-57778, AZL-57893, CLEANSTART-2026-JV54364, CLEANSTART-2026-RX39488, CLSA-2026-1768314331, DEBIAN-CVE-2025-27221 and 17 more.