CVE-2025-27221: ruby-lang URI · Improper Removal of Sensitive Information Before Storage or Transfer
Affects ruby-lang URISource CVE Database V5
Not known to be exploited · CVSS 3.2 Low.
Data as of 25 Oct 2026, 19:02 UTC
- EPSS
- 0.5% chance of exploitation in 30 days – higher than 43% of CVEsExploit Prediction Scoring System: the likelihood attackers will use this flaw soon.
CVSS:3.1/AV:L/AC:H/PR:N/UI:N/S:C/C:L/I:N/A:NExploitation evidence
Disclosed: evidence found.
CVE published 3 Mar 2025
Detectable: no evidence on record.
No public nuclei template indexed
Weaponised: no evidence on record.
No public exploit code indexed in Metasploit or Exploit-DB
Exploited in the wildExploited: no evidence on record.
Not in CISA KEV and no source reports exploitation
Observed by OffSeq MirageSeen by Mirage: no evidence on record.
No attack traffic recorded by OffSeq Mirage sensors
A missing step is not evidence of safety. Sources: cve.org (opens in a new tab), the Metasploit, Exploit-DB and nuclei-templates index as of 2026-10-25.
What to do
Affected software
| Product | Affected | Fixed in |
|---|---|---|
RubyGemsuripkg:gem/uriOther threats | Affected
| Fixed in– |
Check your own hosts for these packages with threat-finder (opens in a new tab), our free open-source scanner.
AI-suggested
1. Upgrade the Ruby URI gem to version 1.0.3 or later immediately to ensure the vulnerability is patched. 2. Conduct a thorough code review focusing on all instances where URIs are constructed or manipulated using URI.join, URI#merge, or URI#+, verifying that userinfo components are not unintentionally retained or exposed. 3. Implement logging and monitoring to detect any unusual URI patterns or potential credential leakage in application logs or network traffic. 4. Avoid embedding sensitive credentials directly in URIs; use alternative secure authentication mechanisms such as headers or tokens. 5. Educate developers on secure URI handling practices and the risks of retaining sensitive information in URI components. 6. For legacy systems where immediate upgrade is not feasible, consider applying code-level patches or wrappers that explicitly clear userinfo fields after URI manipulations. 7. Review and update security policies to include checks for sensitive data leakage in URI handling during development and security assessments.
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.
References
- hackerone.com/reports/2957667 (opens in a new tab)
- github.com/rubysec/ruby-advisory-db/blob/master/gems/uri/CVE-2025-27221.yml (opens in a new tab)
- lists.debian.org/debian-lts-announce/2025/05/msg00015.html (opens in a new tab)
- lists.debian.org/debian-lts-announce/2025/03/msg00008.html (opens in a new tab)