Authorization header leak in rubygem Mechanize
Key facts
- Attack vector
- Network
- Privileges required
- None
- User interaction
- None
- Attack complexity
- Low
- Impact type
- Information disclosure
- Confidentiality · integrity · availability
- High · None · None
- Fix status
- Fixed
Attack profile from CVSS 3.1 · NVD. Fix status from CNA and GitHub. Impact type from CWE-200.
Summary
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.
Why it matters now
SSVC decision points
CISA ADP · SSVC 2.0.3
- Exploitation
- None
- Automatable
- No
- Technical impact
- Partial
The decision (Track, Attend, Act) also depends on your mission and well-being impact; see CISA's SSVC guide.
Affected products
| Vendor | Product | Affected versions | Fixed in | Status | Source |
|---|---|---|---|---|---|
| sparklemotion | mechanize | before 2.8.5 | 2.8.5 | Patch available | CNA |
| — | mechanize (RubyGems) | before 2.8.5 | 2.8.5 | Patch available | GHSA-64qm-hrgp-pgr9 |
- mechanize Vendorsparklemotion Affected before 2.8.5 Fixed in 2.8.5 Patch available CNA
- mechanize (RubyGems) Vendor— Affected before 2.8.5 Fixed in 2.8.5 Patch available GHSA-64qm-hrgp-pgr9
CPE configurations NVD · 3
| CPE | Versions | Role | Vendor |
|---|---|---|---|
| cpe:2.3:a:mechanize_project:mechanize:*:*:*:*:*:ruby:*:* | before 2.8.5 | Vulnerable | Mechanize Project |
| cpe:2.3:o:fedoraproject:fedora:35:*:*:*:*:*:*:* | 35 | Vulnerable | Fedoraproject |
| cpe:2.3:o:fedoraproject:fedora:36:*:*:*:*:*:*:* | 36 | Vulnerable | Fedoraproject |
- cpe:2.3:a:mechanize_project:mechanize:*:*:*:*:*:ruby:*:* Versions before 2.8.5 Vulnerable ·Mechanize Project
- cpe:2.3:o:fedoraproject:fedora:35:*:*:*:*:*:*:* Versions 35 Vulnerable ·Fedoraproject
- cpe:2.3:o:fedoraproject:fedora:36:*:*:*:*:*:*:* Versions 36 Vulnerable ·Fedoraproject
Remediation
- Fix · CNA mechanize (sparklemotion) Fixed in 2.8.5
- Fix · GHSA-64qm-hrgp-pgr9 mechanize (RubyGems) Fixed in 2.8.5 Advisory →
Vendor assessments
Timeline
- 2026-10-02 Threatist record created from CVE-2022-31033
- 2026-10-03 Alias added: GHSA-64qm-hrgp-pgr9
References
Advisory 4
More sparklemotion vulnerabilities
- TI-2022-11724 Improper Handling of Unexpected Data Type in Nokogiri CVSS 3.1HIGH 8.2
- TI-2018-15259 zlib before 1.2.12 allows memory corruption when deflating (i.e., when compressing) if… CVSS 3.1HIGH 7.5
- TI-2026-69678 Mechanize leaks credential headers to other hosts after redirects CVSS 3.1MEDIUM 6.8
- TI-2025-05895 sparklemotion nokogiri hashmap.c hashmap_get_with_hash heap-based overflow CVSS 4.0MEDIUM 4.8
- TI-2025-05891 sparklemotion nokogiri hashmap.c hashmap_set_with_hash heap-based overflow CVSS 4.0MEDIUM 4.8
- TI-2019-03885 OS command injection in Nokogiri CVSS 3.1CRITICAL 9.8
Sources
- CVE-2022-31033 · CVE Program
- CVE-2022-31033 · NVD
- FIRST EPSS
- GHSA-64qm-hrgp-pgr9 · GitHub Advisory Database · CC BY 4.0
- CVE-2022-31033 · Red Hat security data · CC BY 4.0
This product uses the NVD API but is not endorsed or certified by the NVD. Sources and licences