Action Pack: Possible cache poisoning in Action Pack content negotiation
Published 10 Nov 2026 · Updated 10 Nov 2026
Is your project on an affected actionpack?
Look after several Rails or Ruby apps? Indie watches up to 15 repos, private ones too, for $5 a month. See Indie
Affected packages
- Affected
- >=8.1 <8.1.4.1
- Fixed in
- 8.1.4.1
bundle update --conservative actionpack # Gemfile: '>= 8.1.4.1'- Affected
- <8.0.5.2
- Fixed in
- 8.0.5.2
bundle update --conservative actionpack # Gemfile: '>= 8.0.5.2'Details
Impact
Action Pack negotiates the format of a rendered response from the Accept, X-Requested-With and, for XHR requests without Accept, Content-Type request headers, but ActionController::Rendering#_set_vary_header adds Vary: Accept only when the request carries a usable Accept header and the response has no Vary header yet. A response to a request without Accept, or to an XHR request, therefore omits the headers that selected its representation, and a response whose Vary the application set before rendering (for example Vary: Accept-Language) never gains Accept. A shared cache that honours Vary could store such a response and serve it to later clients that request a different representation, possibly leading to cache poisoning in which visitors receive, until the entry expires, a page without its layout or HTML in place of JSON. The attacker cannot choose the content of the response.
Applications that render negotiated responses from actions marked public (for example with expires_in ..., public: true) behind a shared cache that honours Vary, such as Thruster or Rack::Cache, are affected.
Details
In the fixed releases, a rendered response whose format is not given by the URL lists Accept and X-Requested-With in Vary, and also Content-Type for an XHR request without Accept; when config.action_dispatch.ignore_accept_header is enabled, it lists only X-Requested-With. These fields are appended to an existing Vary value rather than skipped, and Vary: * is left unchanged. Shared caches can store more variants of such responses than before. See the Action Pack CHANGELOG for details.
Workarounds
Set Vary: Accept, X-Requested-With on negotiated responses in the application, for example in an after_action, or do not mark negotiated responses public.
Releases
The fixed releases are available at the normal locations.
Patches for those who cannot upgrade at once:
- 8.1: https://github.com/rails/rails/commit/7a955ca36779938267c93902c47d1f55bab99b4b.patch
- 8.0: https://github.com/rails/rails/commit/b58c107abe9c1f10c1d6a4941402c60e4dc4742c.patch
Credit
This issue was found by the Anthropic OSS Scanner (ANT-2026-7GHGLQGO, ANT-2026-5MT6C2R3).
Is GHSA-r9jg-fmfx-2gv6 in any of your client repos?
Checking one package by hand is fine. Checking it across forty client projects is not. NPMscan reads the lockfiles in every GitHub repo you pick, finds each project with an affected actionpack, and gives you the command that fixes it.
More advisories for actionpack
- MediumCVE-2026-126072Action Pack: Possible DoS vulnerability in Action Controller Live streaming · 12 Nov 2026
- MediumCVE-2026-126077Action Pack: Possible sensitive session information leak in Active Storage proxy mode · 12 Nov 2026
- HighCVE-2026-126081Action Pack: Possible Strong Parameters Bypass in Parameters#each_key · 12 Nov 2026
- LowCVE-2026-126067Action Pack: Missing SameSite attribute on session cookies from Action Pack session stores · 10 Nov 2026
- HighCVE-2026-126083Action Pack: Possible IP spoofing in Action Dispatch RemoteIp · 10 Nov 2026
- MediumCVE-2026-126076Action Pack: Possible restoration of destroyed sessions in Action Dispatch CacheStore · 10 Nov 2026
References
- Linkgithub.com/rails/rails/security/advisories/GHSA-r9jg-fmfx-2gv6
- Linkgithub.com/rails/rails/commit/7a955ca36779938267c93902c47d1f55bab99b4b
- Linkgithub.com/rails/rails/commit/b58c107abe9c1f10c1d6a4941402c60e4dc4742c
- Packagegithub.com/rails/rails
- Linkgithub.com/rails/rails/releases/tag/v8.0.5.2
- Linkgithub.com/rails/rails/releases/tag/v8.1.4.1
- Linkgithub.com/rubysec/ruby-advisory-db/blob/master/gems/actionpack/GHSA-r9jg-fmfx-2gv6.yml
Advisory data from OSV.dev (opens OSV.dev in a new tab), refreshed daily.