|
| 1 | +--- |
| 2 | +layout: advisory |
| 3 | +title: 'GHSA-53g2-mvcc-q9x3 (action_text-trix): Stored XSS via HTMLParser attribute |
| 4 | + injection on paste' |
| 5 | +comments: false |
| 6 | +categories: |
| 7 | +- action_text-trix |
| 8 | +advisory: |
| 9 | + gem: action_text-trix |
| 10 | + ghsa: 53g2-mvcc-q9x3 |
| 11 | + url: https://github.com/basecamp/trix/security/advisories/GHSA-53g2-mvcc-q9x3 |
| 12 | + title: Stored XSS via HTMLParser attribute injection on paste |
| 13 | + date: 2026-03-26 |
| 14 | + description: |- |
| 15 | + ## Impact |
| 16 | +
|
| 17 | + The Trix editor, in versions prior to 2.1.18, is vulnerable to XSS |
| 18 | + when crafted HTML is pasted into the editor. The HTMLParser processed |
| 19 | + a mock attachment, a <span> carrying an empty data-trix-attachment="{}". |
| 20 | + The empty attachment object caused the element to bypass attachment |
| 21 | + handling, so its data-trix-attributes were applied to a plain string |
| 22 | + piece. The pre-2.1.18 StringPiece.fromJSON accepted the href without |
| 23 | + validation, so an attacker-supplied javascript: URI was carried into |
| 24 | + the document model and emitted verbatim into the serialized HTML, |
| 25 | + executing when the content was rendered and clicked. |
| 26 | +
|
| 27 | + This is a stored XSS in any application that accepts untrusted rich |
| 28 | + text through Trix and renders the serialized output to other users. |
| 29 | + Applications that apply server-side HTML sanitization, such as the |
| 30 | + Rails built-in sanitizer, are additionally protected because the |
| 31 | + payload is neutralized on save. |
| 32 | +
|
| 33 | + This vulnerability shares its fix with GHSA-53p3-c7vp-4mcc. |
| 34 | + Both are resolved by the StringPiece.fromJSON sanitization added |
| 35 | + in 2.1.18. This advisory covers the paste and HTMLParser entry |
| 36 | + vector, while GHSA-53p3-c7vp-4mcc covers the drag-and-drop path |
| 37 | + through the fallback Level0InputController. |
| 38 | +
|
| 39 | + ## References |
| 40 | +
|
| 41 | + The vulnerability was responsibly reported by HackerOne |
| 42 | + researcher newbiefromcoma. |
| 43 | + cvss_v3: 4.6 |
| 44 | + patched_versions: |
| 45 | + - ">= 2.1.18" |
| 46 | + related: |
| 47 | + url: |
| 48 | + - https://rubygems.org/gems/action_text-trix/versions/2.1.18 |
| 49 | + - https://github.com/basecamp/trix/releases/tag/v2.1.18 |
| 50 | + - https://github.com/basecamp/trix/pull/1293 |
| 51 | + - https://github.com/advisories/GHSA-53p3-c7vp-4mcc |
| 52 | + - https://github.com/basecamp/trix/security/advisories/GHSA-53g2-mvcc-q9x3 |
| 53 | + notes: | |
| 54 | + - No CVE. |
| 55 | + - cvss_v3 from GHSA |
| 56 | + - date from gem releases page |
| 57 | + - Unnknown HackerOne number |
| 58 | +--- |
0 commit comments