{"schema":"threatline.record/2","record":{"id":"CVE-2026-107399","aliases":["GHSA-c6rp-p8xm-4q9f"],"summary":"Mechanize sends credential headers to another origin after a meta refresh","details":"## Summary\n\n`mechanize` applied no trust boundary to a `meta` refresh, so credentials set through `Mechanize#request_headers=` followed a refresh that pointed at another origin.\n\n## Details\n\n`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.\n\nThe refresh fetch passes an empty per-request headers hash, so only headers set through `Mechanize#request_headers=` were exposed.\n\nThis 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.\n\n## Impact\n\nAn 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.\n\n## Patches\n\nFixed 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.\n\n## Workarounds\n\nLeave `Mechanize#follow_meta_refresh` at its default of `false`, or avoid `request_headers=` for credentials when it is enabled.","categories":["Libraries & packages"],"product":"mechanize","vendor":"sparklemotion","ecosystem":"rubygems","affected_ranges":[{"source":"GitHub Advisory Database","source_url":"https://github.com/advisories/GHSA-c6rp-p8xm-4q9f","source_modified_at":"2026-10-08T22:09:04Z","fetched_at":"2026-10-23T18:42:43.628194Z","package":{"ecosystem":"rubygems","name":"mechanize"},"range":"< 2.14.1"},{"source":"CVE List","source_url":"https://www.cve.org/CVERecord?id=CVE-2026-107399","source_modified_at":"2026-10-14T01:21:37.665Z","fetched_at":"2026-10-23T18:45:31.882637Z","product":"mechanize","vendor":"sparklemotion","versions":[{"version":"< 2.15.0","status":"affected"}],"defaultStatus":null},{"source":"OSV","source_url":"https://osv.dev/vulnerability/GHSA-c6rp-p8xm-4q9f","source_modified_at":"2026-10-08T22:30:20.277030613Z","fetched_at":"2026-10-23T18:42:43.628194Z","package":{"ecosystem":"RubyGems","name":"mechanize","purl":"pkg:gem/mechanize"},"ranges":[{"events":[{"introduced":"0"},{"fixed":"2.14.1"}],"type":"ECOSYSTEM"}],"versions":["0.1.0","0.1.1","0.1.2","0.1.3","0.2.0","0.2.1","0.2.2","0.2.3","0.3.0","0.3.1","0.4.0","0.4.1","0.4.2","0.4.3","0.4.4","0.4.5","0.4.6","0.4.7","0.5.0","0.5.1","0.5.2","0.5.3","0.5.4","0.6.0","0.6.1","0.6.10","0.6.11","0.6.2","0.6.3","0.6.4","0.6.5","0.6.6","0.6.7","0.6.8","0.6.9","0.7.0","0.7.1","0.7.2","0.7.3","0.7.4","0.7.5","0.7.6","0.7.7","0.7.8","0.8.0","0.8.1","0.8.2","0.8.3","0.8.4","0.8.5"]}],"fixed_versions":[{"source":"GitHub Advisory Database","source_url":"https://github.com/advisories/GHSA-c6rp-p8xm-4q9f","source_modified_at":"2026-10-08T22:09:04Z","fetched_at":"2026-10-23T18:42:43.628194Z","package":{"ecosystem":"rubygems","name":"mechanize"},"version":"2.14.1"},{"source":"OSV","source_url":"https://osv.dev/vulnerability/GHSA-c6rp-p8xm-4q9f","source_modified_at":"2026-10-08T22:30:20.277030613Z","fetched_at":"2026-10-23T18:42:43.628194Z","package":{"ecosystem":"RubyGems","name":"mechanize","purl":"pkg:gem/mechanize"},"version":"2.14.1"}],"cvss":6.8,"severity":"Medium","kev":{"listed":false},"epss":{"probability":0.00362,"percentile":0.28913,"score_date":"2026-10-23"},"published_at":"2026-10-08T21:24:46.349Z","modified_at":"2026-10-14T01:21:37.665Z","provenance":[{"source":"GitHub Advisory Database","url":"https://github.com/advisories/GHSA-c6rp-p8xm-4q9f","fetched_at":"2026-10-23T18:42:43.628194Z","source_modified_at":"2026-10-08T22:09:04Z"},{"source":"CVE List","url":"https://www.cve.org/CVERecord?id=CVE-2026-107399","fetched_at":"2026-10-23T18:45:31.882637Z","source_modified_at":"2026-10-14T01:21:37.665Z"},{"source":"OSV","url":"https://osv.dev/vulnerability/GHSA-c6rp-p8xm-4q9f","fetched_at":"2026-10-23T18:42:43.628194Z","source_modified_at":"2026-10-08T22:30:20.277030613Z"},{"source":"EPSS","url":"https://api.first.org/data/v1/epss?cve=CVE-2026-107399","fetched_at":"2026-10-23T18:42:43.628194Z","source_modified_at":"2026-10-23"}],"sources":["GitHub Advisory Database","CVE List","OSV","EPSS"],"references":[{"source":"CVE List","url":"https://github.com/sparklemotion/mechanize/security/advisories/GHSA-c6rp-p8xm-4q9f","tags":["x_refsource_CONFIRM"]},{"source":"CVE List","url":"https://github.com/sparklemotion/mechanize/pull/676","tags":["x_refsource_MISC"]},{"source":"CVE List","url":"https://github.com/sparklemotion/mechanize/commit/02a1235842d6eda8d4a5a3d8f13aba2cecf52e4f","tags":["x_refsource_MISC"]},{"source":"CVE List","url":"https://github.com/sparklemotion/mechanize/commit/84c74df87d15f5d119df268ba6aa79bc1e16a2c3","tags":["x_refsource_MISC"]},{"source":"CVE List","url":"https://github.com/sparklemotion/mechanize/releases/tag/v2.14.1","tags":["x_refsource_MISC"]},{"url":"https://github.com/advisories/GHSA-c6rp-p8xm-4q9f","source":"GitHub Advisory Database"}],"locations":[],"motoko_assessment":{"status":"requires_architecture_review","automatic_remediation":false},"cve_state":"PUBLISHED","ssvc":{"exploitation":"none","automatable":"no","technical_impact":"partial","assessed_at":"2026-10-14T01:21:27.011574Z"},"classification":{"method":"product-first software-layer rules","rules_version":"2.1","matched_on":"ecosystem","confidence":"heuristic","reviewed":false},"change_timestamp":"2026-10-14T01:21:37.665Z","content_hash":"54251dbd263cbfde41220efe128a7c9e506c5c03de8f1e839004fe4aeacee479"}}
