Skip to main content

Mechanize EUVDEUVD-2026-95321

| CVE-2026-107715 MEDIUM
Information Exposure (CWE-200)
2026-10-08 GitHub_M GHSA-2mwr-xjcg-37j7
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
    Lure Mechanize client to attacker-influenced URL
  2. Delivery
    Return cross-origin HTTP redirect or meta refresh
  3. Exploit
    Mechanize reapplies request_headers credentials
  4. Execution
    Capture bearer token or session cookie
  5. Impact
    Reuse stolen credentials against legitimate service

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 BOTH of the following: (1) the application passes sensitive headers - Authorization/bearer tokens, Proxy-Authorization, Cookie, or Cookie2 session cookies - through Mechanize#request_headers= or the per-request headers argument (credentials managed via Mechanize#cookie_jar or Mechanize::HTTP::AuthStore are explicitly NOT affected); and (2) the attacker controls, compromises, or can coerce the redirect target so a response issues a cross-origin HTTP redirect (or, per the companion advisories, a cross-origin meta refresh). Limiting factors that reduce real-world risk: the flaw affects only Mechanize versions prior to 2.14.1; it does not trigger for same-origin redirects; it is inert unless the application actually sets credentials via these specific header-setting APIs; and it requires the attacker to influence a redirect destination rather than merely reach the service.

Impact

This is a genuine but conditional information-disclosure flaw (CWE-200) rather than a mass-exploitation priority. The input CVSS 3.1 vector (AV:N/AC:H/PR:N/UI:N/S:C/C:H/I:N/A:N, score 6.8) is internally consistent with the description: no attacker privileges are needed (PR:N), but exploitation hinges on specific preconditions - the victim application must supply secrets through Mechanize#request_headers= or the per-request headers argument, AND the attacker must control a redirect destination on a different origin - which correctly drives AC:H, and the leak of credentials to a foreign host justifies the scope change (S:C) and C:H/I:N/A:N. No EPSS score, KEV entry, or SSVC decision data was provided in the input; the vulnerability is NOT listed in CISA KEV and no public exploit code was supplied, so exploitation status is 'no public exploit identified at time of analysis.' There is no signal conflict: a network vector paired with high complexity and a config-dependent trigger points to targeted, opportunistic abuse (e.g., a malicious or compromised site that Mechanize is pointed at) rather than internet-wide scanning. Net priority: moderate - patch promptly in Ruby applications that drive Mechanize against untrusted or redirecting endpoints while passing bearer tokens or cookies via request headers, but it is not an emergency for deployments that rely on Mechanize's cookie_jar or AuthStore, which the advisory explicitly states are unaffected.

Exploit ScenarioDerived

A developer uses Mechanize (pre-2.14.1) to call an API, attaching a bearer token via Mechanize#request_headers= or the per-request headers argument. The target host (attacker-controlled, compromised, or coerced) issues an HTTP redirect - or a meta refresh - to an attacker origin, and Mechanize re-applies the credential/cookie headers to that cross-origin request, handing the attacker the Authorization bearer token or session cookie. No public exploit code was supplied with this analysis, but the mechanism is fully documented in the vendor advisory and fix diff (PR #676).

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

Cross-origin credential leakage in the Mechanize Ruby library (versions prior to 2.14.1) allows attackers who control a redirect target to capture bearer tokens, session cookies, Proxy-Authorization credentials, or Cookie2 values that the calling application supplied through Mechanize#request_headers= or the per-request headers argument. The flaw is conditional: it only triggers when an application actually sets credentials via those header APIs and a response issues a cross-origin HTTP redirect (or a cross-origin meta refresh), so same-origin redirects are unaffected and credentials managed through Mechanize#cookie_jar or Mechanize::HTTP::AuthStore are explicitly out of scope; there is no public exploit identified at time of analysis. Because the attacker must influence the redirect destination rather than merely reach the service, this is a genuine but conditional information-disclosure issue (CWE-200) rather than a mass-exploitation priority.

RemediationAI

