CVE-2024-53847
JSON

5.1medium

Trix vulnerable to Cross-site Scripting on copy & paste

Severity
5.1medium CVSS:4.0 by GitHub_M
Exploit likelihood
0.46% (higher than 41% of CVEs; EPSS, by FIRST)
Published
Last changed
Assigned by
GitHub_M
Also known as
GHSA-6vx4-v2jw-qwqh

Description

The Trix rich text editor, prior to versions 2.1.9 and 1.3.3, is vulnerable to cross-site scripting (XSS) + mutation 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. Users should upgrade to Trix editor version 2.1.9 or 1.3.3, which uses DOMPurify to sanitize the pasted content.

Affected

Product or packageVersionsReported by
basecamp trix>= 2.0.0, < 2.1.9, >= 1.0.0, < 1.3.3CVE List
trix (npm)from 2.0.0 before 2.1.9, from 1.0.0 before 1.3.3GitHub Advisory Database

All scores

GitHub_M5.1medium CVSS:4.0CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:A/VC:N/VI:N/VA:N/SC:L/SI:L/SA:N
GitHubmedium CVSS:4.0CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:A/VC:N/VI:N/VA:N/SC:L/SI:L/SA:N

Classification

CWE-79

SSVC (CISA-ADP): exploitation none, automatable yes, technical impact partial.

What each source says

CVE List

The Trix rich text editor, prior to versions 2.1.9 and 1.3.3, is vulnerable to cross-site scripting (XSS) + mutation 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. Users should upgrade to Trix editor version 2.1.9 or 1.3.3, which uses DOMPurify to sanitize the pasted content.

GitHub Advisory Database

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 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. The mutation XSS vulnerability was reported by HackerOne researcher sudi.

NVD (es)

Trix rich text editor, anterior a las versiones 2.1.9 y 1.3.3, es vulnerable a ataques de Cross Site Scripting (XSS) + mutación XSS al pegar código malicioso. Un atacante podría engañar a un usuario para que copie y pegue código malicioso que ejecutaría código JavaScript arbitrario dentro del contexto de la sesión del usuario, lo que podría provocar que se realicen acciones no autorizadas o que se divulgue información confidencial. Los usuarios deben actualizar a la versión 2.1.9 o 1.3.3 del editor Trix, que utiliza DOMPurify para desinfectar el contenido pegado.

References

Sources

SourceRecordLicence
CVE ListCVE-2024-53847 changed 2024-12-10CVE Terms of Use
GitHub Advisory DatabaseGHSA-6vx4-v2jw-qwqh changed 2024-12-09CC-BY-4.0
NVDCVE-2024-53847 changed 2026-06-17Public domain