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

> Attackers can bypass Content Security Policy protections in Rails applications if CSP headers are dynamically set from untrusted input, potentially enabling XSS attacks.

- **Severity:** Low 2.3 (`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`)
- **Exploited in the wild:** Not known
- **Login needed:** Not needed
- **Attackable:** Over the internet
- **Victim action needed:** A user has to click or open something
- **Fix available:** Yes
- **Published:** 10 Dec 2024
- **Updated:** 7 Mar 2025
- **Also known as:** BIT-rails-2024-54133, DEBIAN-CVE-2024-54133, GHSA-vfm5-rmrh-j26v, UBUNTU-CVE-2024-54133, openSUSE-SU-2025:14668-1, openSUSE-SU-2025:14669-1, openSUSE-SU-2025:14670-1, openSUSE-SU-2025:14671-1, openSUSE-SU-2025:14672-1, openSUSE-SU-2025:14673-1, openSUSE-SU-2025:14674-1, openSUSE-SU-2025:14675-1, openSUSE-SU-2025:14676-1, openSUSE-SU-2025:14677-1, openSUSE-SU-2025:14678-1, openSUSE-SU-2025:14679-1, openSUSE-SU-2025:14680-1, openSUSE-SU-2026:10335-1, openSUSE-SU-2026:10336-1, openSUSE-SU-2026:10337-1, openSUSE-SU-2026:10338-1, openSUSE-SU-2026:10339-1, openSUSE-SU-2026:10340-1, openSUSE-SU-2026:10341-1, openSUSE-SU-2026:10342-1, openSUSE-SU-2026:10344-1, openSUSE-SU-2026:10345-1, openSUSE-SU-2026:10360-1, openSUSE-SU-2026:10362-1

## What is CVE-2024-54133?

CVE-2024-54133 is a low-severity cross-site scripting vulnerability in rails, published on 10 Dec 2024. An attacker can exploit it over the internet without logging in, and only if a user opens a file or follows a link.

### Official 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.

Weakness: CWE-79 (Improper Neutralization of Input During Web Page Generation)

## Which versions are affected by CVE-2024-54133?

9 open source packages ship an affected version, including rails and actionpack.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `rails` | Bitnami | From 5.2.0 | 7.0.9, 7.1.4, 7.2.2-2-0, 8.0.1 |
| `actionpack` | RubyGems | From 5.2.0 | 7.0.8.7 |
| `actionpack` | RubyGems | From 5.2.0 | 7.0.8.7 |
| `actionpack` | RubyGems | From 7.1.0 | 7.1.5.1 |
| `actionpack` | RubyGems | From 7.1.0 | 7.1.5.1 |
| `actionpack` | RubyGems | From 7.2.0 | 7.2.2.1 |
| `actionpack` | RubyGems | From 7.2.0 | 7.2.2.1 |
| `actionpack` | RubyGems | From 8.0.0 | 8.0.0.1 |
| `actionpack` | RubyGems | From 8.0.0 | 8.0.0.1 |
| `rubygem-actioncable-8.0` | openSUSE:Tumbleweed | All versions | 8.0.1-1.1 |
| `rubygem-actioncable-8.0` | openSUSE:Tumbleweed | All versions | 8.0.3-1.3 |
| `rubygem-actionmailbox-8.0` | openSUSE:Tumbleweed | All versions | 8.0.1-1.1 |
| `rubygem-actionmailbox-8.0` | openSUSE:Tumbleweed | All versions | 8.0.3-1.3 |
| `rubygem-actionmailer-8.0` | openSUSE:Tumbleweed | All versions | 8.0.1-1.1 |
| `rubygem-actionmailer-8.0` | openSUSE:Tumbleweed | All versions | 8.0.3-1.3 |
| `rubygem-actionpack-8.0` | openSUSE:Tumbleweed | All versions | 8.0.1-1.1 |
| `rubygem-actionpack-8.0` | openSUSE:Tumbleweed | All versions | 8.0.3-1.3 |
| `rubygem-actiontext-8.0` | openSUSE:Tumbleweed | All versions | 8.0.1-1.1 |
| `rubygem-actiontext-8.0` | openSUSE:Tumbleweed | All versions | 8.0.3-1.3 |
| `rubygem-actionview-8.0` | openSUSE:Tumbleweed | All versions | 8.0.1-1.1 |
| `rubygem-actionview-8.0` | openSUSE:Tumbleweed | All versions | 8.0.3-1.3 |
| `rubygem-activejob-8.0` | openSUSE:Tumbleweed | All versions | 8.0.1-1.1 |
| `rubygem-activejob-8.0` | openSUSE:Tumbleweed | All versions | 8.0.3-1.3 |
| `rubygem-activemodel-8.0` | openSUSE:Tumbleweed | All versions | 8.0.1-1.1 |
| `rubygem-activemodel-8.0` | openSUSE:Tumbleweed | All versions | 8.0.3-1.3 |
| `rubygem-activerecord-8.0` | openSUSE:Tumbleweed | All versions | 8.0.1-1.1 |
| `rubygem-activestorage-8.0` | openSUSE:Tumbleweed | All versions | 8.0.1-1.1 |
| `rubygem-activestorage-8.0` | openSUSE:Tumbleweed | All versions | 8.0.3-1.3 |
| `rubygem-activesupport-8.0` | openSUSE:Tumbleweed | All versions | 8.0.1-1.1 |
| `rubygem-activesupport-8.0` | openSUSE:Tumbleweed | All versions | 8.0.3-1.3 |
| `rubygem-rails-8.0` | openSUSE:Tumbleweed | All versions | 8.0.1-1.1 |
| `rubygem-rails-8.0` | openSUSE:Tumbleweed | All versions | 8.0.3-1.3 |
| `rubygem-railties-8.0` | openSUSE:Tumbleweed | All versions | 8.0.1-1.1 |
| `rubygem-railties-8.0` | openSUSE:Tumbleweed | All versions | 8.0.3-1.3 |

