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


Severity

Recommended
0.0
high
0
10

CVSS assessment by Snyk's Security Team. Learn more

Threat Intelligence

EPSS
0.23% (14th 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-21716943
  • published26 Oct 2026
  • disclosed8 Oct 2026
  • creditflavorjones

Introduced: 8 Oct 2026

NewCVE-2026-107714  (opens in a new tab)
CWE-201  (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 response_redirect method in Mechanize::HTTP::Agent. When Mechanize follows a redirect to the same host with a different scheme, it sends Authorization and Cookie headers over the unencrypted connection; a redirect to a different port on the same host can also send a caller-supplied Cookie header to the service listening there. A network observer can capture credentials sent over HTTP, and the service on the other port receives the cookie.

Notes

  • The redirect step requires Mechanize to follow redirects (redirect_ok enabled); with redirect_ok = false, this redirect path is not reached.

Workarounds

  • Set Mechanize#redirect_ok = false and handle redirects explicitly, checking the target’s scheme and port before carrying credentials; this prevents credentials or cookies from being forwarded across those redirect changes.

CVSS Base Scores

version 4.0
version 3.1