CVE-2024-26143 Rails Possible XSS Vulnerability in Action Controller
Attackers can inject malicious scripts via translation helpers in Rails controllers if specific unsafe patterns are used, requiring an upgrade to patched versions.
- 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-26143?
CVE-2024-26143 is a medium-severity cross-site scripting vulnerability in Rubyonrails Rails, published on 27 Feb 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 is a web-application framework. There is a possible XSS vulnerability when using the translation helpers in Action Controller. Applications using translation methods like translate, or t on a controller, with a key ending in "_html", a :default key which contains untrusted user input, and the resulting string is used in a view, may be susceptible to an XSS vulnerability. The vulnerability is fixed in 7.1.3.1 and 7.0.8.1.
Weakness: CWE-79
Which versions are affected by CVE-2024-26143?
9 open source packages ship an affected version, including rails and actionpack. It affects 1 product.
| Package | Affected | Fixed in |
|---|---|---|
rails Bitnami | From 7.0.0 | 7.0.9, 7.1.4 |
rails RubyGems | From 7.0.0 | 7.0.8.1 |
rails RubyGems | From 7.0.0 | 7.0.8.1 |
rails RubyGems | From 7.1.0 | 7.1.3.1 |
rails RubyGems | From 7.1.0 | 7.1.3.1 |
actionpack RubyGems | From 7.0.0 | 7.0.8.1 |
3 more packages
actionpack RubyGems | From 7.0.0 | 7.0.8.1 |
actionpack RubyGems | From 7.1.0 | 7.1.3.1 |
actionpack RubyGems | From 7.1.0 | 7.1.3.1 |
Products include Rubyonrails Rails.
How do I fix CVE-2024-26143?
Upgrade rails to a fixed version for your release line: 7.0.9, 7.1.4, 7.0.8.1 or 7.1.3.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-26143 being exploited?
There is no known exploitation of CVE-2024-26143 in the wild and no public exploit code.
Other vulnerabilities in Rubyonrails Rails
- CVE-2013-0277 Active Record contains deserialization of arbitrary YAML
- CVE-2017-17916 SQL injection in n/a
- CVE-2017-17917 SQL injection in n/a
- CVE-2026-33195 Rails Active Storage has possible Path Traversal in DiskService
- CVE-2024-26142 Rails possible ReDoS vulnerability in Accept header parsing in Action Dispatch
Sources
Also known as BIT-rails-2024-26143, GHSA-9822-6m93-xqf4, UBUNTU-CVE-2024-26143.