Skip to main content

Mechanize EUVDEUVD-2026-95318

| CVE-2026-107399 MEDIUM
Information Exposure (CWE-200)
2026-10-08 GitHub_M GHSA-c6rp-p8xm-4q9f
6.8
CVSS 3.1 · Vendor: GitHub_M
View

Attack ChainAIDerived

Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain

  1. Access
    Attacker controls page in crawl path
  2. Delivery
    Serve HTML meta refresh to attacker origin
  3. Exploit
    Mechanize follows refresh cross-origin
  4. Execution
    Default request_headers reapplied to new origin
  5. Impact
    Attacker 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.

This Month Plan within 30 days. Why: MEDIUM severity (CVSS 4.0-6.9).
Patch available 0.4% exploitation probability (EPSS)

Get an e-mail when this CVE is exploited, patched or re-scored. Free account.

Alert me

AnalysisAIv1 – 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

mechanize < 2.15.0

Affected Packages

rubygems mechanize fix: 2.14.1, 2.15.0

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

Vendor (GitHub_M) PRIMARY 6.8 MEDIUM
AV:N/AC:H/PR:N/UI:N/S:C/C:H/I:N/A:N
vuln.today AI 6.8 MEDIUM

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.

3.1 AV:N/AC:H/PR:N/UI:N/S:C/C:H/I:N/A:N
4.0 AV:N/AC:H/AT:N/PR:N/UI:N/VC:H/VI:N/VA:N/SC:N/SI:N/SA:N
Red Hat 5.9 MEDIUM

Primary rating from Vendor (GitHub_M).

CVSS VectorVendor: GitHub_M

Attack Vector
Network
Attack Complexity
High
Privileges Required
None
User Interaction
None
Scope
Changed
Confidentiality
High
Integrity
None
Availability
None

Lifecycle Timeline

1
Patch available
Oct 08, 2026 - 23:02 EUVD

DescriptionCVE.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

EPSS Score
0.4%
Top 72% exploitable
Prevalence
Medium
popular Ruby web-automation gem, but niche vs ubiquitous web servers
Threat Intel
1
1 source
Exploit
POC
Public exploit code exists
Data Quality
5 sources
Confidence: Medium

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.

SignalValue
Severity MEDIUM
CISA KEV No
Public POC Yes
EPSS 0.4%
Patch available Yes
Active threat No
Deciding rule
MEDIUM severity (CVSS 4.0-6.9)
What every action level means
Emergency Immediate action required. Criteria: CRITICAL + in CISA KEV (actively exploited) without patch, OR CRITICAL + EPSS > 30% without patch, OR CRITICAL + active threat signals without patch.
Act Now Prioritize within 24-48h. Criteria: in KEV with patch available, OR CRITICAL + public POC, OR HIGH + EPSS > 10%, OR CRITICAL + active threat, OR any CRITICAL severity.
This Week Schedule remediation this week. Criteria: HIGH severity (CVSS 7.0-8.9). Patch within normal change window.
This Month Plan within 30 days. Criteria: MEDIUM severity (CVSS 4.0-6.9), lower exploitation probability. Include in regular patch cycle.
Monitor Track and reassess. Criteria: LOW severity (CVSS 0.1-3.9), minimal exploitation risk. No immediate action needed.

SSVC AssessmentENISA

SSVC Decision· derived
Scheduled
Exploitation· derived
Poc
System Exposure· derived
Open
Automatable· derived
No
Human Impact· derived
Medium

Priority Score

54
Low Medium High Critical
KEV: 0
EPSS: 0
CVSS: +34
PoC: +20
Weaponized: 0
Threat intel: 0
Gov advisory: 0

Attack Technique

Information disclosure occurs when an application unintentionally exposes sensitive data that aids attackers in reconnaissance or directly compromises security.

Vendor StatusVendor

This site uses cookies essential for authentication and security. No tracking or analytics cookies are used. Privacy Policy