Search for packages
| purl | pkg:npm/trix@2.0.2 |
| Vulnerability | Summary | Fixed by |
|---|---|---|
|
VCID-7qg1-2vaz-aqdu
Aliases: CVE-2025-21610 GHSA-j386-3444-qgwg |
Trix allows Cross-site Scripting via `javascript:` url in a link The Trix editor, versions prior to 2.1.11, is vulnerable to XSS when pasting malicious code in the link field. ### Impact An attacker could trick the user to copy&paste a malicious `javascript:` URL as a link that would execute arbitrary JavaScript code within the context of the user's session, potentially leading to unauthorized actions being performed or sensitive information being disclosed. See https://gist.github.com/th4s1s/3921fd9c3e324ad9a3e0d846166e3eb8 ### Patches Update Recommendation: Users should upgrade to Trix editor version 2.1.12 or later. ### Workarounds This is not really a workaround but something that should be considered in addition to upgrading to the patched version. If affected users can disallow browsers that don't support a Content Security Policy, then this would be an effective workaround for this and all XSS 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://gist.github.com/th4s1s/3921fd9c3e324ad9a3e0d846166e3eb8 ### Credits This vulnerability was reported by Hackerone researcher https://hackerone.com/lio346?type=user |
Affected by 3 other vulnerabilities. |
|
VCID-a8wt-m56f-6ufa
Aliases: CVE-2024-53847 GHSA-6vx4-v2jw-qwqh |
Trix editor subject to XSS vulnerabilities on copy & paste The Trix editor, in versions prior to 2.1.9 and 1.3.3, is vulnerable to XSS + mutation XSS attacks when pasting malicious code. ### Impact An attacker could trick a user to copy and paste malicious code that would execute arbitrary JavaScript code within the context of the user's session, potentially leading to unauthorized actions being performed or sensitive information being disclosed. ### Patches Update Recommendation: Users should upgrade to Trix editor version 2.1.9 or later, which uses [DOMPurify](https://github.com/cure53/DOMPurify) to sanitize the pasted content. If using Trix 1.x, upgrade to version 1.3.3 or later. ### Mitigations This is not really a workaround but something that should be considered in addition to upgrading to the patched version. If affected users can disallow browsers that don't support a Content Security Policy, then this would be an effective workaround for this and all XSS 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 The XSS vulnerability was reported by HackerOne researcher [hiumee](https://hackerone.com/hiumee?type=user). The mutation XSS vulnerability was reported by HackerOne researcher [sudi](https://hackerone.com/sudi?type=user). |
Affected by 4 other vulnerabilities. |
|
VCID-d266-4vk3-buc1
Aliases: CVE-2025-46812 GHSA-mcrw-746g-9q8h |
Trix vulnerable to Cross-site Scripting on copy & paste ### Impact The Trix editor, in versions prior to 2.1.15, is vulnerable to XSS attacks when pasting malicious code. An attacker could trick a user to copy and paste malicious code that would execute arbitrary JavaScript code within the context of the user's session, potentially leading to unauthorized actions being performed or sensitive information being disclosed. ### Patches Update Recommendation: Users should upgrade to Trix editor version 2.1.15 or later. ### References The XSS vulnerability was reported by HackerOne researcher [hiumee](https://hackerone.com/hiumee?type=user). |
Affected by 2 other vulnerabilities. |
|
VCID-k8n9-p3pp-8fh7
Aliases: GHSA-qmpg-8xg6-ph5q |
Trix has a Stored XSS vulnerability through serialized attributes ### Impact The Trix editor, in versions prior to 2.1.17, is vulnerable to XSS attacks when a `data-trix-serialized-attributes` attribute bypasses the DOMPurify sanitizer. An attacker could craft HTML containing a `data-trix-serialized-attributes` attribute with a malicious payload that, when the content is rendered, could execute arbitrary JavaScript code within the context of the user's session, potentially leading to unauthorized actions being performed or sensitive information being disclosed. ### Patches Update Recommendation: Users should upgrade to Trix editor version 2.1.17 or later. ### References The XSS vulnerability was responsibly reported by Hackerone researcher [newbiefromcoma](https://hackerone.com/newbiefromcoma). |
Affected by 0 other vulnerabilities. |
|
VCID-q1s4-ash2-5udy
Aliases: GHSA-g9jg-w8vm-g96v |
Trix has a stored XSS vulnerability through its attachment attribute The Trix editor, in versions prior to 2.1.16, is vulnerable to XSS attacks through attachment payloads. An attacker could inject malicious code into a data-trix-attachment attribute that, when rendered as HTML and clicked on, could execute arbitrary JavaScript code within the context of the user's session, potentially leading to unauthorized actions being performed or sensitive information being disclosed. |
Affected by 1 other vulnerability. |
|
VCID-t94c-csrx-ekby
Aliases: CVE-2024-43368 GHSA-qm2q-9f3q-2vcv |
Trix has a cross-site Scripting vulnerability on copy & paste The Trix editor, versions prior to 2.1.4, is vulnerable to XSS when pasting malicious code. This vulnerability is a bypass of the fix put in place for https://github.com/basecamp/trix/security/advisories/GHSA-qjqp-xr96-cj99. In https://github.com/basecamp/trix/pull/1149, we added sanitation for Trix attachments with a `text/html` content type. However, Trix only checks the content type on the paste event's `dataTransfer` object. As long as the `dataTransfer` has a content type of `text/html`, Trix parses its contents and creates an `Attachment` with them, even if the attachment itself doesn't have a `text/html` content type. Trix then uses the attachment content to set the attachment element's `innerHTML`. ### Impact An attacker could trick a user to copy and paste malicious code that would execute arbitrary JavaScript code within the context of the user's session, potentially leading to unauthorized actions being performed or sensitive information being disclosed. ### Patches **Update Recommendation:** Users should upgrade to Trix editor version 2.1.4 or later, which incorporates proper sanitization of input from copied content. ### Workarounds This is not really a workaround but something that should be considered in addition to upgrading to the patched version. If affected users can disallow browsers that don't support a Content Security Policy, then this would be an effective workaround for this and all XSS 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/pull/1156 * https://github.com/basecamp/trix/releases/tag/v2.1.4 * https://github.com/basecamp/trix/pull/1149 * https://github.com/basecamp/trix/security/advisories/GHSA-qjqp-xr96-cj99 * [MDN docs for `DataTransfer`](https://developer.mozilla.org/en-US/docs/Web/API/DataTransfer) ### Credits This vulnerability was reported by HackerOne researcher [thwin_htet](https://hackerone.com/thwin_htet?type=user). |
Affected by 5 other vulnerabilities. |
|
VCID-zg1n-xs8e-w3hg
Aliases: CVE-2024-34341 GHSA-qjqp-xr96-cj99 |
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: ```js 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: ```js 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](https://hackerone.com/loknop) and [pinpie](https://hackerone.com/pinpie). |
Affected by 6 other vulnerabilities. |
| Vulnerability | Summary | Aliases |
|---|---|---|
| This package is not known to fix vulnerabilities. | ||