Attack ChainAIDerived
Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain
-
AccessAttacker controls page in crawl path
-
DeliveryServe HTML meta refresh to attacker origin
-
ExploitMechanize follows refresh cross-origin
-
ExecutionDefault request_headers reapplied to new origin
-
ImpactAttacker captures bearer token or session cookie
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 | Three conditions must hold simultaneously: (1) Mechanize#follow_meta_refresh must be explicitly enabled - it defaults to false, so default deployments are NOT affected; (2) the caller must have set sensitive default headers (e.g., Authorization bearer token or Cookie) via Mechanize#request_headers=, since exposure is limited to those caller-supplied defaults; and (3) the attacker must control page content within the crawl so they can serve a meta refresh pointing to an origin they control. Limiting factors: the non-default feature flag and the requirement that the victim configure credentials as global default headers both substantially reduce realistic exposure, which is reflected in the AC:H rating. Affected versions are all releases prior to 2.14.1. |
| Impact | This is a genuine but conditional information-disclosure flaw (CWE-200) rather than a broadly exploitable critical issue. The provided CVSS 3.1 vector (AV:N/AC:H/PR:N/UI:N/S:C/C:H/I:N/A:N, 6.8 Medium) is internally consistent with the description: network vector because the attacker only needs to control crawled web content, AC:H because exploitation depends on a non-default configuration (follow_meta_refresh enabled) AND the caller having set sensitive default headers via request_headers=, scope change (S:C) because credentials scoped to one origin leak to an attacker-controlled origin, and C:H/I:N/A:N because only confidentiality (bearer tokens, session cookies) is affected. No EPSS score, KEV listing, or POC was supplied in the input. No public exploit is identified at time of analysis, and there is no evidence of active exploitation. The vendor explicitly states the default configuration is NOT affected (follow_meta_refresh defaults to false) and exposure is limited to caller-supplied default headers - two independent conditions that sharply narrow the real-world attack surface. Net assessment: a legitimate credential-leak bug worth patching for anyone running Mechanize as an authenticated crawler with meta-refresh following enabled, but low urgency for the typical deployment running defaults. Treat as a dependency-hygiene update, not an emergency. |
| Exploit ScenarioDerived | A developer runs a Mechanize-based crawler with follow_meta_refresh enabled and configures a default Authorization or Cookie header (e.g., a bearer token) via Mechanize#request_headers= to authenticate to a trusted site. An attacker who can plant content on a page in the crawl path serves an HTML meta refresh pointing to an attacker-controlled origin; Mechanize follows it and re-applies the configured credential headers, delivering the bearer token or session cookie to the attacker. No public exploit code was provided in the input, and the high attack complexity (non-default config plus caller-set sensitive headers) limits practicality. |
Get an e-mail when this CVE is exploited, patched or re-scored. Free account.
Alert meAnalysisAIv1 – Oct 08, 2026
Credential leakage in the Ruby Mechanize library before 2.14.1 lets an attacker who controls page content encountered during a crawl capture bearer tokens or session cookies, because a cross-origin meta refresh caused Mechanize::HTTP::Agent#response_follow_meta_refresh to reapply the caller's global default headers to the refresh request. Exploitation is conditional and rated AC:H: Mechanize#follow_meta_refresh must be explicitly enabled (it defaults to false), the caller must have placed sensitive credentials in the agent-wide default headers via Mechanize#request_headers=, and the attacker must be able to serve attacker-controlled markup to the crawl, though the request itself is unauthenticated (PR:N) and requires no user interaction (UI:N). There is no KEV entry, no public exploit identified at time of analysis, and no EPSS score supplied; the vendor-released fix is Mechanize 2.14.1, where cross-origin meta refreshes now discard credential and cookie headers under the same origin rules as HTTP redirects.
RemediationAI
Vendor-released patch: upgrade to Mechanize 2.14.1, available at https://github.com/sparklemotion/mechanize/releases/tag/v2.14.1, which strips CREDENTIAL_HEADERS and COOKIE_HEADERS on any meta refresh or redirect that crosses an origin as defined by scheme, host and port (RFC 6454). Where upgrading is not immediately possible, the highest-value compensating control is to keep Mechanize#follow_meta_refresh at its default of false - this alone eliminates the vulnerable code path, at the cost of losing automatic meta-refresh following in crawls that depend on it. Second, stop placing long-lived secrets in the agent-wide default header hash set via Mechanize#request_headers=; pass credentials as per-request headers instead, since per-request headers already obeyed the cross-origin redirect rules before this fix and are therefore not re-applied by the meta-refresh path. Third, if global defaults cannot be removed, restrict them to non-credential headers and inject the Authorization or Cookie value only on first-party requests to the intended origin; this requires code changes at each call site and provides no protection against a same-host scheme-downgrade leak. Because 2.14.1 also bundles fixes for related cross-origin redirect and header-reapplication issues (GHSA-2mwr-xjcg-37j7 and GHSA-5jgv-wc2m-xv99, the latter covering https-to-http downgrade credential leakage), upgrade rather than patching only the meta-refresh path. Finally, audit any token or cookie that may have transited attacker-influenced crawl content and rotate it, since the disclosure cannot be detected retroactively from Mechanize logs.
Affected VersionsENISA
Affected Packages
Source: OSV (Open Source Vulnerabilities)
Affects your stack
Affects 1 package in rubygems
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 website interaction - form submission, link following, and crawling - and it exposes Mechanize::HTTP::Agent as its request layer. The flaw is an origin-boundary failure in the meta-refresh path: when Mechanize#follow_meta_refresh is enabled and a fetched page contains a <meta http-equiv="refresh"> element pointing at a different origin, the follow-up request was built by re-merging the agent's global header hash (Mechanize#request_headers=) rather than continuing the header set already scoped to the original request. Prior to the fix, that code path carried only the caller-supplied defaults, so any Authorization, Cookie, Cookie2, or Proxy-Authorization value configured as a default header was transmitted to the attacker-chosen destination. This is CWE-200 (Exposure of Sensitive Information to an Unauthorized Actor): the root cause is not a parsing bug but a missing trust-boundary check, since meta refreshes were not subjected to the cross-origin rules already applied to HTTP redirects. The fix introduces an explicit crosses_origin? helper that treats an origin as scheme + host + port per RFC 6454, folds agent defaults into a single per-operation header hash at the start of the request, and then permanently strips headers matching CREDENTIAL_HEADERS (Authorization, Proxy-Authorization) and COOKIE_HEADERS (Cookie, Cookie2) once an operation crosses an origin. The same release also hardens adjacent behavior noted in the changelog: robots.txt fetches no longer carry caller-supplied headers, symbol header handling was made case-insensitive via a canonical_header_name helper, and origin comparison now catches scheme downgrades (https: to http: on the same host) and port changes that the previous host-only check missed. The CVSS vector's S:C reflects that the vulnerable component (Mechanize) and the impacted asset (the credential-bearing third-party origin) are different security authorities, and AC:H reflects the three simultaneous preconditions rather than any technical difficulty in triggering the refresh.
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:C/C:H/I:N/A:N
AV:N and PR:N since the attacker only needs to control crawled web content; AC:H for the non-default follow_meta_refresh plus caller-set credential headers; S:C as credentials leak across origin; C:H, I:N, A:N for pure 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 applies no origin trust boundary in Mechanize::HTTP::Agent#response_follow_meta_refresh when Mechanize#follow_meta_refresh is enabled. A page containing a meta refresh to another origin causes headers configured through Mechanize#request_headers= to be reapplied to the refresh request, allowing an attacker who controls content in the crawl to capture bearer tokens or session cookies. The default configuration is not affected because follow_meta_refresh is false, and the exposure is limited to caller-supplied default headers. 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
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
Credential-header leakage in the Ruby Mechanize gem before 2.14.1 allows sensitive headers to be forwarded to a lower-tr
EUVD-2026-95318
GHSA-c6rp-p8xm-4q9f
NVD
CVE.org
EPSS
Exploit-DB