Attack ChainAIDerived
Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain
-
AccessHost draggable element with crafted application/x-trix-document JSON payload
-
DeliverySocial engineer victim to drag content into Trix editor in WebView
-
ExploitLevel0InputController intercepts drop event and passes JSON to StringPiece.fromJSON
-
Executionjavascript: URI applied to anchor href without DOMPurify validation
-
PersistInjected link rendered in editor DOM
-
ImpactVictim clicks link, executing JavaScript in page context
Vulnerability Assessment
| Weakness |
CWE
OWASP Top 10:2025
A05:2025 - Injection
ASVS 5.0
V1 - Encoding and Sanitization Output encoding, context-aware escaping
MITRE ATT&CK
2 techniques across 2 tactics: Initial Access, Execution The technique list with ATT&CK links and the kill-chain view is part of the Basic plan and up. |
| Exploitation Conditions | Two specific conditions must simultaneously hold for exploitation to succeed. First, the Trix editor must be operating via the Level0InputController fallback - this occurs only in environments lacking Input Events Level 2 API support, primarily mobile embedded WebViews (e.g., Android WebView, iOS WKWebView in configurations that disable the API) and certain iframes; standard desktop Chrome, Firefox, and Safari are not affected because they use the modern InputController path. Second, the victim must actively drag and drop attacker-controlled content into the editor, requiring social engineering (e.g., luring the user to drag a crafted element from an attacker-controlled page or iframe). Applications deploying server-side HTML sanitization (such as Rails ActionText's default sanitizer) gain an additional mitigating layer that strips |
| Impact | Real-world risk is low, and the CVSS 4.0 score of 2.1 reflects this accurately. The vector CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:A/VC:N/VI:L/VA:N/SC:N/SI:N/SA:N encodes three hard constraints: AT:P (a specific environmental condition - Level0InputController fallback - must be present), UI:A (the victim must actively perform a drag-and-drop of attacker-controlled content), and limited impact (VI:L only; no confidentiality or availability loss). Applications using standard Rails ActionText receive server-side sanitization as an additional layer that neutralizes the payload on save, further reducing effective exposure. No EPSS score was present in the input data, so probabilistic exploitation likelihood cannot be quantified. The vulnerability is absent from CISA KEV, and no public exploit code has been identified. The combination of a non-default environment, mandatory social engineering, and readily available mitigations makes this a low-priority finding for most production deployments, though WebView-heavy mobile applications embedding Trix editors should treat it with higher urgency. |
| Exploit ScenarioDerived | An attacker hosts a web page containing a draggable element whose MIME type is |
Get an e-mail when this CVE is exploited, patched or re-scored. Free account.
Alert meAnalysisAIv1 – Aug 12, 2026
Cross-site scripting in Trix editor prior to 2.1.18 allows DOM injection via unsanitized javascript: URIs deserialized from attacker-controlled JSON payloads during drag-and-drop operations. The vulnerable path exists exclusively in environments using the Level0InputController fallback - such as embedded WebViews lacking Input Events Level 2 support - where StringPiece.fromJSON applied href attributes from application/x-trix-document JSON directly to anchor elements, bypassing the DOMPurify checks that protected the HTML serialization path. No public exploit or active exploitation (CISA KEV) has been identified; the CVSS 4.0 score of 2.1 accurately reflects the constrained exploitability.
RemediationAI
Upgrade to Trix version 2.1.18 or later, available for npm via npm install trix@2.1.18 and for RubyGems via updating the action_text-trix gem to >= 2.1.18; the tagged release is at https://github.com/basecamp/trix/releases/tag/v2.1.18. Where immediate upgrade is not feasible, two compensating controls apply: first, ensure server-side HTML sanitization is active - Rails ActionText's default sanitizer strips javascript: URIs on content save, neutralizing stored payloads at the cost of requiring a save action before the protection takes effect (unsaved in-memory XSS execution still occurs prior to save); second, restrict Trix deployments to environments with full Input Events Level 2 support, which prevents the Level0InputController from activating and eliminates the vulnerable code path entirely, though this may break editor functionality in legitimate WebView contexts.
Affected VersionsENISA
Affected Packages
Source: OSV (Open Source Vulnerabilities)
Affects your stack
Affects 2 packages in npm, rubygems, euvd
Checking this CVE against your own stacks and servers is part of the Basic plan and up.
Technical ContextAI · show details
Trix is a WYSIWYG rich text editor maintained by Basecamp, distributed as both an npm package (trix) and a RubyGems package (action_text-trix) tightly integrated with Rails ActionText. The vulnerability resides in src/trix/models/string_piece.js within the StringPiece.fromJSON deserialization method, which reconstructs editor document model objects from application/x-trix-document JSON. When content is dropped via drag-and-drop in environments falling back to Level0InputController - the legacy input path used in WebViews or iframes without the Input Events Level 2 API - the deserialized href attribute bypassed DOMPurify validation entirely, as DOMPurify was only applied on the HTML serialization path, not the JSON deserialization path. CWE-79 (Improper Neutralization of Input During Web Page Generation) describes this root cause: untrusted data entering a deserialization routine that feeds directly into DOM construction without URI scheme validation. The fix (commit 9c0a993) adds a DOMPurify.isValidAttribute('a', 'href', value) guard inside StringPiece.fromJSON, stripping any href that DOMPurify rejects, including javascript: in plain, mixed-case, and whitespace-padded forms as verified by the new test suite.
Know when Trix gets its next vulnerability
- Watch products and get an email when something new is published
- Check this CVE against your own stack and servers
- Exploit and PoC references, threat intelligence from 22 sources
No credit card · 7-day full trial
Severity by source
CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:A/VC:N/VI:L/VA:N/SC:N/SI:N/SA:N
AC:H reflects the required Level0InputController environment; UI:R for mandatory drag-and-drop; no confidentiality or availability impact; scope unchanged as XSS executes within the same page context.
Primary rating from Vendor (GitHub_M).
CVSS VectorVendor: GitHub_M
Lifecycle Timeline
1DescriptionCVE.org
Trix is a what-you-see-is-what-you-get rich text editor for everyday writing. Prior to 2.1.18, Trix is vulnerable to cross-site scripting when a crafted application/x-trix-document JSON payload is dropped into an editor using the fallback Level0InputController, such as an embedded WebView without Input Events Level 2 support. The StringPiece.fromJSON method trusts href attributes from the JSON payload without sanitization, allowing a draggable element containing a javascript: URI to bypass DOMPurify sanitization and inject executable JavaScript into the DOM. Exploitation requires the victim to drag and drop attacker-controlled content, and server-side HTML sanitization can neutralize the payload on save. This issue is fixed in version 2.1.18.
Threat Intelligence Overview
How this decision was reached
The engine reads each signal below and applies a fixed list of rules from top to bottom. The first rule that matches sets the recommended action – like a statement, every line is shown.
What every action level means
SSVC AssessmentENISA
Priority Score
Attack Technique
Cross-Site Scripting occurs when an application accepts untrusted data and sends it to a web browser without proper validation or encoding.
EUVD-2026-57622
NVD
CVE.org
EPSS
Vulnrichment
GitHub
VulDB
Exploit-DB