{"id":"CVE-2022-31033","aliases":["DEBIAN-CVE-2022-31033","EUVD-2022-5951","GHSA-64qm-hrgp-pgr9","UBUNTU-CVE-2022-31033"],"status":"published","title":"Authorization header leak in rubygem Mechanize","description":"The Mechanize library is used for automating interaction with websites. Mechanize automatically stores and sends cookies, follows redirects, and can follow links and submit forms. In versions prior to 2.8.5 the Authorization header is leaked after a redirect to a different port on the same site. Users are advised to upgrade to Mechanize v2.8.5 or later. There are no known workarounds for this issue.","severity":{"version":"3.1","score":5.9,"vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:N/A:N","level":"medium","assessor":"cna","from":"cve"},"epss":{"day":"2026-11-09","score":0.01523,"percentile":0.7482,"model":"v2026.06.15"},"facts":{"in_kev":false,"known_exploited":false,"public_exploit":false,"fix_available":true},"cwes":["CWE-200","CWE-522"],"published":"2022-06-09T20:00:16Z","modified":"2026-10-28T02:30:56Z","fixes":[{"ecosystem":"RubyGems","package":"mechanize","fixed_in":["2.8.5"],"sources":["ghsa","osv"]},{"ecosystem":"Debian:12","package":"ruby-mechanize","fixed_in":["2.8.5-1"],"sources":["osv"]},{"ecosystem":"Debian:13","package":"ruby-mechanize","fixed_in":["2.8.5-1"],"sources":["osv"]},{"ecosystem":"Debian:14","package":"ruby-mechanize","fixed_in":["2.8.5-1"],"sources":["osv"]}],"affected":[{"source":"ghsa","ecosystem":"RubyGems","package":"mechanize","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"2.8.5"}]}]},{"source":"osv","ecosystem":"Debian:12","package":"ruby-mechanize","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"2.8.5-1"}]}]},{"source":"osv","ecosystem":"Debian:13","package":"ruby-mechanize","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"2.8.5-1"}]}]},{"source":"osv","ecosystem":"Debian:14","package":"ruby-mechanize","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"2.8.5-1"}]}]},{"source":"osv","ecosystem":"RubyGems","package":"mechanize","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"2.8.5"}]}],"versions":["0.1.0","0.1.1","0.1.2","0.1.3","0.2.0","0.2.1","0.2.2","0.2.3","0.3.0","0.3.1","0.4.0","0.4.1","0.4.2","0.4.3","0.4.4","0.4.5","0.4.6","0.4.7","0.5.0","0.5.1","0.5.2","0.5.3","0.5.4","0.6.0","0.6.1","0.6.10","0.6.11","0.6.2","0.6.3","0.6.4","0.6.5","0.6.6","0.6.7","0.6.8","0.6.9","0.7.0","0.7.1","0.7.2","0.7.3","0.7.4","0.7.5","0.7.6","0.7.7","0.7.8","0.8.0","0.8.1","0.8.2","0.8.3","0.8.4","0.8.5","0.9.0","0.9.1","0.9.2","0.9.3","1.0.0","1.0.1.beta.20110107104205","2.0","2.0.1","2.0.pre.1","2.0.pre.2","2.1","2.1.1","2.1.pre.1","2.2","2.2.1","2.3","2.4","2.5","2.5.1","2.6.0","2.7.0","2.7.1","2.7.2","2.7.3","2.7.4","2.7.5","2.7.6","2.7.7","2.8.0","2.8.1","2.8.2","2.8.3","2.8.4"]},{"source":"osv","ecosystem":"Ubuntu:24.04:LTS","package":"ruby-mechanize","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"}]}],"versions":["2.8.5-1"]},{"source":"osv","ecosystem":"Ubuntu:25.10","package":"ruby-mechanize","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"}]}],"versions":["2.10.1-1","2.10.1-1.1"]},{"source":"osv","ecosystem":"Ubuntu:26.10","package":"ruby-mechanize","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"}]}],"versions":["2.10.1-1.1","2.14.0-2"]},{"source":"osv","ecosystem":"Ubuntu:26.04:LTS","package":"ruby-mechanize","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"}]}],"versions":["2.10.1-1.1"]}],"products":[{"vendor":"fedoraproject","product":"fedora"},{"vendor":"mechanize_project","product":"mechanize"},{"vendor":"python-mechanize","product":"mechanize"},{"vendor":"sparklemotion","product":"mechanize"}],"references":[{"url":"https://github.com/sparklemotion/mechanize/security/advisories/GHSA-64qm-hrgp-pgr9","tags":["x_refsource_CONFIRM","x_transferred","Third Party Advisory","advisory","web","report"]},{"url":"https://github.com/sparklemotion/mechanize/commit/c7fe6996a5b95f9880653ba3bc548a8d4ef72317","tags":["x_refsource_MISC","x_transferred","Patch","Third Party Advisory","fix","web"]},{"url":"https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/OA2FJROTX2U6EBWDPKRQ2VAM67A5TQXF/","tags":["vendor-advisory","x_refsource_FEDORA","x_transferred","advisory"]},{"url":"https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/7OKZMR5O3T5HQ2V737TC7IU4WZRT2LGX/","tags":["vendor-advisory","x_refsource_FEDORA","x_transferred","advisory"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2022-31033","tags":["advisory"]},{"url":"https://github.com/rubysec/ruby-advisory-db/blob/master/gems/mechanize/CVE-2022-31033.yml","tags":["web"]},{"url":"https://github.com/advisories/GHSA-64qm-hrgp-pgr9"},{"url":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2022/31xxx/CVE-2022-31033.json","tags":["advisory"]},{"url":"https://security-tracker.debian.org/tracker/CVE-2022-31033","tags":["advisory"]},{"url":"https://github.com/sparklemotion/mechanize","tags":["package"]},{"url":"https://ubuntu.com/security/CVE-2022-31033","tags":["report"]},{"url":"https://github.com/sparklemotion/mechanize/commit/17e5381032c90caf240ac3d2e52b353f40c18d83","tags":["report"]},{"url":"https://www.cve.org/CVERecord?id=CVE-2022-31033","tags":["report"]}],"sources":{"cve":[{"id":"CVE-2022-31033","title":"Authorization header leak in rubygem Mechanize","description":"The Mechanize library is used for automating interaction with websites. Mechanize automatically stores and sends cookies, follows redirects, and can follow links and submit forms. In versions prior to 2.8.5 the Authorization header is leaked after a redirect to a different port on the same site. Users are advised to upgrade to Mechanize v2.8.5 or later. There are no known workarounds for this issue.","status":"published","published":"2022-06-09T20:00:16Z","modified":"2025-04-23T18:17:26.066Z","cvss":[{"version":"3.1","score":5.9,"vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:N/A:N","level":"medium","assessor":"cna"}],"cwes":["CWE-200"],"updated_at":"2026-11-02T14:34:35.279735Z"}],"euvd":[{"id":"EUVD-2022-5951","description":"The Mechanize library is used for automating interaction with websites. Mechanize automatically stores and sends cookies, follows redirects, and can follow links and submit forms. In versions prior to 2.8.5 the Authorization header is leaked after a redirect to a different port on the same site. Users are advised to upgrade to Mechanize v2.8.5 or later. There are no known workarounds for this issue.","status":"published","published":"2022-06-09T20:00:16Z","modified":"2025-04-23T18:17:26Z","cvss":[{"version":"3.1","score":5.9,"vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:N/A:N","level":"medium"}],"updated_at":"2026-11-02T20:52:08.95736Z"}],"ghsa":[{"id":"GHSA-64qm-hrgp-pgr9","title":"Mechanize before v2.8.5 vulnerable to authorization header leak on port redirect","description":"**Summary**\n\nMechanize (rubygem) `\u003c v2.8.5` leaks the `Authorization` header after a redirect to a different port on the same site.\n\n**Mitigation**\n\nUpgrade to Mechanize v2.8.5 or later.\n\n**Notes**\n\nSee [https://curl.se/docs/CVE-2022-27776.html](CVE-2022-27776) for a similar vulnerability in curl.\n\nCookies are shared with a server at a different port on the same site, per https://datatracker.ietf.org/doc/html/rfc6265#section-8.5 which states in part:\n\n\u003e Cookies do not provide isolation by port.  If a cookie is readable\n\u003e by a service running on one port, the cookie is also readable by a\n\u003e service running on another port of the same server.  If a cookie is\n\u003e writable by a service on one port, the cookie is also writable by a\n\u003e service running on another port of the same server.  For this\n\u003e reason, servers SHOULD NOT both run mutually distrusting services on\n\u003e different ports of the same host and use cookies to store security-\n\u003e sensitive information.\n","status":"published","published":"2022-06-09T23:47:57Z","modified":"2023-01-27T05:04:04Z","cvss":[{"version":"3.1","score":5.9,"vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:N/A:N","level":"medium"}],"cwes":["CWE-200","CWE-522"],"updated_at":"2026-11-02T14:36:20.985872Z"}],"nvd":[{"id":"CVE-2022-31033","description":"The Mechanize library is used for automating interaction with websites. Mechanize automatically stores and sends cookies, follows redirects, and can follow links and submit forms. In versions prior to 2.8.5 the Authorization header is leaked after a redirect to a different port on the same site. Users are advised to upgrade to Mechanize v2.8.5 or later. There are no known workarounds for this issue.","status":"published","published":"2022-06-09T20:15:08.343Z","modified":"2026-06-17T04:44:39.013Z","cvss":[{"version":"3.1","score":5.9,"vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:N/A:N","level":"medium","assessor":"secondary"},{"version":"3.1","score":7.5,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N","level":"high","assessor":"primary"},{"version":"2.0","score":5,"vector":"AV:N/AC:L/Au:N/C:P/I:N/A:N","level":"medium","assessor":"primary"}],"cwes":["CWE-200"],"updated_at":"2026-11-02T14:07:21.62951Z"}],"osv":[{"id":"CVE-2022-31033","title":"Authorization header leak in rubygem Mechanize","description":"The Mechanize library is used for automating interaction with websites. Mechanize automatically stores and sends cookies, follows redirects, and can follow links and submit forms. In versions prior to 2.8.5 the Authorization header is leaked after a redirect to a different port on the same site. Users are advised to upgrade to Mechanize v2.8.5 or later. There are no known workarounds for this issue.","status":"published","published":"2022-06-09T20:00:16Z","modified":"2026-10-28T02:30:56.780394726Z","cvss":[{"version":"3.1","score":5.9,"vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:N/A:N","level":"medium"}],"cwes":["CWE-200"],"updated_at":"2026-11-02T15:44:25.516981Z"},{"id":"GHSA-64qm-hrgp-pgr9","title":"Mechanize before v2.8.5 vulnerable to authorization header leak on port redirect","description":"**Summary**\n\nMechanize (rubygem) `\u003c v2.8.5` leaks the `Authorization` header after a redirect to a different port on the same site.\n\n**Mitigation**\n\nUpgrade to Mechanize v2.8.5 or later.\n\n**Notes**\n\nSee [https://curl.se/docs/CVE-2022-27776.html](CVE-2022-27776) for a similar vulnerability in curl.\n\nCookies are shared with a server at a different port on the same site, per https://datatracker.ietf.org/doc/html/rfc6265#section-8.5 which states in part:\n\n\u003e Cookies do not provide isolation by port.  If a cookie is readable\n\u003e by a service running on one port, the cookie is also readable by a\n\u003e service running on another port of the same server.  If a cookie is\n\u003e writable by a service on one port, the cookie is also writable by a\n\u003e service running on another port of the same server.  For this\n\u003e reason, servers SHOULD NOT both run mutually distrusting services on\n\u003e different ports of the same host and use cookies to store security-\n\u003e sensitive information.\n","status":"published","published":"2022-06-09T23:47:57Z","modified":"2023-11-08T04:09:23.331413Z","cvss":[{"version":"3.1","score":5.9,"vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:N/A:N","level":"medium"}],"cwes":["CWE-200","CWE-522"],"updated_at":"2026-11-02T15:46:39.266402Z"},{"id":"UBUNTU-CVE-2022-31033","description":"The Mechanize library is used for automating interaction with websites. Mechanize automatically stores and sends cookies, follows redirects, and can follow links and submit forms. In versions prior to 2.8.5 the Authorization header is leaked after a redirect to a different port on the same site. Users are advised to upgrade to Mechanize v2.8.5 or later. There are no known workarounds for this issue.","status":"published","published":"2022-06-09T20:15:00Z","modified":"2026-10-17T12:56:21.849992197Z","cvss":[{"version":"3.1","score":5.9,"vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:N/A:N","level":"medium"},{"version":"3.1","score":7.5,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N","level":"high"}],"updated_at":"2026-11-02T16:53:53.899276Z"},{"id":"DEBIAN-CVE-2022-31033","description":"The Mechanize library is used for automating interaction with websites. Mechanize automatically stores and sends cookies, follows redirects, and can follow links and submit forms. In versions prior to 2.8.5 the Authorization header is leaked after a redirect to a different port on the same site. Users are advised to upgrade to Mechanize v2.8.5 or later. There are no known workarounds for this issue.","status":"published","published":"2022-06-09T20:15:08.343Z","modified":"2026-11-03T06:02:31.490724948Z","updated_at":"2026-11-03T06:44:05.456691Z"}]}}