## How do I fix CVE-2024-54133?

Upgrade rails to a fixed version for your release line: 7.0.9, 7.1.4, 7.2.2-2-0 or 8.0.1.

## Is CVE-2024-54133 being exploited?

There is no known exploitation of CVE-2024-54133 in the wild and no public exploit code.

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2024-54133 and fix it if it is affected.

What it is: CVE-2024-54133 is a low-severity cross-site scripting vulnerability in rails, published on 10 Dec 2024. An attacker can exploit it over the internet without logging in, and only if a user opens a file or follows a link.
Exploitation: There is no known exploitation of CVE-2024-54133 in the wild and no public exploit code.

Affected packages and fixed versions:
- rails (Bitnami): affected from 5.2.0; fixed in 7.0.9, 7.1.4, 7.2.2-2-0, 8.0.1
- actionpack (RubyGems): affected from 5.2.0; fixed in 7.0.8.7
- actionpack (RubyGems): affected from 5.2.0; fixed in 7.0.8.7
- actionpack (RubyGems): affected from 7.1.0; fixed in 7.1.5.1
- actionpack (RubyGems): affected from 7.1.0; fixed in 7.1.5.1
- actionpack (RubyGems): affected from 7.2.0; fixed in 7.2.2.1
- actionpack (RubyGems): affected from 7.2.0; fixed in 7.2.2.1
- actionpack (RubyGems): affected from 8.0.0; fixed in 8.0.0.1
- actionpack (RubyGems): affected from 8.0.0; fixed in 8.0.0.1

Task:
1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.
2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.
3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.
4. Run the tests and summarise what changed and why.
5. If nothing in the project is affected, say so and change nothing.

Reference: https://insights.sbomify.com/CVE-2024-54133/ (Markdown: https://insights.sbomify.com/CVE-2024-54133/index.md)
```

## Sources

- CVE record: https://www.cve.org/CVERecord?id=CVE-2024-54133
- NVD: https://nvd.nist.gov/vuln/detail/CVE-2024-54133
- OSV: https://osv.dev/vulnerability/CVE-2024-54133

---
From sbomify Insights: https://insights.sbomify.com/CVE-2024-54133/
Summaries are generated and may contain mistakes; the official description above is the record.
