Your RSA-2048 keys break in 2030. Find every one of them before attackers do.
📦 npm💎 RubyGems

GHSA-53g2-mvcc-q9x3

MEDIUM

Trix: Stored XSS via HTMLParser attribute injection on paste

Published
Jul 24, 2026
Updated
Jul 24, 2026
Affected
2 pkgs
Patched
2 / 2
Exploits
None indexed

Blast Radius

2 pkgs affected
📦trix💎action_text-trix

Real-time download stats are indexed for npm and PyPI packages. This vulnerability affects npm, RubyGems packages — download data is not available via public APIs for these ecosystems.

Description

Impact

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

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

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

Patches

Users should upgrade to Trix editor version 2.1.18 or later.

References

The vulnerability was responsibly reported by HackerOne researcher newbiefromcoma.

Affected Packages

2 total 2 fixed
EcosystemPackageVulnerable rangeFix
📦npmtrixall versions2.1.18
💎RubyGemsaction_text-trixall versions2.1.18

Detection & mitigation playbook

Open-source dependency
  1. Detect

    Scan your dependency tree (package-lock.json, pnpm-lock.yaml, requirements.txt, go.sum, etc.) for trix. O3's reachability analysis confirms whether the vulnerable code path is actually invoked in your application, so you act on real exposure instead of every transitive match.

  2. Fix

    Update trix to 2.1.18 or later, then make sure no transitive (indirect) dependency still pins the vulnerable range — O3 confirms GHSA-53g2-mvcc-q9x3 is resolved across your whole dependency graph.

  3. Workarounds

    If you can't upgrade right away: gate or disable the affected feature, validate untrusted input at the boundary, and avoid passing attacker-controlled data into the vulnerable path. O3's runtime protection blocks exploitation in production as an interim safeguard until the upgrade lands.

  4. How O3 protects you

    O3 pinpoints whether GHSA-53g2-mvcc-q9x3 is reachable in your code and exactly where to fix it, then blocks exploitation in production at runtime until the patched version is deployed.

Tailored to GHSA-53g2-mvcc-q9x3. Runtime protection reduces exposure until a permanent patch is applied and verified — it complements patching, it doesn't replace it.

Frequently Asked Questions

### Impact The 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 cont
O3 Security · Impact-Aware SCA

Is GHSA-53g2-mvcc-q9x3 in your dependencies?

O3 detects GHSA-53g2-mvcc-q9x3 across npm, RubyGems dependencies and uses function-level reachability to confirm whether the vulnerable code path is actually reachable — not just present. No false positives.