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.
- 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
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
Which versions are affected by CVE-2024-54133?
9 open source packages ship an affected version, including rails and actionpack.
| Package | 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 |
3 more packages
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 |
Linux distribution packages (25)
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.
Escape output for the context it lands in and set a strict Content Security Policy. Upgrading the affected component is the real fix. More about Cross-site scripting.
Is CVE-2024-54133 being exploited?
There is no known exploitation of CVE-2024-54133 in the wild and no public exploit code.
Sources
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 and 23 more.