Attack ChainAIDerived
Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain
-
AccessClient issues request with caller-set Authorization/Cookie header
-
DeliveryMalicious/compromised server returns same-host HTTPS-to-HTTP (or alternate-port) redirect
-
ExploitMechanize wrongly treats redirect as same-origin
-
ExecutionSensitive headers re-sent over cleartext/to other service
-
ImpactAttacker captures disclosed credentials
Vulnerability Assessment
| Weakness |
CWE
OWASP Top 10:2025
A01:2025 - Broken Access Control
ASVS 5.0
V14 - Data Protection Data exposure prevention
MITRE ATT&CK
2 techniques across 2 tactics: Collection, Discovery The technique list with ATT&CK links and the kill-chain view is part of the Basic plan and up. |
| Exploitation Conditions | Exploitation requires that the consuming application has set caller-supplied credential headers - specifically an Authorization/Proxy-Authorization or Cookie/Cookie2 header via a per-request header or Mechanize#request_headers= - AND that the application follows a redirect from a host the attacker can influence. The concrete triggering condition is a same-host redirect that changes the scheme (HTTPS→HTTP cleartext downgrade) or the port (sending a caller-supplied Cookie to a different service on the same host); pre-fix Mechanize discarded headers only on a host change, not on scheme/port changes. Limiting factors that reduce realistic risk: the attacker must control or MITM the redirect response, the application must actually inject its own sensitive headers (default scraping without auth headers is not exposed), and cookies managed by Mechanize#cookie_jar are correctly scoped and are NOT leaked - only caller-supplied headers are. Impact is confidentiality-only (no integrity or availability effect). |
| Impact | This is a moderate-severity information-disclosure flaw (CVSS 5.9, CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:N/A:N) whose real-world risk is tempered by the high attack complexity. The network vector and PR:N correctly reflect that no credentials are needed to trigger the bug, but AC:H is appropriate because exploitation depends on a specific sequence of conditions: the client application must set caller-supplied Authorization/Cookie headers AND must follow a same-host redirect that either downgrades HTTPS→HTTP or changes the port. The C:H/I:N/A:N profile matches the described impact - credential disclosure only, with no effect on integrity or availability. No EPSS score, CISA KEV listing, or POC is present in the supplied data, so there is no signal of active or imminent exploitation; status is 'no public exploit identified at time of analysis.' The signals are internally consistent (a credential-leak CWE-200 with confidentiality-only impact and high complexity), so this reads as a genuine-but-not-urgent defensive patch priority rather than a high-CVSS/low-real-risk false alarm, and importantly below a critical/emergency threshold. One nuance to verify: the description clarifies that cookies in Mechanize#cookie_jar remain correctly scoped and are NOT leaked - only caller-supplied headers are affected - which further narrows the population of vulnerable deployments to those explicitly injecting their own auth/cookie headers. |
| Exploit ScenarioDerived | An application uses Mechanize with a caller-supplied Authorization or Cookie header to interact with a site; the attacker controls or influences that site's responses (or holds a MITM position) and returns a same-host redirect from https:// to http:// (or to a different port). Mechanize treats it as same-origin and re-sends the sensitive headers over cleartext or to an unintended service, letting the attacker capture the credentials. No public exploit code was identified in the supplied data. |
Get an e-mail when this CVE is exploited, patched or re-scored. Free account.
Alert meAnalysisAIv1 – Oct 08, 2026
Credential-header leakage in the Ruby Mechanize gem before 2.14.1 allows sensitive headers to be forwarded to a lower-trust destination during redirect following, because Mechanize::HTTP::Agent#response_redirect considered a redirect same-origin whenever the host matched, without comparing scheme or port. A same-host HTTPS-to-HTTP downgrade can put caller-supplied Authorization (or Proxy-Authorization) and Cookie (or Cookie2) headers on the wire in cleartext, and a same-host redirect to a different port can deliver a caller-supplied Cookie to an unrelated service listening there. Per the assessed vector (CVSS 5.9, CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:N/A:N) the impact is confidentiality-only with no integrity or availability effect, and no public exploit was identified at time of analysis; the practical risk is limited because the consuming application must explicitly inject its own credential headers and an attacker must control or man-in-the-middle the redirect response, while cookies held in Mechanize#cookie_jar are scoped correctly and are not leaked. Vendor-released patch: 2.14.1.
RemediationAI
Upgrade the Mechanize gem to version 2.14.1, which is the vendor-released fix for this issue and is available from the release page at https://github.com/sparklemotion/mechanize/releases/tag/v2.14.1; the change is implemented in https://github.com/sparklemotion/mechanize/pull/676 with commits 02a1235842d6eda8d4a5a3d8f13aba2cecf52e4f and 2f97fe358a91928e5e48221f2ec5cb50fa1a43ba, and the vendor advisory is https://github.com/sparklemotion/mechanize/security/advisories/GHSA-5jgv-wc2m-xv99. If upgrading is not immediately possible, the most effective compensating control is to stop supplying Authorization and Cookie values as caller-supplied headers: route session cookies through Mechanize#cookie_jar, which is origin-scoped and not affected, so the credential never travels as a manually attached header - the trade-off is that custom authentication schemes that cannot be expressed as a managed cookie must be reimplemented. Where credentials must be sent manually, disable automatic redirect following (mechanize's redirect limit / manual hop handling) and validate each hop yourself, refusing to re-attach credential headers when the scheme, host, or port differs from the original request, and refusing HTTPS-to-HTTP downgrades outright; the trade-off is additional application code and possible breakage of legitimate cross-host redirect flows. Additionally, restrict the cookie values you attach to the minimum scope needed, and treat any redirect response that could be influenced by an untrusted party as hostile, since the attacker must control or MITM that response for exploitation.
Affected VersionsENISA
Affected Packages
Source: OSV (Open Source Vulnerabilities)
Affects your stack
Affects 1 package in euvd
Checking this CVE against your own stacks and servers is part of the Basic plan and up.
Technical ContextAI · show details
Mechanize is a Ruby library for automating web interaction, and the defect sits in Mechanize::HTTP::Agent#response_redirect, the routine that re-issues a request when an HTTP 3xx response is received. Origin identity here follows RFC 6454, where an origin is the tuple of scheme, host and port; the pre-fix code compared only the host, so a redirect from https://host to http://host (scheme change) or from host:443 to host:8443 (port change) was treated as same-origin and the credential-bearing headers were re-applied. The root-cause class is CWE-200 (Exposure of Sensitive Information to an Unauthorized Actor) rather than an injection or memory-safety bug: the library faithfully sends headers it was asked to send, but fails to withhold them when the destination origin changes. The affected constants are CREDENTIAL_HEADERS (Authorization) and COOKIE_HEADERS (Cookie), which the 2.14.1 fix extends to include Proxy-Authorization and Cookie2 and gates behind a new crosses_origin?/drop_after_redirect? check that compares scheme, host and port. A related change ensures headers configured through Mechanize#request_headers= are merged into the operation once and then subject to the same cross-origin withholding as per-request headers, instead of being re-applied unconditionally on every hop; the same release also addresses a cross-origin meta-refresh header leak (GHSA-c6rp-p8xm-4q9f) and stops sending caller-supplied headers on the internally initiated robots.txt fetch. Notably, cookies managed by Mechanize#cookie_jar were already origin-scoped and are explicitly not affected - the exposure is limited to caller-supplied headers.
Know when Mechanize gets its next vulnerability
- Watch products and get an email when something new is published
- Check this CVE against your own stack and servers
- Exploit and PoC references, threat intelligence from 22 sources
No credit card · 7-day full trial
Severity by source
AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:N/A:N
AC:H because it requires caller-set credential headers plus an attacker-influenced same-host scheme/port redirect; PR:N/UI:N as no victim auth or interaction is needed; C:H, I:N, A:N for credential-only disclosure.
Primary rating from Vendor (GitHub_M).
CVSS VectorVendor: GitHub_M
Lifecycle Timeline
1DescriptionCVE.org
The Mechanize library is used for automating interaction with websites. Prior to 2.14.1, Mechanize::HTTP::Agent#response_redirect treats redirects as same-origin when the host matches without consistently comparing scheme and port. A same-host HTTPS-to-HTTP redirect can send Authorization and Cookie headers over cleartext, while a same-host redirect to another port can send a caller-supplied Cookie header to a different service. Cookies in Mechanize#cookie_jar remain scoped separately; the issue affects caller-supplied headers and can disclose credentials without affecting integrity or availability. This issue is fixed in version 2.14.1.
Threat Intelligence Overview
How this decision was reached
The engine reads each signal below and applies a fixed list of rules from top to bottom. The first rule that matches sets the recommended action – like a statement, every line is shown.
What every action level means
SSVC AssessmentENISA
Priority Score
Attack Technique
Information disclosure occurs when an application unintentionally exposes sensitive data that aids attackers in reconnaissance or directly compromises security.
Cross-origin credential leakage in the Mechanize Ruby library (versions prior to 2.14.1) allows attackers who control a
Credential leakage in the Ruby Mechanize library before 2.14.1 lets an attacker who controls page content encountered du
Mechanize is an open-source ruby library that makes automated web interaction easy. Rated high severity (CVSS 8.3), this
The Mechanize library is used for automating interaction with websites. Rated high severity (CVSS 7.5), this vulnerabili
EUVD-2026-95320
NVD
CVE.org
EPSS
Vulnrichment
GitHub
Exploit-DB