GHSA-g9jg-w8vm-g96v: Trix Cross-Site Scripting Vulnerability
MODERATEGHSA-g9jg-w8vm-g96v 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 trix has a stored xss vulnerability through its attachment attribute. Remediation is available by upgrading affected packages to version 2.1.16.
GHSA-g9jg-w8vm-g96v 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 GHSA-g9jg-w8vm-g96v
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.16
Upgrade action_text-trix to 2.1.16
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 GHSA-g9jg-w8vm-g96v, 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.16), 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
GHSA-g9jg-w8vm-g96v Affected Trix Versions
2 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
trix
|
npm |
< 2.1.16
|
2.1.16
|
|
action_text-trix
|
RubyGems |
< 2.1.16
|
2.1.16
|
References
Frequently Asked Questions
What is GHSA-g9jg-w8vm-g96v?
Which Trix versions are affected?
What version fixes GHSA-g9jg-w8vm-g96v?
Is trix affected?
Is action_text-trix affected?
What is the CVSS score of GHSA-g9jg-w8vm-g96v?
What CWE is associated with GHSA-g9jg-w8vm-g96v?
How can I check npm dependencies for GHSA-g9jg-w8vm-g96v?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-g9jg-w8vm-g96v",
"modified" : "2026-01-08T21:34:41Z",
"published" : "2025-12-31T22:07:25Z",
"aliases" : [ ],
"summary" : "Trix has a stored XSS vulnerability through its attachment attribute",
"details" : "### Impact\nThe Trix editor, in versions prior to 2.1.16, is vulnerable to XSS attacks through attachment payloads.\n\nAn 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.\n\n### Patches\nUpdate Recommendation: Users should upgrade to Trix editor version 2.1.16 or later.\n\n### Resources\nThe XSS vulnerability was reported by HackerOne researcher [michaelcheers](https://hackerone.com/michaelcheers?type=user).",
"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.16"
} ]
} ]
}, {
"package" : {
"ecosystem" : "RubyGems",
"name" : "action_text-trix"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "2.1.16"
} ]
} ]
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://github.com/basecamp/trix/security/advisories/GHSA-g9jg-w8vm-g96v"
}, {
"type" : "WEB",
"url" : "https://github.com/basecamp/trix/commit/73c20cf03ab2b56c0ef9c9b1aaf63f2de44f4010"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/basecamp/trix"
}, {
"type" : "WEB",
"url" : "https://github.com/basecamp/trix/releases/tag/v2.1.16"
}, {
"type" : "WEB",
"url" : "https://github.com/rubysec/ruby-advisory-db/blob/master/gems/action_text-trix/GHSA-g9jg-w8vm-g96v.yml"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-79" ],
"severity" : "MODERATE",
"github_reviewed" : true,
"github_reviewed_at" : "2025-12-31T22:07:25Z",
"nvd_published_at" : null
}
}