@@ -5,29 +5,62 @@ ghsa: 9822-6m93-xqf4
55url : https://github.com/rails/rails/security/advisories/GHSA-9822-6m93-xqf4
66title : Rails has possible XSS Vulnerability in Action Controller
77date : 2024-02-27
8- description : " # Possible XSS Vulnerability in Action Controller\n\n There is a possible
9- XSS vulnerability when using the translation helpers\n (`translate`, `t`, etc) in
10- Action Controller. This vulnerability has been\n assigned the CVE identifier CVE-2024-26143.\n\n Versions
11- Affected: >= 7.0.0.\n Not affected: < 7.0.0\n Fixed Versions: 7.1.3.1,
12- 7.0.8.1\n\n Impact\n ------\n Applications using translation methods like `translate`,
13- or `t` on a\n controller, with a key ending in \" _html\" , a `:default` key which
14- contains\n untrusted user input, and the resulting string is used in a view, may
15- be\n susceptible to an XSS vulnerability.\n\n For example, impacted code will look
16- something like this:\n\n ```ruby\n class ArticlesController < ApplicationController\n
17- \ def show \n @message = t(\" message_html\" , default: untrusted_input)\n #
18- The `show` template displays the contents of `@message`\n end\n end\n ```\n\n To reiterate
19- the pre-conditions, applications must:\n\n * Use a translation function from a controller
20- (i.e. _not_ I18n.t, or `t` from\n a view)\n * Use a key that ends in `_html`\n *
21- Use a default value where the default value is untrusted and unescaped input\n *
22- Send the text to the victim (whether that's part of a template, or a\n `render`
23- call)\n\n All users running an affected release should either upgrade or use one
24- of the\n workarounds immediately.\n\n Releases\n --------\n The fixed releases are available
25- at the normal locations.\n\n Workarounds\n -----------\n There are no feasible workarounds
26- for this issue.\n\n Patches\n -------\n To aid users who aren't able to upgrade immediately
27- we have provided patches for\n the two supported release series. They are in git-am
28- format and consist of a\n single changeset.\n\n * 7-0-translate-xss.patch - Patch
29- for 7.0 series\n * 7-1-translate-xss.patch - Patch for 7.1 series\n\n Credits\n -------\n\n Thanks
30- to [ooooooo_q](https://hackerone.com/ooooooo_q) for the patch and fix!"
8+ description : |
9+ # Possible XSS Vulnerability in Action Controller
10+
11+ There is a possible XSS vulnerability when using the translation helpers
12+ (`translate`, `t`, etc) in Action Controller.
13+ This vulnerability has been assigned the CVE identifier CVE-2024-26143.
14+
15+ Versions Affected: `>= 7.0.0`.
16+ Not affected: `< 7.0.0`
17+ Fixed Versions: `7.1.3.1`, `7.0.8.1`
18+
19+ ## Impact
20+
21+ Applications using translation methods like `translate`, or `t` on a controller,
22+ with a key ending in `_html`, a `:default` key which contains untrusted user input,
23+ and the resulting string is used in a view, may be susceptible to an XSS vulnerability.
24+
25+ For example, impacted code will look something like this:
26+
27+ ```ruby
28+ class ArticlesController < ApplicationController
29+ def show
30+ @message = t("message_html", default: untrusted_input)
31+ # The `show` template displays the contents of `@message`
32+ end
33+ end
34+ ```
35+
36+ To reiterate the pre-conditions, applications must:
37+
38+ * Use a translation function from a controller (i.e. _not_ I18n.t, or `t` from a view)
39+ * Use a key that ends in `_html`
40+ * Use a default value where the default value is untrusted and unescaped input
41+ * Send the text to the victim (whether that's part of a template, or a `render` call)
42+
43+ All users running an affected release should either upgrade or use one of the workarounds immediately.
44+
45+ ## Releases
46+
47+ The fixed releases are available at the normal locations.
48+
49+ ## Workarounds
50+
51+ There are no feasible workarounds for this issue.
52+
53+ ## Patches
54+
55+ To aid users who aren't able to upgrade immediately we have provided patches for
56+ the two supported release series. They are in git-am format and consist of a single changeset.
57+
58+ * 7-0-translate-xss.patch - Patch for 7.0 series
59+ * 7-1-translate-xss.patch - Patch for 7.1 series
60+
61+ ## Credits
62+
63+ Thanks to [ooooooo_q](https://hackerone.com/ooooooo_q) for the patch and fix!"
3164cvss_v3 : 6.1
3265unaffected_versions :
3366- " < 7.0.0"
0 commit comments