GHSA-c6rp-p8xm-4q9f: Infoleak

Published Oct 8, 2026
·
Updated

Summary

mechanize applied no trust boundary to a meta refresh, so credentials set through Mechanize#requestheaders= followed a refresh that pointed at another origin.

Details

Mechanize::HTTP::Agent#responsefollowmetarefresh fetched the refresh target with no notion of a crossed origin, so @requestheaders were re-applied in full. An attacker who could place a meta refresh in a page the agent fetched — through stored content, an open redirect, or control of any page in the crawl — collected the same credentials as through an HTTP redirect, on a code path that had none of the redirect path's protections.

The refresh fetch passes an empty per-request headers hash, so only headers set through Mechanize#requestheaders= were exposed.

This requires Mechanize#followmetarefresh = true. It is false by default, so an agent in its default configuration is not affected. Crawlers commonly enable it.

Impact

An attacker who can place a meta refresh in any page the agent fetches captures bearer tokens and session cookies set through requestheaders=. Disclosure only; no integrity or availability impact.

Patches

Fixed in mechanize v2.14.1. A meta refresh that points at another origin is now subject to the same rule as an HTTP redirect: credentials and cookies are withheld from the request that follows it.

Workarounds

Leave Mechanize#followmetarefresh at its default of false, or avoid requestheaders= for credentials when it is enabled.

Affected Software

1 affected componentFixes available
rubygems/mechanize<2.14.1
2.14.1

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Upgrade

    Upgrade rubygems/mechanize to a version that resolves this vulnerability.

    Fixed in 2.14.1
  2. Upgrade

    Upgrade mechanize to a version that resolves this vulnerability.

    Fixed in 2.14.1
  3. Configuration

    Leave Mechanize#follow_meta_refresh set to false; if it is enabled, avoid using request_headers= for credentials.

    Mechanize follow_meta_refresh = false

Event History

Oct 8, 2026
Advisory Published
via GitHub·10:09 PM
Data Sourced
via GitHub·10:09 PM
DescriptionSeverityWeaknessAffected Software

Frequently Asked Questions

1

Which Mechanize uses are exposed to credential disclosure?

Exposure requires Mechanize#follow_meta_refresh to be enabled and sensitive headers, such as bearer tokens or session cookies, to be set through Mechanize#request_headers=. Headers supplied only on an individual request are not exposed through this path.

2

What must an attacker be able to do to exploit this?

An attacker must be able to cause the agent to fetch a page containing a meta refresh that points to another origin. This can occur through stored content, an open redirect, or control of any page included in the crawl.

3

Are agents using the default configuration affected?

No. Mechanize#follow_meta_refresh is false by default, so an agent that has not enabled meta-refresh following is not affected.

4

What can be done before upgrading?

Disable meta-refresh following and avoid placing sensitive credentials in Mechanize#request_headers=. The issue is fixed in mechanize v2.14.1.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203