CVE-2024-34341
The Trix Editor Contains an Arbitrary Code Execution Vulnerability
Trix is a rich text editor. The Trix editor, versions prior to 2.1.1, is vulnerable to arbitrary code execution when copying and pasting content from the web or other documents with markup into the editor. The vulnerability stems from improper sanitization of pasted content, allowing an attacker to embed malicious scripts which are executed within the context of the application. Users should upgrade to Trix editor version 2.1.1 or later, which incorporates proper sanitization of input from copied content.
Attack profile
How easy it is to exploit
- Attack vector
- Network
- Complexity
- Low
- Privileges needed
- None
- User interaction
- Required
What an attacker can affect
- Confidentiality
- Low
- Integrity
- Low
- Availability
- None
Exploit likelihood
What each source reports
CVE List Score used
5.4
The Trix Editor Contains an Arbitrary Code Execution Vulnerability
Trix is a rich text editor. The Trix editor, versions prior to 2.1.1, is vulnerable to arbitrary code execution when copying and pasting content from the web or other documents with markup into the editor. The vulnerability stems from improper sanitization of pasted content, allowing an attacker to embed malicious scripts which are executed within the context of the application. Users should upgrade to Trix editor version 2.1.1 or later, which incorporates proper sanitization of input from copied content.
- Record
CVE-2024-34341- CVSS 3.1
- 5.4 Medium
CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:L/I:L/A:N - Weakness
- CWE-79
- Updated
- 2026-11-02
EUVDEUVD-2024-1747
5.4
Trix is a rich text editor. The Trix editor, versions prior to 2.1.1, is vulnerable to arbitrary code execution when copying and pasting content from the web or other documents with markup into the editor. The vulnerability stems from improper sanitization of pasted content, allowing an attacker to embed malicious scripts which are executed within the context of the application. Users should upgrade to Trix editor version 2.1.1 or later, which incorporates proper sanitization of input from copied content.
- Record
EUVD-2024-1747- CVSS 3.1
- 5.4 Medium
CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:L/I:L/A:N - Updated
- 2026-11-03
GitHub AdvisoriesGHSA-qjqp-xr96-cj99
5.4
Trix Editor Arbitrary Code Execution Vulnerability
The Trix editor, versions prior to 2.1.1, is vulnerable to arbitrary code execution when copying and pasting content from the web or other documents with markup into the editor. The vulnerability stems from improper sanitization of pasted content, allowing an attacker to embed malicious scripts which are executed within the context of the application.
Vulnerable Versions:
- 1.x series up to and including 1.3.1
- 2.x series up to and including 2.1.0
Fixed Versions:
- v1.3.2
- v2.1.1
Vector:
- Bug 1: When copying content manipulated by a script, such as:
document.addEventListener('copy', function(e){
e.clipboardData.setData('text/html', '<div><noscript><div class="123</noscript>456<img src=1 onerror=alert(1)//"></div></noscript></div>');
e.preventDefault();
});
and pasting into the Trix editor, the script within the content is executed.
- Bug 2: Similar execution occurs with content structured as:
document.write(`copy<div data-trix-attachment="{"contentType":"text/html","content":"<img src=1 onerror=alert(101)>HELLO123"}"></div>me`);
Impact:
An attacker could exploit these vulnerabilities to execute arbitrary JavaScript code within the context of the user's session, potentially leading to unauthorized actions being performed or sensitive information being disclosed.
Remediation:
Update Recommendation: Users should upgrade to Trix editor version 2.1.1 or later, which incorporates proper sanitization of input from copied content.
CSP Enhancement: Additionally, enhancing the Content Security Policy (CSP) to disallow inline scripts can significantly mitigate the risk of such vulnerabilities. Set CSP policies such as script-src 'self' to ensure that only scripts hosted on the same origin are executed, and explicitly prohibit inline scripts using script-src-elem.
References:
- https://github.com/basecamp/trix/releases/tag/v2.1.1
- https://github.com/basecamp/trix/pull/1147
- https://github.com/basecamp/trix/pull/1149
- https://github.com/basecamp/trix/pull/1153
Credit: These issues were reported by security researchers loknop and pinpie.
- Record
GHSA-qjqp-xr96-cj99- CVSS 3.1
- 5.4 Medium
CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:L/I:L/A:N - Weakness
- CWE-79
- Updated
- 2026-11-02
NVD
5.4
Trix is a rich text editor. The Trix editor, versions prior to 2.1.1, is vulnerable to arbitrary code execution when copying and pasting content from the web or other documents with markup into the editor. The vulnerability stems from improper sanitization of pasted content, allowing an attacker to embed malicious scripts which are executed within the context of the application. Users should upgrade to Trix editor version 2.1.1 or later, which incorporates proper sanitization of input from copied content.
- Record
CVE-2024-34341- CVSS 3.1
- 5.4 Medium
CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:L/I:L/A:N - Weakness
- CWE-79
- Updated
- 2026-11-02
OSV
5.4
The Trix Editor Contains an Arbitrary Code Execution Vulnerability
Trix is a rich text editor. The Trix editor, versions prior to 2.1.1, is vulnerable to arbitrary code execution when copying and pasting content from the web or other documents with markup into the editor. The vulnerability stems from improper sanitization of pasted content, allowing an attacker to embed malicious scripts which are executed within the context of the application. Users should upgrade to Trix editor version 2.1.1 or later, which incorporates proper sanitization of input from copied content.
- Record
CVE-2024-34341- CVSS 3.1
- 5.4 Medium
CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:L/I:L/A:N - Weakness
- CWE-79
- Updated
- 2026-11-02
OSVGHSA-qjqp-xr96-cj99
5.4
Trix Editor Arbitrary Code Execution Vulnerability
The Trix editor, versions prior to 2.1.1, is vulnerable to arbitrary code execution when copying and pasting content from the web or other documents with markup into the editor. The vulnerability stems from improper sanitization of pasted content, allowing an attacker to embed malicious scripts which are executed within the context of the application.
Vulnerable Versions:
- 1.x series up to and including 1.3.1
- 2.x series up to and including 2.1.0
Fixed Versions:
- v1.3.2
- v2.1.1
Vector:
- Bug 1: When copying content manipulated by a script, such as:
document.addEventListener('copy', function(e){
e.clipboardData.setData('text/html', '<div><noscript><div class="123</noscript>456<img src=1 onerror=alert(1)//"></div></noscript></div>');
e.preventDefault();
});
and pasting into the Trix editor, the script within the content is executed.
- Bug 2: Similar execution occurs with content structured as:
document.write(`copy<div data-trix-attachment="{"contentType":"text/html","content":"<img src=1 onerror=alert(101)>HELLO123"}"></div>me`);
Impact:
An attacker could exploit these vulnerabilities to execute arbitrary JavaScript code within the context of the user's session, potentially leading to unauthorized actions being performed or sensitive information being disclosed.
Remediation:
Update Recommendation: Users should upgrade to Trix editor version 2.1.1 or later, which incorporates proper sanitization of input from copied content.
CSP Enhancement: Additionally, enhancing the Content Security Policy (CSP) to disallow inline scripts can significantly mitigate the risk of such vulnerabilities. Set CSP policies such as script-src 'self' to ensure that only scripts hosted on the same origin are executed, and explicitly prohibit inline scripts using script-src-elem.
References:
- https://github.com/basecamp/trix/releases/tag/v2.1.1
- https://github.com/basecamp/trix/pull/1147
- https://github.com/basecamp/trix/pull/1149
- https://github.com/basecamp/trix/pull/1153
Credit: These issues were reported by security researchers loknop and pinpie.
- Record
GHSA-qjqp-xr96-cj99- CVSS 3.1
- 5.4 Medium
CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:L/I:L/A:N - Weakness
- CWE-79
- Updated
- 2026-11-02
Show 4 moreShow less
OSVopenSUSE-SU-2024:14068-1 No score
ruby3.3-rubygem-actiontext-7.0-7.0.8.4-1.1 on GA media
These are all security issues fixed in the ruby3.3-rubygem-actiontext-7.0-7.0.8.4-1.1 package on the GA media of openSUSE Tumbleweed.
- Record
openSUSE-SU-2024:14068-1- Updated
- 2026-11-02
OSVopenSUSE-SU-2024:14074-1 No score
ruby3.3-rubygem-rails-7.0-7.0.8.4-1.1 on GA media
These are all security issues fixed in the ruby3.3-rubygem-rails-7.0-7.0.8.4-1.1 package on the GA media of openSUSE Tumbleweed.
- Record
openSUSE-SU-2024:14074-1- Updated
- 2026-11-02
OSVopenSUSE-SU-2025:15111-1 No score
ruby3.4-rubygem-actiontext-7.0-7.0.8.6-1.3 on GA media
These are all security issues fixed in the ruby3.4-rubygem-actiontext-7.0-7.0.8.6-1.3 package on the GA media of openSUSE Tumbleweed.
- Record
openSUSE-SU-2025:15111-1- Updated
- 2026-11-02
OSVopenSUSE-SU-2025:15124-1 No score
ruby3.4-rubygem-rails-7.0-7.0.8.6-1.3 on GA media
These are all security issues fixed in the ruby3.4-rubygem-rails-7.0-7.0.8.6-1.3 package on the GA media of openSUSE Tumbleweed.
- Record
openSUSE-SU-2025:15124-1- Updated
- 2026-11-02
Affected products
Affected packages
| Package | Affected | Fixed |
|---|---|---|
trixnpm |
2.0.0 up to 2.1.1 | 2.1.1 |
trixnpm |
0.9.0 up to 1.3.2 | 1.3.2 |
actiontextRubyGems |
7.0.0.alpha1 up to 7.0.8.3 | 7.0.8.3 |
actiontextRubyGems |
7.1.0.beta1 up to 7.1.3.3 | 7.1.3.3 |
actiontextRubyGems |
7.0.0.alpha1 up to 7.0.8.3, plus listed versions 7.0.07.0.0.alpha27.0.0.rc17.0.0.rc27.0.0.rc3 Show 21 moreShow less7.0.17.0.27.0.2.17.0.2.27.0.2.37.0.2.47.0.37.0.3.17.0.47.0.4.17.0.4.27.0.4.37.0.57.0.5.17.0.67.0.77.0.7.17.0.7.27.0.87.0.8.17.0.8.2 |
7.0.8.3 |
actiontextRubyGems |
7.1.0.beta1 up to 7.1.3.3, plus listed versions 7.1.07.1.0.rc17.1.0.rc27.1.17.1.27.1.37.1.3.17.1.3.2 |
7.1.3.3 |
rubygem-actiontext-7.0openSUSE:Tumbleweed |
before 7.0.8.4-1.1 | 7.0.8.4-1.1 |
rubygem-rails-7.0openSUSE:Tumbleweed From an advisory covering 4 CVEs |
before 7.0.8.4-1.1 | 7.0.8.4-1.1 |
rubygem-actiontext-7.0openSUSE:Tumbleweed From an advisory covering 2 CVEs |
before 7.0.8.6-1.3 | 7.0.8.6-1.3 |
rubygem-rails-7.0openSUSE:Tumbleweed From an advisory covering 8 CVEs |
before 7.0.8.6-1.3 | 7.0.8.6-1.3 |
History
| Recorded | Changed | Sources |
|---|---|---|
| affected, facts | ||
| aliases, published | EUVD | |
| first indexed | CVE List, GitHub Advisories, NVD, OSV |
Dates are when Every CVE recorded each change. Upstream dates may differ.
In short
CVE-2024-34341 is a medium vulnerability (CVSS 5.4) in Basecamp Trix, published May 7, 2024. No source lists public exploit code. EPSS puts the chance of exploitation in the next 30 days at 0.78%, the 56th percentile. Fixed in trix 2.1.1.
References
github.com/basecamp/trix/security/advisories/GHSA-qjqp-xr96-cj99
github.com/basecamp/trix/pull/1147
github.com/basecamp/trix/pull/1149
github.com/basecamp/trix/commit/1a5c68a14d48421fc368e30026f4a7918028b7ad
github.com/basecamp/trix/commit/841ff19b53f349915100bca8fcb488214ff93554
github.com/basecamp/trix/releases/tag/v2.1.1
Show 21 moreShow less
nvd.nist.gov/vuln/detail/CVE-2024-34341
github.com/rails/rails/commit/07e6c88cc4defe6f6b8d28e79eb13a518e15b14c
github.com/rails/rails/commit/260cb392fc1ee91d0b749cff08d1c8d54b230bd3
github.com/rails/rails/commit/73fac32511eefdd45d8f00fecc2b8cc5408ea6d5
discuss.rubyonrails.org/t/xss-vulnerabilities-in-trix-editor/85803
github.com/rubysec/ruby-advisory-db/blob/master/gems/actiontext/CVE-2024-34341.yml
rubyonrails.org/2024/5/17/Rails-Versions-7-0-8-2-and-7-1-3-3-have-been-released
rubyonrails.org/2024/5/17/Rails-Versions-7-0-8-3-has-been-released
github.com/advisories/GHSA-qjqp-xr96-cj99
github.com/CVEProject/cvelistV5/tree/main/cves/2024/34xxx/CVE-2024-34341.json
github.com/basecamp/trix
suse.com/security/cve/CVE-2024-34341
suse.com/security/cve/CVE-2023-38037
suse.com/security/cve/CVE-2024-26143
suse.com/security/cve/CVE-2024-28103
lists.opensuse.org/archives/list/[email protected]/thread/XJHTNJXYCEBS7N5NPJTMRZTDIN52UBE4
suse.com/security/cve/CVE-2024-47888
lists.opensuse.org/archives/list/[email protected]/thread/3C5WPU2RXUSPKAI3EANLIGCY34ZDBZ4Y
suse.com/security/cve/CVE-2024-41128
suse.com/security/cve/CVE-2024-47887
suse.com/security/cve/CVE-2024-47889