{"id":"CVE-2025-27221","aliases":["CVE-2025-27221","GHSA-22h5-pq3x-2gf2"],"related":["CVE-2025-61594"],"kind":"vulnerability","state":"published","title":"URI allows for userinfo Leakage in URI#join, URI#merge, and URI#+","summary":"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.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"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.","source":"cvelist"},{"lang":"en","text":"There is a possibility for userinfo leakage by in the uri gem.\nThis vulnerability has been assigned the CVE identifier CVE-2025-27221. We recommend upgrading the uri gem.\n\n## Details\n\nThe 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.\n\nPlease update URI gem to version 0.11.3, 0.12.4, 0.13.2, 1.0.3 or later.\n\n## Affected versions\n\nuri 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.\n\n## Credits\n\nThanks to Tsubasa Irisawa (lambdasawa) for discovering this issue.\nAlso thanks to nobu for additional fixes of this vulnerability.","format":"markdown","source":"ghsa"},{"lang":"es","text":"En la gema URI anterior a 1.0.3 para Ruby, los métodos de gestión de URI (URI.join, URI#merge, URI#+) tienen una fuga involuntaria de credenciales de autenticación porque la información del usuario se conserva incluso después de cambiar el host.","source":"nvd"}],"published":"2025-03-03T00:00:00.000Z","modified":"2026-09-10T03:50:06.344Z","severity":{"scorer":"mitre","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:L/AC:H/PR:N/UI:N/S:C/C:L/I:N/A:N","score":3.2,"rating":"LOW"},"severities":[{"scorer":"mitre","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:L/AC:H/PR:N/UI:N/S:C/C:L/I:N/A:N","score":3.2,"rating":"LOW"},{"scorer":"GitHub","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:L/AC:H/PR:N/UI:N/S:C/C:L/I:N/A:N","score":3.2,"rating":"LOW"},{"scorer":"GitHub","scheme":"CVSS:4.0","vector":"CVSS:4.0/AV:L/AC:L/AT:P/PR:N/UI:N/VC:N/VI:N/VA:N/SC:L/SI:N/SA:N","rating":"LOW"},{"scorer":"NVD","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:N","score":5.3,"rating":"MEDIUM"}],"cwes":["CWE-200","CWE-212"],"affected":[{"ranges":[{"type":"custom","introduced":"0","fixed":"0.11.3","status":"affected"},{"type":"custom","introduced":"0.12.0","fixed":"0.12.4","status":"affected"},{"type":"custom","introduced":"0.13.0","fixed":"0.13.2","status":"affected"},{"type":"custom","introduced":"1.0.0","fixed":"1.0.3","status":"affected"}],"vendor":"ruby-lang","product":"URI","source":"cvelist"},{"ranges":[{"type":"ecosystem","introduced":"0","status":"affected","fixed":"0.11.3"}],"ecosystem":"RubyGems","package":"uri","purl":"pkg:gem/uri","source":"ghsa"},{"ranges":[{"type":"ecosystem","introduced":"0.12.0","status":"affected","fixed":"0.12.4"}],"ecosystem":"RubyGems","package":"uri","purl":"pkg:gem/uri","source":"ghsa"},{"ranges":[{"type":"ecosystem","introduced":"0.13.0","status":"affected","fixed":"0.13.2"}],"ecosystem":"RubyGems","package":"uri","purl":"pkg:gem/uri","source":"ghsa"},{"ranges":[{"type":"ecosystem","introduced":"1.0.0","status":"affected","fixed":"1.0.3"}],"ecosystem":"RubyGems","package":"uri","purl":"pkg:gem/uri","source":"ghsa"},{"ranges":[{"status":"affected","fixed":"0.11.3"},{"status":"affected","introduced":"0.12.0","fixed":"0.12.4"},{"status":"affected","introduced":"0.13.0","fixed":"0.13.2"},{"status":"affected","introduced":"1.0.0","fixed":"1.0.3"}],"vendor":"ruby-lang","product":"uri","cpe":"cpe:2.3:a:ruby-lang:uri:*:*:*:*:*:ruby:*:*","source":"nvd"}],"references":[{"url":"https://hackerone.com/reports/2957667","tags":["permissions-required","web"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://github.com/rubysec/ruby-advisory-db/blob/master/gems/uri/CVE-2025-27221.yml","tags":["third-party-advisory","web"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://lists.debian.org/debian-lts-announce/2025/05/msg00015.html","tags":["web"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://lists.debian.org/debian-lts-announce/2025/03/msg00008.html","tags":["web"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2025-27221","tags":["advisory"],"sources":["ghsa"]},{"url":"https://github.com/ruby/uri/pull/154","tags":["web"],"sources":["ghsa"]},{"url":"https://github.com/ruby/uri/pull/155","tags":["web"],"sources":["ghsa"]},{"url":"https://github.com/ruby/uri/pull/156","tags":["web"],"sources":["ghsa"]},{"url":"https://github.com/ruby/uri/pull/157","tags":["web"],"sources":["ghsa"]},{"url":"https://github.com/ruby/uri","tags":["package"],"sources":["ghsa"]},{"url":"https://www.cve.org/CVERecord?id=CVE-2025-27221","tags":["web"],"sources":["ghsa"]},{"url":"https://www.ruby-lang.org/en/news/2025/02/26/security-advisories","tags":["web"],"sources":["ghsa"]}],"credits":[],"assigner":"mitre","ssvc":{"scorer":"CISA-ADP","exploitation":"none","automatable":"no","technicalImpact":"partial","date":"2025-03-04T16:38:46.135Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2025-27221","url":"https://www.cve.org/CVERecord?id=CVE-2025-27221","licence":"CVE Terms of Use","modified":"2025-11-03T21:13:26.685Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-22h5-pq3x-2gf2","url":"https://github.com/advisories/GHSA-22h5-pq3x-2gf2","licence":"CC-BY-4.0","modified":"2026-09-10T03:50:06.344Z"},{"source":"nvd","name":"NVD","id":"CVE-2025-27221","url":"https://nvd.nist.gov/vuln/detail/CVE-2025-27221","licence":"Public domain","modified":"2026-06-17T09:03:14.380Z"}],"updatedAt":"2026-11-25T22:58:54.935Z","epss":{"score":0.00511,"percentile":0.45107,"date":"2026-12-01T12:00:22.000Z"}}