{"id":"CVE-2022-31033","aliases":["GHSA-64qm-hrgp-pgr9"],"url":"https://o3.security/vulnerability/CVE-2022-31033","summary":"Authorization header leak in rubygem Mechanize","details":"**Summary**\n\nMechanize (rubygem) `< 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> Cookies do not provide isolation by port.  If a cookie is readable\n> by a service running on one port, the cookie is also readable by a\n> service running on another port of the same server.  If a cookie is\n> writable by a service on one port, the cookie is also writable by a\n> service running on another port of the same server.  For this\n> reason, servers SHOULD NOT both run mutually distrusting services on\n> different ports of the same host and use cookies to store security-\n> sensitive information.\n","published":"2022-06-09T20:00:16Z","modified":"2026-10-28T02:30:56.780394726Z","cvss":{"score":5.9,"severity":"MEDIUM","vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:N/A:N"},"epss":null,"cisaKev":null,"exploitsKnown":0,"affectedPackages":[{"ecosystem":"RubyGems","name":"mechanize","fixedVersion":"2.8.5"}],"fix":{"url":"https://github.com/sparklemotion/mechanize/commit/c7fe6996a5b95f9880653ba3bc548a8d4ef72317","label":"sparklemotion/mechanize@c7fe699"},"references":[{"type":"ADVISORY","url":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2022/31xxx/CVE-2022-31033.json"},{"type":"ADVISORY","url":"https://github.com/sparklemotion/mechanize/security/advisories/GHSA-64qm-hrgp-pgr9"},{"type":"ADVISORY","url":"https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/7OKZMR5O3T5HQ2V737TC7IU4WZRT2LGX/"},{"type":"ADVISORY","url":"https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/OA2FJROTX2U6EBWDPKRQ2VAM67A5TQXF/"},{"type":"ADVISORY","url":"https://nvd.nist.gov/vuln/detail/CVE-2022-31033"},{"type":"FIX","url":"https://github.com/sparklemotion/mechanize/commit/c7fe6996a5b95f9880653ba3bc548a8d4ef72317"},{"type":"WEB","url":"https://github.com/rubysec/ruby-advisory-db/blob/master/gems/mechanize/CVE-2022-31033.yml"},{"type":"PACKAGE","url":"https://github.com/sparklemotion/mechanize"}],"provenance":{"sources":["OSV.dev","FIRST.org (EPSS)"],"lastVerified":"2026-10-28T02:30:56.780394726Z"}}