Skip to main content

Mechanize CVE-2026-107714

| EUVDEUVD-2026-95320 MEDIUM
Information Exposure (CWE-200)
2026-10-08 GitHub_M
5.9
CVSS 3.1 · Vendor: GitHub_M
View

Attack ChainAIDerived

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

  1. Access
    Client issues request with caller-set Authorization/Cookie header
  2. Delivery
    Malicious/compromised server returns same-host HTTPS-to-HTTP (or alternate-port) redirect
  3. Exploit
    Mechanize wrongly treats redirect as same-origin
  4. Execution
    Sensitive headers re-sent over cleartext/to other service
  5. Impact
    Attacker 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.

This Month Plan within 30 days. Why: MEDIUM severity (CVSS 4.0-6.9).
Patch available 0.2% 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-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

mechanize < 2.15.0

Affected Packages

euvd mechanize fix: 2.15.0

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

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

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.

3.1 AV:N/AC:H/PR:N/UI:N/S:U/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
Unchanged
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::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

EPSS Score
0.2%
Top 87% exploitable
Prevalence
Medium
popular Ruby web-automation/scraping gem, but language-specific and not universally deployed
Data Quality
6 sources
Confidence: High
EUVD NVD CVE.org EPSS Vulnrichment Vendor GitHub

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

Priority Score

30
Low Medium High Critical
KEV: 0
EPSS: 0
CVSS: +30
PoC: 0
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