Trix allows Cross-site Scripting via `javascript:` url in a link
Trix is a what-you-see-is-what-you-get rich text editor for everyday writing. Versions prior to 2.1.12 are vulnerable to cross-site scripting when pasting malicious code in the link field. An attacker could trick the user to copy&paste a malicious `javascript:` URL as a link that would execute arbitrary JavaScript code within the context of the user's session, potentially leading to unauthorized actions being performed or sensitive information being disclosed. Users should upgrade to Trix editor version 2.1.12 or later to receive a patch. In addition to upgrading, affected users can disallow browsers that don't support a Content Security Policy (CSP) as a workaround for this and other cross-site scripting vulnerabilities. Set CSP policies such as script-src 'self' to ensure that only scripts hosted on the same origin are executed, and explicitly prohibit inline scripts using script-src-elem.
- Products
- Not specified
- Affected versions
- Not specified
- Fixed versions
- Not specified
- CVEs
- CVE-2025-21610
- Confirmed fixed CVEs
- Not specified
- Updated in this feed
- 3 Nov 2026, 10:53 UTC · Revision 1
Source evidence
Trix allows Cross-site Scripting via `javascript:` url in a link
core-osv · Original sourcePublished 3 Jan 2025, 16:29 UTC
Trix is a what-you-see-is-what-you-get rich text editor for everyday writing. Versions prior to 2.1.12 are vulnerable to cross-site scripting when pasting malicious code in the link field. An attacker could trick the user to copy&paste a malicious `javascript:` URL as a link that would execute arbitrary JavaScript code within the context of the user's session, potentially leading to unauthorized actions being performed or sensitive information being disclosed. Users should upgrade to Trix editor version 2.1.12 or later to receive a patch. In addition to upgrading, affected users can disallow browsers that don't support a Content Security Policy (CSP) as a workaround for this and other cross-site scripting vulnerabilities. Set CSP policies such as script-src 'self' to ensure that only scripts hosted on the same origin are executed, and explicitly prohibit inline scripts using script-src-elem.
osv:CVE-2025-21610
Complete source record
{
"id": "752139f9a5ef8ba2e427ddd2edc54dcd88d3fad2088d3d27bf1f5a6006975c92",
"url": "https://osv.dev/vulnerability/CVE-2025-21610",
"method": "structured",
"payload": {
"kind": "advisory",
"title": "Trix allows Cross-site Scripting via `javascript:` url in a link",
"summary": "Trix is a what-you-see-is-what-you-get rich text editor for everyday writing. Versions prior to 2.1.12 are vulnerable to cross-site scripting when pasting malicious code in the link field. An attacker could trick the user to copy&paste a malicious `javascript:` URL as a link that would execute arbitrary JavaScript code within the context of the user's session, potentially leading to unauthorized actions being performed or sensitive information being disclosed. Users should upgrade to Trix editor version 2.1.12 or later to receive a patch. In addition to upgrading, affected users can disallow browsers that don't support a Content Security Policy (CSP) as a workaround for this and other cross-site scripting vulnerabilities. Set CSP policies such as script-src 'self' to ensure that only scripts hosted on the same origin are executed, and explicitly prohibit inline scripts using script-src-elem.",
"evidence": "osv:CVE-2025-21610",
"products": [],
"severity": "medium",
"structured": {
"id": "CVE-2025-21610",
"aliases": [
"CVE-2025-21610",
"GHSA-j386-3444-qgwg"
],
"metrics": [
{
"type": "CVSS_V3",
"score": "CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:U/C:H/I:N/A:N"
}
],
"affected": [
{
"ranges": [
{
"repo": "https://github.com/basecamp/trix",
"type": "GIT",
"events": [
{
"introduced": "0"
},
{
"fixed": "7bf3e5aae233942a4f03d18c23d0bbd240277328"
},
{
"fixed": "180c8d337f18e1569cea6ef29b4d03ffff5b5faa"
},
{
"fixed": "c4f0d6f80654603932af6685694f694e96593b93"
}
],
"database_specific": {
"extracted_events": [
{
"range": [
{
"introduced": "0"
},
{
"fixed": "2.1.12"
}
],
"source": "AFFECTED_FIELD",
"strategy": "StringRangeExpression"
},
{
"range": [
{
"fixed": "180c8d337f18e1569cea6ef29b4d03ffff5b5faa"
}
],
"source": "REFERENCES_COMMIT"
},
{
"range": [
{
"fixed": "c4f0d6f80654603932af6685694f694e96593b93"
}
],
"source": "REFERENCES_COMMIT"
}
]
}
}
],
"versions": [
"v2.1.11",
"v2.1.10",
"v2.1.9",
"v2.1.8",
"v2.1.7",
"v2.1.6",
"v2.1.5",
"v2.1.4",
"2.1.3",
"v2.1.1",
"1.3.1",
"v2.1.0",
"v2.0.10",
"v2.0.9",
"v2.0.8",
"v2.0.7",
"v2.0.6",
"v2.0.5",
"v2.0.4",
"v2.0.3",
"v2.0.2",
"v2.0.1",
"1.3.0",
"1.2.4",
"1.2.3",
"1.2.2",
"1.2.1",
"1.2.0",
"1.1.1",
"1.1.0",
"1.0.0",
"0.12.1",
"0.12.0",
"0.11.4",
"0.11.3",
"0.11.2",
"0.11.1",
"0.11.0",
"0.10.2",
"0.10.1",
"0.10.0",
"0.9.10",
"0.9.9",
"0.9.8",
"0.9.7",
"0.9.6",
"0.9.5",
"0.9.4",
"0.9.3",
"0.9.2",
"0.9.1",
"0.9.0",
"0.8.0",
"0.5.0"
],
"database_specific": {
"source": "https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2025-21610.json"
}
}
],
"modified": "2026-10-28T02:30:28.108554831Z",
"provider": "osv",
"references": [
"https://gist.github.com/th4s1s/3921fd9c3e324ad9a3e0d846166e3eb8",
"https://github.com/CVEProject/cvelistV5/tree/main/cves/2025/21xxx/CVE-2025-21610.json",
"https://github.com/basecamp/trix/security/advisories/GHSA-j386-3444-qgwg",
"https://nvd.nist.gov/vuln/detail/CVE-2025-21610",
"https://github.com/basecamp/trix/commit/180c8d337f18e1569cea6ef29b4d03ffff5b5faa",
"https://github.com/basecamp/trix/commit/c4f0d6f80654603932af6685694f694e96593b93"
],
"provider_metadata": {
"cwe_ids": [
"CWE-79"
],
"cna_assigner": "GitHub_M",
"osv_generated_from": "https://github.com/CVEProject/cvelistV5/tree/main/cves/2025/21xxx/CVE-2025-21610.json"
}
},
"related_cves": [
{
"value": "CVE-2025-21610",
"evidence": "/id"
}
],
"security_relevant": true,
"severity_evidence": "/severity/0/score"
},
"source_id": "core-osv",
"document_id": 494730,
"published_at": "2025-01-03T16:29:54.939+00:00"
}