# CVE-2026-107399: Mechanize credential leak via meta refresh redirect

Source: https://junglewise.ai/threats/cve-2026-107399-mechanize-sends-credential-headers-to-another-origin-after-a  
Publisher: Junglewise Threat Intelligence, https://junglewise.ai/threats  
Published: 2026-10-08. Updated: 2026-10-08  
License: CC BY 4.0 with a link back

CVE-2026-107399 · Severity: medium · CVSS 6.8 · Published 2026-10-08

Mechanize is a web scraping and automation library that can be configured to follow HTML meta refresh tags to new pages. When this feature is enabled, the library incorrectly sends authentication credentials (like bearer tokens and session cookies) to a different website if a meta refresh tag points there, allowing an attacker who controls a page the agent visits to steal those credentials.

Technologies: [mechanize (RubyGems)](https://junglewise.ai/threats/technologies/rubygems-mechanize). Vendors: [RubyGems](https://junglewise.ai/threats/vendors/rubygems).

## Quick answers

**Is CVE-2026-107399 exploited in the wild?** No. Junglewise Threat Intelligence has no report of CVE-2026-107399 being exploited in the wild.

**How severe is CVE-2026-107399?** Medium severity, with a CVSS score of 6.8, published 8 October 2026.

**Which products and versions are affected?** Mechanize before 2.14.1; mechanize (RubyGems) < 2.14.1, ECOSYSTEM:introduced=0,fixed=2.14.1.

**Is there a fix for CVE-2026-107399?** Yes. mechanize (RubyGems): upgrade to 2.14.1 or later. Until then: Leave Mechanize#follow_meta_refresh at its default value of false, or avoid using request_headers= for credentials when follow_meta_refresh is enabled. Junglewise finds every place you run it, drafts the upgrade and applies it once you approve.

**How is CVE-2026-107399 attacked?** It is attacked over the network, in a software library.

**Am I affected by CVE-2026-107399?** Check whether you run Mechanize or mechanize (RubyGems) at an affected version. Junglewise does that check for you around the clock: connect your code, cloud and domains, and it matches new vulnerabilities like this one against what you actually run and tells you when one reaches you.

## How to fix

- mechanize (RubyGems): upgrade to 2.14.1 or later

  ```sh
  bundle update mechanize
  ```


Leave Mechanize#follow_meta_refresh at its default value of false, or avoid using request_headers= for credentials when follow_meta_refresh is enabled.

## Technical details

The Mechanize::HTTP::Agent#response_follow_meta_refresh method applies request headers set via Mechanize#request_headers= without checking whether a meta refresh target is on a different origin. This allows bearer tokens and session cookies to be forwarded to attacker-controlled sites through stored content, open redirects, or pages in a crawl path. The vulnerability only affects agents with follow_meta_refresh enabled (default is false), and only credentials set via request_headers= are exposed.

## Affected products

- Mechanize mechanize before 2.14.1

## Identifiers

- CVE-2026-107399
- GHSA-c6rp-p8xm-4q9f

## Timeline

- 2026-10-08: disclosed

## Related threats

- [Mechanize HTTP credential leakage via redirect](https://junglewise.ai/threats/cve-2026-107715-mechanize-sends-credential-headers-to-another-host-after-an-http)
- [Mechanize before v2.8.5 vulnerable to authorization header leak on port redirect](https://junglewise.ai/threats/cve-2022-31033-mechanize-before-v2-8-5-vulnerable-to-authorization-header-leak)
- [Command Injection Vulnerability in Mechanize](https://junglewise.ai/threats/cve-2021-21289-command-injection-vulnerability-in-mechanize)
