# GHSA-g9jg-w8vm-g96v: Trix has a stored XSS vulnerability through its attachment attribute

> Attackers can inject malicious JavaScript via attachment attributes in the Trix editor, leading to arbitrary code execution in user sessions.

- **Severity:** Not scored
- **Exploited in the wild:** Not known
- **Login needed:** Any signed-in user
- **Attackable:** Over the internet
- **Victim action needed:** A user has to click or open something
- **Fix available:** Yes
- **Published:** 31 Dec 2025

## What is GHSA-g9jg-w8vm-g96v?

GHSA-g9jg-w8vm-g96v is a cross-site scripting vulnerability in action_text-trix, published on 31 Dec 2025. Any signed-in user can exploit it over the network, and only if a user opens a file or follows a link.

### Official description

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

## Which versions are affected by GHSA-g9jg-w8vm-g96v?

4 open source packages ship an affected version, including action_text-trix and trix.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `action_text-trix` | RubyGems | All versions | 2.1.16 |
| `action_text-trix` | RubyGems | All versions | 2.1.16 |
| `trix` | npm | All versions | 2.1.16 |
| `trix` | npm | All versions | 2.1.16 |

## How do I fix GHSA-g9jg-w8vm-g96v?

Upgrade action_text-trix to 2.1.16 or later.

## Is GHSA-g9jg-w8vm-g96v being exploited?

There is no known exploitation of GHSA-g9jg-w8vm-g96v in the wild and no public exploit code.

## Fix prompt for AI coding agents

```text
Check this codebase for GHSA-g9jg-w8vm-g96v and fix it if it is affected.

What it is: GHSA-g9jg-w8vm-g96v is a cross-site scripting vulnerability in action_text-trix, published on 31 Dec 2025. Any signed-in user can exploit it over the network, and only if a user opens a file or follows a link.
Exploitation: There is no known exploitation of GHSA-g9jg-w8vm-g96v in the wild and no public exploit code.

Affected packages and fixed versions:
- action_text-trix (RubyGems): affected all versions; fixed in 2.1.16
- action_text-trix (RubyGems): affected all versions; fixed in 2.1.16
- trix (npm): affected all versions; fixed in 2.1.16
- trix (npm): affected all versions; fixed in 2.1.16

Task:
1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.
2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.
3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.
4. Run the tests and summarise what changed and why.
5. If nothing in the project is affected, say so and change nothing.

Reference: https://insights.sbomify.com/GHSA-g9jg-w8vm-g96v/ (Markdown: https://insights.sbomify.com/GHSA-g9jg-w8vm-g96v/index.md)
```

## Sources

- OSV: https://osv.dev/vulnerability/GHSA-g9jg-w8vm-g96v

---
From sbomify Insights: https://insights.sbomify.com/GHSA-g9jg-w8vm-g96v/
Summaries are generated and may contain mistakes; the official description above is the record.
