CVE-2024-53988 Possible XSS vulnerability with certain configurations of rails-html-sanitizer 1.6.0
Attackers can inject malicious scripts via specific HTML tags in Rails applications using the rails-html-sanitizer library with non-default configurations.
- 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-53988?
CVE-2024-53988 is a low-severity cross-site scripting vulnerability in rails-html-sanitizer, published on 2 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
rails-html-sanitizer is responsible for sanitizing HTML fragments in Rails applications. There is a possible XSS vulnerability with certain configurations of Rails::HTML::Sanitizer 1.6.0 when used with Rails >= 7.1.0. A possible XSS vulnerability with certain configurations of Rails::HTML::Sanitizer may allow an attacker to inject content if HTML5 sanitization is enabled and the application developer has overridden the sanitizer's allowed tags where the "math", "mtext", "table", and "style" elements are allowed and either either "mglyph" or "malignmark" are allowed. This vulnerability is fixed in 1.6.1.
Weakness: CWE-79
Which versions are affected by CVE-2024-53988?
2 open source packages ship an affected version, including rails-html-sanitizer. It affects 1 product.
| Package | Affected | Fixed in |
|---|---|---|
rails-html-sanitizer RubyGems | From 1.6.0 | 1.6.1 |
rails-html-sanitizer RubyGems | From 1.6.0 | 1.6.1 |
Products include Rubyonrails Rails Html Sanitizers.
How do I fix CVE-2024-53988?
Upgrade rails-html-sanitizer to 1.6.1 or later.
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-53988 being exploited?
There is no known exploitation of CVE-2024-53988 in the wild and no public exploit code.
Other vulnerabilities in rails-html-sanitizer
- CVE-2024-53985 Possible XSS vulnerability with certain configurations of rails-html-sanitizer 1.6.0
- CVE-2024-53986 Possible XSS vulnerability with certain configurations of rails-html-sanitizer 1.6.0
- CVE-2024-53987 Possible XSS vulnerability with certain configurations of rails-html-sanitizer 1.6.0
- CVE-2024-53989 Possible XSS vulnerability with certain configurations of rails-html-sanitizer 1.6.0
Sources
Also known as GHSA-cfjx-w229-hgx5, UBUNTU-CVE-2024-53988.