Insertion of Sensitive Information Into Sent Data Affecting mechanize package, versions <2.14.1


Severity

Recommended
0.0
medium
0
10

CVSS assessment by Snyk's Security Team. Learn more

Threat Intelligence

EPSS
0.5% (43rd percentile)

Do your applications use this vulnerable package?

In a few clicks we can analyze your entire application and see what components are vulnerable in your application, and suggest you quick fixes.

Test your applications
  • Snyk IDSNYK-RUBY-MECHANIZE-21716789
  • published26 Oct 2026
  • disclosed8 Oct 2026
  • creditSnailSploit

Introduced: 8 Oct 2026

NewCVE-2026-107715  (opens in a new tab)
CWE-201  (opens in a new tab)
CWE-522  (opens in a new tab)

How to fix?

Upgrade mechanize to version 2.14.1 or higher.

Overview

Affected versions of this package are vulnerable to Insertion of Sensitive Information Into Sent Data via the request_add_headers function in Mechanize::HTTP::Agent. An attacker who controls a redirect target can capture caller-supplied Authorization, Cookie, Proxy-Authorization, and Cookie2 headers by causing a request to redirect to that host; credentials can also be resent on later requests or retries during the same operation, exposing tokens and cookie values. The exposure concerns caller-set headers, including custom credential headers; credentials from AuthStore and cookies from cookie_jar are unaffected.

Notes

  • At the header-sending step, the leak is limited to credentials supplied as request headers; cookies in Mechanize#cookie_jar and credentials in Mechanize::HTTP::AuthStore are looked up per URI and do not follow the redirect.

Workarounds

  • Set Mechanize#redirect_ok = false and handle redirects explicitly; this prevents Mechanize from automatically sending caller-supplied credential headers to a redirect target.
  • Avoid setting credentials with request_headers=; pass them per request only when you intend to authenticate to that host, limiting which requests carry the credentials.

CVSS Base Scores

version 4.0
version 3.1