Vendor-released patch: upgrade the mechanize gem to version 2.14.1 or later (release tag https://github.com/sparklemotion/mechanize/releases/tag/v2.14.1), which is the primary and complete fix; the change is implemented in pull request https://github.com/sparklemotion/mechanize/pull/676 and commits 02a1235842d6eda8d4a5a3d8f13aba2cecf52e4f, 94e0902867296be804f36eccbb47acf7d5018745, and ac49abf2869297d83c3b11bbfb8b18e63b588c95. Where an immediate upgrade is not possible, the most effective compensating control is to stop passing credentials through Mechanize#request_headers= and the per-request headers argument and instead rely on Mechanize#cookie_jar or Mechanize::HTTP::AuthStore, which are documented as unaffected - the trade-off is that this requires reworking authentication flow code in the calling application and may not be feasible if the credential is a bearer token rather than a cookie or basic-auth credential. A second option is to disable or tightly restrict automatic redirect following and instead handle redirects manually, validating each Location against an allowlist of trusted origins (scheme, host, and port per RFC 6454) before issuing the next request; this adds application complexity and can break legitimate multi-domain workflows. Note that Proxy-Authorization and Cookie2 were never in the protected lists, so no reliable per-header workaround exists on unpatched versions beyond removing those headers from caller-supplied hashes. Network egress filtering that limits outbound access to approved destinations reduces the blast radius but does not fix the underlying leak and may interfere with intended automation traffic.

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 interaction with websites, and its HTTP layer (Mechanize::HTTP::Agent) manages per-request and agent-wide headers. The root cause is CWE-200 (Exposure of Sensitive Information to an Unauthorized Actor): when Mechanize followed a redirect, Agent#response_redirect stripped per-request headers, but Agent#request_add_headers immediately reapplied the agent-wide headers set through Mechanize#request_headers= to the redirected request, so caller-supplied credentials followed the navigation to a new host. Compounding this, the internal protected header lists were incomplete: CREDENTIAL_HEADERS contained only 'Authorization' and COOKIE_HEADERS only 'Cookie', omitting 'Proxy-Authorization' and 'Cookie2', so those values were never stripped even in the paths that did perform stripping. The fix in 2.14.1 consolidates the two lists (Authorization/Proxy-Authorization and Cookie/Cookie2), merges agent defaults into a single request header hash once at the start of an operation via merge_request_headers, and introduces a crosses_origin? check that treats a change of scheme, host, or port as a distinct origin per RFC 6454 - closing the prior behavior where an https-to-http redirect to the same host carried credentials in cleartext, and where a meta refresh pointing cross-origin discarded nothing. Additional hardening in the same release stops robots.txt fetches from carrying 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

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

Network-reachable with no attacker privileges (PR:N), but AC:H because the app must send credentials via request_headers and the attacker must control a cross-origin redirect; credentials leak to a foreign host so S:C and C:H, no integrity/availability impact.

3.1 AV:N/AC:H/PR:N/UI:N/S:C/C:H/I:N/A:N
4.0 AV:N/AC:L/AT:P/PR:N/UI:N/VC:H/VI:N/VA:N/SC:N/SI:N/SA:N
Red Hat 6.8 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 sends caller-supplied credential headers to a different host after an HTTP redirect. Mechanize#request_headers= is reapplied by Mechanize::HTTP::Agent#request_add_headers even after Mechanize::HTTP::Agent#response_redirect strips per-request headers, and the protected header lists omit Proxy-Authorization and Cookie2. An attacker who controls a redirect target can capture bearer tokens or session cookies supplied through request_headers= or the per-request headers argument, while Mechanize#cookie_jar and Mechanize::HTTP::AuthStore are not affected. This issue is fixed in version 2.14.1.

Threat Intelligence Overview

EPSS Score
0.4%
Top 68% exploitable
Prevalence
Medium
popular Ruby web-automation gem, common but language/use-case specific
Threat Intel
1
1 source
Exploit
POC
Public exploit code exists
Data Quality
7 sources
Confidence: High
EUVD NVD CVE.org EPSS Vulnrichment GHSA Vendor GitHub VulDB

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
Poc
System Exposure· derived
Open
Automatable
No
Human Impact· derived
Medium
Technical Impact
Partial

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