CVE-2024-26143 Rails Possible XSS Vulnerability in Action Controller

Medium 6.1 Published Updated

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.

PackageAffectedFixed in
rails BitnamiFrom 7.0.07.0.9, 7.1.4
rails RubyGemsFrom 7.0.07.0.8.1
rails RubyGemsFrom 7.0.07.0.8.1
rails RubyGemsFrom 7.1.07.1.3.1
rails RubyGemsFrom 7.1.07.1.3.1
actionpack RubyGemsFrom 7.0.07.0.8.1
3 more packages
actionpack RubyGemsFrom 7.0.07.0.8.1
actionpack RubyGemsFrom 7.1.07.1.3.1
actionpack RubyGemsFrom 7.1.07.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.

All Rubyonrails Rails vulnerabilities

Sources

Also known as BIT-rails-2024-26143, GHSA-9822-6m93-xqf4, UBUNTU-CVE-2024-26143.

Is CVE-2024-26143 in your software?

Upload an SBOM and sbomify checks it against every vulnerability here, every day.

Check your SBOMs for free