@@ -12,24 +12,49 @@ advisory:
12
12
url : https://discuss.rubyonrails.org/t/possible-xss-vulnerability-in-action-controller/84947
13
13
title : Possible XSS Vulnerability in Action Controller
14
14
date : 2024-02-21
15
- description : " There is a possible XSS vulnerability when using the translation helpers\n (`translate`,
16
- `t`, etc) in Action Controller. This vulnerability has been\n assigned the CVE
17
- identifier CVE-2024-26143.\n\n Versions Affected: All. Not affected: None Fixed
18
- Versions: 7.1.3.1, 7.0.8.1\n\n # Impact\n\n Applications using translation methods
19
- like `translate`, or `t` on a\n controller, with a key ending in “_html”, a `:default`
20
- key which contains\n untrusted user input, and the resulting string is used in
21
- a view, may be\n susceptible to an XSS vulnerability.\n\n For example, impacted
22
- code will look something like this:\n\n ```\n class ArticlesController < ApplicationController\n
23
- \ def show \n @message = t(\" message_html\" , default: untrusted_input)\n #
24
- The `show` template displays the contents of `@message`\n end\n end\n ```\n\n To
25
- reiterate the pre-conditions, applications must:\n\n * Use a translation function
26
- from a controller (i.e. *not* `I18n.t`, or\n `t` from a view)\n * Use a key that
27
- ends in `_html`\n * Use a default value where the default value is untrusted and
28
- unescaped input\n * Send the text to the victim (whether that’s part of a template,
29
- or a\n `render` call)\n\n All users running an affected release should either
30
- upgrade or use one of the workarounds immediately.\n\n # Releases\n\n The fixed
31
- releases are available at the normal locations.\n\n # Workarounds\n\n There are
32
- no feasible workarounds for this issue.\n "
15
+ description : |
16
+ There is a possible XSS vulnerability when using the translation helpers
17
+ (`translate`, `t`, etc) in Action Controller. This vulnerability has been
18
+ assigned the CVE identifier CVE-2024-26143.
19
+
20
+ Versions Affected: All. Not affected: None Fixed Versions: 7.1.3.1, 7.0.8.1
21
+
22
+ # Impact
23
+
24
+ Applications using translation methods like `translate`, or `t` on a
25
+ controller, with a key ending in “_html”, a `:default` key which contains
26
+ untrusted user input, and the resulting string is used in a view, may be
27
+ susceptible to an XSS vulnerability.
28
+
29
+ For example, impacted code will look something like this:
30
+
31
+ ```
32
+ class ArticlesController < ApplicationController
33
+ def show
34
+ @message = t("message_html", default: untrusted_input)
35
+ # The `show` template displays the contents of `@message`
36
+ end
37
+ end
38
+ ```
39
+
40
+ To reiterate the pre-conditions, applications must:
41
+
42
+ * Use a translation function from a controller (i.e. *not* `I18n.t`, or
43
+ `t` from a view)
44
+ * Use a key that ends in `_html`
45
+ * Use a default value where the default value is untrusted and unescaped input
46
+ * Send the text to the victim (whether that’s part of a template, or a
47
+ `render` call)
48
+
49
+ All users running an affected release should either upgrade or use one of the workarounds immediately.
50
+
51
+ # Releases
52
+
53
+ The fixed releases are available at the normal locations.
54
+
55
+ # Workarounds
56
+
57
+ There are no feasible workarounds for this issue.
33
58
patched_versions :
34
59
- " ~> 7.0.8, >= 7.0.8.1"
35
60
- " >= 7.1.3.1"
0 commit comments