There is a possible XSS vulnerability when using the translation helpers
(translate
, t
, etc) in Action Controller. This vulnerability has been
assigned the CVE identifier CVE-2024-26143.
Versions Affected: >= 7.0.0. Not affected: < 7.0.0 Fixed Versions: 7.1.3.1, 7.0.8.1
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.
For example, impacted code will look something like this:
class ArticlesController < ApplicationController
def show
@message = t("message_html", default: untrusted_input)
# The `show` template displays the contents of `@message`
end
end
To reiterate the pre-conditions, applications must:
t
from
a view)_html
render
call)All users running an affected release should either upgrade or use one of the workarounds immediately.
The fixed releases are available at the normal locations.
There are no feasible workarounds for this issue.
To aid users who aren't able to upgrade immediately we have provided patches for the two supported release series. They are in git-am format and consist of a single changeset.
Thanks to ooooooo_q for the patch and fix!
{ "nvd_published_at": "2024-02-27T16:15:46Z", "cwe_ids": [ "CWE-79" ], "severity": "MODERATE", "github_reviewed": true, "github_reviewed_at": "2024-02-27T21:41:12Z" }