Skip to content
XSS Disclosed report Advanced CVE-2024-54133

[CVE-2024-54133] Possible Content Security Policy bypass in Action Dispatch

The content_security_policy helper in Action Pack could let carefully crafted user input inject new directives into a dynamically built CSP header. This could bypass the CSP and weaken its protection against XSS and other attacks.

ryotak Follow with sudi

Originally disclosed on HackerOne

  • Fixed in 50 days
  • Paid in 50 days
  • Disclosed after 50 days

Summary by the program

There is a possible Cross Site Scripting (XSS) vulnerability in the content_security_policy helper in Action Pack.

  • CVE-2024-54133
  • GHSA-vfm5-rmrh-j26v

Versions affected

  • actionpack >= 5.2.0, < 7.0.8.7 (patched in 7.0.8.7)
  • actionpack >= 7.1.0, < 7.1.5.1 (patched in 7.1.5.1)
  • actionpack >= 7.2.0, < 7.2.2.1 (patched in 7.2.2.1)
  • actionpack >= 8.0.0, < 8.0.0.1 (patched in 8.0.0.1)

Impact 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.

Advisory: https://discuss.rubyonrails.org/t/cve-2024-54133-possible-content-security-policy-bypass-in-action-dispatch/88178

The report

Summary

Original report: https://hackerone.com/reports/2440762 Advisory: https://discuss.rubyonrails.org/t/cve-2024-54133-possible-content-security-policy-bypass-in-action-dispatch/88178

Impact

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.

The original report as published on HackerOne, by ryotak. Images and videos are our own copies; raw HTML is shown as text. View it on HackerOne.

Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.

How it worked

Root cause

Likely the helper did not properly escape or validate values placed into the CSP header, so user input could break out and add directives.

Impact

Applications that build CSP headers from untrusted input could have their policy bypassed, reducing protection against XSS and other attacks.

What the attacker needed

App builds CSP from untrusted input

The fix

It was fixed in the listed patched versions of actionpack.

Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.

Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.

A Content Security Policy is a set of rules a website sends to the browser saying which scripts and resources are allowed, which helps stop injected scripts from running. Here, if a site built those rules using text supplied by users, an attacker could slip in extra rules that loosen the policy. That makes it easier for a script injection attack to succeed.

What is XSS?

Script an attacker supplies runs in another user's browser, on the target's origin, with that user's session.

More by ryotak

View all

23 more disclosed reports, best first.

More from Internet Bug Bounty

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Cross-site scripting (XSS)

The lesson behind this report.

Script an attacker supplies runs in another user's browser, on the target's origin, with that user's session.