# CVE-2025-46812: Trix cross-site scripting on copy and paste

Source: https://junglewise.ai/threats/cve-2025-46812-trix-cross-site-scripting-on-copy-and-paste  
Publisher: Junglewise Threat Intelligence, https://junglewise.ai/threats  
Published: 2025-05-08. Updated: 2026-09-25  
License: CC BY 4.0 with a link back

CVE-2025-46812 · Severity: medium · CVSS 4 · Published 2025-05-08

Trix is a popular rich text editor used in web applications to let users format and compose content. Versions before 2.1.15 are vulnerable to cross-site scripting (XSS) when users paste malicious code—an attacker can trick a user into copying and pasting malicious content that executes arbitrary JavaScript in their browser session, potentially stealing data or performing unauthorized actions on the user's behalf.

Technologies: [trix (npm)](https://junglewise.ai/threats/technologies/trix). Vendors: [npm](https://junglewise.ai/threats/vendors/npm).

## Quick answers

**Is CVE-2025-46812 exploited in the wild?** No. Junglewise Threat Intelligence has no report of CVE-2025-46812 being exploited in the wild.

**How severe is CVE-2025-46812?** Medium severity, with a CVSS score of 4, published 8 May 2025.

**Which products and versions are affected?** trix (npm) SEMVER:introduced=0,fixed=2.1.15.

**Is there a fix for CVE-2025-46812?** Yes. trix (npm): upgrade to 2.1.15 or later. Junglewise finds every place you run it, drafts the upgrade and applies it once you approve.

**How is CVE-2025-46812 attacked?** It is attacked over the network, in a software library.

**Am I affected by CVE-2025-46812?** Check whether you run trix (npm) at an affected version. Junglewise does that check for you around the clock: connect your code, cloud and domains, and it matches new vulnerabilities like this one against what you actually run and tells you when one reaches you.

## How to fix

- trix (npm): upgrade to 2.1.15 or later

  ```sh
  npm install trix@2.1.15
  ```


## Technical details

Trix versions prior to 2.1.15 are vulnerable to stored or reflected XSS (CWE-79) when handling pasted content. The vulnerable component fails to properly sanitize or escape user-supplied HTML/JavaScript during paste operations. An attacker can craft malicious code and socially engineer a user into copying and pasting it into a Trix editor instance; the code then executes in the context of the user's session with their privileges. User interaction (the paste action) is required. The vulnerability has been patched in version 2.1.15 and later.

## Affected products

- Basecamp Trix < 2.1.15

## Identifiers

- CVE-2025-46812
- GHSA-mcrw-746g-9q8h

## Timeline

- 2025-05-08: disclosed
- 2025-05-08: patched: Trix 2.1.15 released

## References

- [https://github.com/basecamp/trix/security/advisories/GHSA-mcrw-746g-9q8h](https://github.com/basecamp/trix/security/advisories/GHSA-mcrw-746g-9q8h)

## Related threats

- [Basecamp Trix stored XSS via HTMLParser attribute injection on paste](https://junglewise.ai/threats/cve-2026-73428-basecamp-trix-stored-xss-via-htmlparser-attribute-injection-on)
- [Basecamp Trix XSS via JSON deserialization in drag-and-drop](https://junglewise.ai/threats/cve-2026-73427-basecamp-trix-xss-via-json-deserialization-in-drag-and-drop)
- [Basecamp Trix Stored XSS in serialized attributes](https://junglewise.ai/threats/cve-2026-73426-basecamp-trix-stored-xss-in-serialized-attributes)
- [Basecamp Trix stored XSS in attachment attribute](https://junglewise.ai/threats/basecamp-trix-stored-xss-in-attachment-attribute-56b2a3f2)
- [Basecamp Trix cross-site scripting via javascript: URL in link](https://junglewise.ai/threats/cve-2025-21610-basecamp-trix-cross-site-scripting-via-javascript-url-in-link)
