GHSA-g9jg-w8vm-g96v: Trix Cross-Site Scripting Vulnerability

MODERATE
CVSS 4.6
CWE-79
Published
Advisory Summary

GHSA-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

CVE Identifier N/A
GHSA Identifier GHSA-g9jg-w8vm-g96v
Severity MODERATE
CVSS v3.1 Base Score 4.6
CWE Classification CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')
Affected Product Trix
Package Ecosystem npm
Published Date
Last Updated

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).

Attack Vector Network (AV:N)
Attack Complexity Low (AC:L)
Privileges Required Low (PR:L)
User Interaction Required (UI:R)
Scope Unchanged (S:U)
Confidentiality Low (C:L)
Integrity Low (I:L)
Availability None (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.

trix fixed: 2.1.16
npm install trix@2.1.16
action_text-trix fixed: 2.1.16
Upgrade action_text-trix to 2.1.16
Verify Direct and Transitive Dependencies

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

### Impact 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. ### Patches Update Recommendation: Users should upgrade to Trix editor version 2.1.16 or later. ### Resources The XSS vulnerability was reported by HackerOne researcher [michaelcheers](https://hackerone.com/michaelcheers?type=user).

GHSA-g9jg-w8vm-g96v Affected Trix Versions

2 component(s)
Fixed Versions:
2.1.16
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?
GHSA-g9jg-w8vm-g96v is a security vulnerability in Trix involving Trix has a stored XSS vulnerability through its attachment attribute under CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting').
Which Trix versions are affected?
Affected versions include releases prior to 2.1.16 across affected packages: trix, action_text-trix.
What version fixes GHSA-g9jg-w8vm-g96v?
Upgrading to 2.1.16 (or the latest patched release for your respective branch) resolves the vulnerability.
Is trix affected?
Yes, trix is affected in releases prior to 2.1.16. Upgrade your dependency to 2.1.16 or later.
Is action_text-trix affected?
Yes, action_text-trix is affected in releases prior to 2.1.16. Upgrade your dependency to 2.1.16 or later.
What is the CVSS score of GHSA-g9jg-w8vm-g96v?
GHSA-g9jg-w8vm-g96v has a CVSS v3.1 base score of 4.6 (MODERATE) with vector string CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:U/C:L/I:L/A:N.
What CWE is associated with GHSA-g9jg-w8vm-g96v?
GHSA-g9jg-w8vm-g96v is classified under CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting') (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.).
How can I check npm dependencies for GHSA-g9jg-w8vm-g96v?
Run the dependency tree command: 'npm ls trix'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "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
  }
}