Vulnerabilities in pkg:npm/trix
PACKAGECVE-2026-73428 is a MODERATE (CVSS 4.6) cross-site scripting vulnerability (CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')) affecting Trix libraries in the npm ecosystem. The issue involves stored xss via htmlparser attribute injection on paste. Remediation is available by upgrading affected packages to version 2.1.18.
pkg:npm/trix
Vulnerability advisories affecting package pkg:npm/trix. Select an advisory below to view technical details or fixes.
| Advisory ID | CVE / NVD | Severity | Summary |
|---|---|---|---|
| GHSA-53g2-mvcc-q9x3 | CVE-2026-73428 | MODERATE | Trix: Stored XSS via HTMLParser attribute injection on paste |
| GHSA-53p3-c7vp-4mcc | CVE-2026-73427 | LOW | Trix is vulnerable to XSS through JSON deserialization bypass in drag-and-drop (Level0InputController) |
| GHSA-qmpg-8xg6-ph5q | CVE-2026-73426 | MODERATE | Trix has a Stored XSS vulnerability through serialized attributes |
| GHSA-g9jg-w8vm-g96v | - | MODERATE | Trix has a stored XSS vulnerability through its attachment attribute |
| GHSA-mcrw-746g-9q8h | CVE-2025-46812 | LOW | Trix vulnerable to Cross-site Scripting on copy & paste |
| GHSA-j386-3444-qgwg | CVE-2025-21610 | MODERATE | Trix allows Cross-site Scripting via `javascript:` url in a link |
| GHSA-6vx4-v2jw-qwqh | CVE-2024-53847 | MODERATE | Trix editor subject to XSS vulnerabilities on copy & paste |
| GHSA-qm2q-9f3q-2vcv | CVE-2024-43368 | MODERATE | Trix has a cross-site Scripting vulnerability on copy & paste |
| GHSA-qjqp-xr96-cj99 | CVE-2024-34341 | MODERATE | Trix Editor Arbitrary Code Execution Vulnerability |
CVE-2026-73428 at a Glance
Security Impact
CVSS: 4.6
The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:U/C:L/I:L/A:N).
How to Fix CVE-2026-73428
To remediate this vulnerability, upgrade all affected Trix dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.
npm install trix@2.1.18
Upgrade action_text-trix to 2.1.18
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
npm ls trix
How to Check if You Are Affected
To determine whether your Node.js application is affected by CVE-2026-73428, inspect your project dependencies using npm:
npm ls trix
Analyze the terminal output to locate any version of Trix in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 2.1.18), your application is affected.
Note: The npm ls trix command inspects dependencies declared in your package.json and lockfile; it does not perform automated runtime dynamic scanning.
Technical Details
Vulnerability Mechanism & Technical Analysis
This vulnerability is classified under CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting'), where the product does not neutralize or incorrectly neutralizes user-controllable input before it is placed in output that is used as a web page that is served to other users. In Trix, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.
Source Advisory Statement
CVE-2026-73428 Affected Trix Versions
2 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
trix
|
npm |
< 2.1.18
|
2.1.18
|
|
action_text-trix
|
RubyGems |
< 2.1.18
|
2.1.18
|
References
Frequently Asked Questions
What is CVE-2026-73428?
Which Trix versions are affected?
What version fixes CVE-2026-73428?
Is trix affected?
Is action_text-trix affected?
What is the CVSS score of CVE-2026-73428?
What CWE is associated with CVE-2026-73428?
How can I check npm dependencies for CVE-2026-73428?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-53g2-mvcc-q9x3",
"modified" : "2026-08-12T20:52:01Z",
"published" : "2026-07-24T16:18:01Z",
"aliases" : [ "CVE-2026-73428" ],
"summary" : "Trix: Stored XSS via HTMLParser attribute injection on paste",
"details" : "### Impact\n\nThe Trix editor, in versions prior to 2.1.18, is vulnerable to XSS when crafted HTML is pasted into the editor. The `HTMLParser` processed a mock attachment, a `<span>` carrying an empty `data-trix-attachment=\"{}\"`. The empty attachment object caused the element to bypass attachment handling, so its `data-trix-attributes` were applied to a plain string piece. The pre-2.1.18 `StringPiece.fromJSON` accepted the `href` without validation, so an attacker-supplied `javascript:` URI was carried into the document model and emitted verbatim into the serialized HTML, executing when the content was rendered and clicked.\n\nThis is a stored XSS in any application that accepts untrusted rich text through Trix and renders the serialized output to other users. Applications that apply server-side HTML sanitization, such as the Rails built-in sanitizer, are additionally protected because the payload is neutralized on save.\n\nThis vulnerability shares its fix with GHSA-53p3-c7vp-4mcc. Both are resolved by the `StringPiece.fromJSON` sanitization added in 2.1.18. This advisory covers the paste and HTMLParser entry vector, while GHSA-53p3-c7vp-4mcc covers the drag-and-drop path through the fallback Level0InputController.\n\n### Patches\n\nUsers should upgrade to Trix editor version 2.1.18 or later.\n\n### References\n\nThe vulnerability was responsibly reported by HackerOne researcher [newbiefromcoma](https://hackerone.com/newbiefromcoma).",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:U/C:L/I:L/A:N"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "npm",
"name" : "trix"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "2.1.18"
} ]
} ]
}, {
"package" : {
"ecosystem" : "RubyGems",
"name" : "action_text-trix"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "2.1.18"
} ]
} ]
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://github.com/basecamp/trix/security/advisories/GHSA-53g2-mvcc-q9x3"
}, {
"type" : "WEB",
"url" : "https://github.com/basecamp/trix/commit/9c0a993d9fc2ffe9d56b013b030bc238f9c0557c"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/basecamp/trix"
}, {
"type" : "WEB",
"url" : "https://github.com/basecamp/trix/releases/tag/v2.1.18"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-79" ],
"severity" : "MODERATE",
"github_reviewed" : true,
"github_reviewed_at" : "2026-07-24T16:18:01Z",
"nvd_published_at" : null
}
}