Categories
CVE-2026-107399 medium CVSS 6.8

Information Disclosure in mechanize (CVE-2026-107399)

Summary

Vulnerability in mechanize (CVE-2026-107399). Confidential information can be exposed externally. Exploitable via mechanize. Mitigation: upgrade to 2.14.1 or later.

Original description

The description as published by the source.

Summary

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

Details

Mechanize::HTTP::Agent#response_follow_meta_refresh fetched the refresh target with no notion of a crossed origin, so @request_headers 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#request_headers= were exposed.

This requires Mechanize#follow_meta_refresh = 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 request_headers=. 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#follow_meta_refresh at its default of false, or avoid request_headers= for credentials when it is…

Source: GitHub Security Advisories (Global) NVD GitHub Advisory

Auto-generated summary

Assembled by SecPulse from the source data (CVSS, CWE, affected versions) using templates — no AI involved. Check the original description and references below for exact details.

A vulnerability tracked as CVE-2026-107399 has been found in mechanize.
Attackers can target a specific entry point like mechanize over the network to misuse the product.
Confidential information can be exposed externally. CVSS score: 6.8/10.
What to do: upgrade mechanize to 2.14.1 or later.
If unsure, ask your IT team or search "mechanize CVE-2026-107399" on the vendor's site.

CVE-2026-107399 (mechanize) — CWE-200 / CVSS v3 6.8
Attack vector: remote (network-reachable) / unauthenticated / no user interaction
Attack surface: mechanize / meta / false
Patched: 2.14.1 — apply immediately
Workaround: Leave Mechanize#follow_meta_refresh at its default of false, or avoid request_headers= for credentials when it is enabled.
Plan: 1) Audit SBOM/dependencies, 2) Stage→prod upgrade, 3) Add WAF/proxy monitoring on affected endpoints, 4) Hunt IOCs in logs.
Refs: see the GHSA / vendor advisory / patched release linked on this page.

❓ What is the problem

Information disclosure (CWE-200) exists in mechanize. Attackers reach the vulnerable code path via mechanize without authentication.

📍 Affected scope

Check the vendor advisory for the affected versions of mechanize. Attack surface: mechanize / meta / false.

🔥 Severity

Severity: Medium (CVSS 6.8/10). Confidential information can be exposed externally.

🔧 How to fix

Update to 2.14.1.

🛡️ Workaround

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

🔍 Detection

Search webserver/proxy logs for unusual request patterns matching this CVE's known IOCs. Run grep -r 'mechanize' . against your dependency files (package-lock.json, requirements.txt, go.sum) to find affected services.

Response actions

Concrete steps and command examples for SOC/SRE teams to execute in order

  1. 1
    Identify exposure identify
    grep -r 'mechanize' . | grep -v node_modules

    リポジトリと本番環境の依存ファイル (package-lock.json / requirements.txt / go.sum / Gemfile.lock 等) で mechanize を grep し、稼働しているサービス・バージョンを把握する。

  2. 2
    Apply temporary workaround mitigate
    Leave `Mechanize#follow_meta_refresh` at its default of `false`, or avoid `request_headers=` for credentials when it is enabled.

    パッチが適用されるまでの応急処置として、Leave Mechanize#follow_meta_refresh at its default of false, or avoid request_headers= for credentials when it is enabled. を実施。回避策の副作用 (機能低下) を確認した上で。

  3. 3
    Apply patch patch
    Upgrade mechanize to 2.14.1

    ステージング環境で 2.14.1 に上げて回帰テスト → 本番反映。回帰テストはアプリの主要ハッピーパスを含めること。

  4. 4
    Post-deployment verification verify
    Confirm patched version is live in production

    パッチ適用後、ステージングで PoC または同等の悪用パターンを再現して脆弱性が閉じたことを確認。本番ではアクセスログ・WAF でアラート再発が無いか継続監視。

Affected packages

rubygems mechanize
[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"2.14.1"}]}]

References

We use cookies for analytics and ad measurement. This setting applies to all Game co., Ltd. sites. Details