Skip to content
Heist/ feed
Back to feed
Medium

Trix has a Cross-Site Scripting (XSS) vulnerability on copy & paste

Type: advisorySources: OSV

The Trix editor, versions prior to 2.1.4, is vulnerable to XSS when pasting malicious code. This vulnerability is a bypass of the fix put in place for GHSA-qjqp-xr96-cj99. In pull request 1149, sanitation was added for Trix attachments with a `text/html` content type. However, Trix only checks the content type on the paste event's `dataTransfer` object. As long as the `dataTransfer` has a content type of `text/html`, Trix parses its contents and creates an `Attachment` with them, even if the attachment itself doesn't have a `text/html` content type. Trix then uses the attachment content to set the attachment element's `innerHTML`. An attacker could trick a user to copy and paste malicious code 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. This vulnerability was fixed in version 2.1.4.

Products
Not specified
Affected versions
Not specified
Fixed versions
Not specified
CVEs
CVE-2024-43368
Confirmed fixed CVEs
Not specified
Updated in this feed
4 Nov 2026, 03:09 UTC · Revision 1

Source evidence

Trix has a Cross-Site Scripting (XSS) vulnerability on copy & paste

core-osv · Original source

Published 14 Aug 2024, 21:12 UTC

The Trix editor, versions prior to 2.1.4, is vulnerable to XSS when pasting malicious code. This vulnerability is a bypass of the fix put in place for GHSA-qjqp-xr96-cj99. In pull request 1149, sanitation was added for Trix attachments with a `text/html` content type. However, Trix only checks the content type on the paste event's `dataTransfer` object. As long as the `dataTransfer` has a content type of `text/html`, Trix parses its contents and creates an `Attachment` with them, even if the attachment itself doesn't have a `text/html` content type. Trix then uses the attachment content to set the attachment element's `innerHTML`. An attacker could trick a user to copy and paste malicious code 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. This vulnerability was fixed in version 2.1.4.

osv:CVE-2024-43368
Complete source record
{
  "id": "d3e4259a445cb63fa5b2e3d6eb22c6b8dc533c5b8ba4acdceaf98a89298042d9",
  "url": "https://osv.dev/vulnerability/CVE-2024-43368",
  "method": "structured",
  "payload": {
    "kind": "advisory",
    "title": "Trix has a Cross-Site Scripting (XSS) vulnerability on copy & paste",
    "summary": "The Trix editor, versions prior to 2.1.4, is vulnerable to XSS when pasting malicious code. This vulnerability is a bypass of the fix put in place for GHSA-qjqp-xr96-cj99. In pull request 1149, sanitation was added for Trix attachments with a `text/html` content type. However, Trix only checks the content type on the paste event's `dataTransfer` object. As long as the `dataTransfer` has a content type of `text/html`, Trix parses its contents and creates an `Attachment` with them, even if the attachment itself doesn't have a `text/html` content type. Trix then uses the attachment content to set the attachment element's `innerHTML`. An attacker could trick a user to copy and paste malicious code 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. This vulnerability was fixed in version 2.1.4.",
    "evidence": "osv:CVE-2024-43368",
    "products": [],
    "severity": "medium",
    "structured": {
      "id": "CVE-2024-43368",
      "aliases": [
        "CVE-2024-43368",
        "GHSA-qm2q-9f3q-2vcv"
      ],
      "metrics": [
        {
          "type": "CVSS_V3",
          "score": "CVSS:3.1/AV:N/AC:L/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": "9579e33ae8542ad67b5c072f38eaf04ab8c5492f"
                },
                {
                  "fixed": "7656f578af0d03141a72a9d27cb3692e6947dae6"
                }
              ],
              "database_specific": {
                "extracted_events": [
                  {
                    "range": [
                      {
                        "introduced": "0"
                      },
                      {
                        "fixed": "2.1.4"
                      }
                    ],
                    "source": "AFFECTED_FIELD",
                    "strategy": "StringRangeExpression"
                  },
                  {
                    "range": [
                      {
                        "fixed": "7656f578af0d03141a72a9d27cb3692e6947dae6"
                      }
                    ],
                    "source": "REFERENCES_COMMIT"
                  },
                  {
                    "range": [
                      {
                        "fixed": "9579e33ae8542ad67b5c072f38eaf04ab8c5492f"
                      }
                    ],
                    "source": "REFERENCES_TAG",
                    "original_tag": "v2.1.4"
                  }
                ]
              }
            }
          ],
          "versions": [
            "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-2024-43368.json"
          }
        }
      ],
      "modified": "2026-10-28T02:30:32.932144312Z",
      "provider": "osv",
      "references": [
        "https://github.com/basecamp/trix/releases/tag/v2.1.4",
        "https://github.com/CVEProject/cvelistV5/tree/main/cves/2024/43xxx/CVE-2024-43368.json",
        "https://github.com/basecamp/trix/security/advisories/GHSA-qjqp-xr96-cj99",
        "https://github.com/basecamp/trix/security/advisories/GHSA-qm2q-9f3q-2vcv",
        "https://nvd.nist.gov/vuln/detail/CVE-2024-43368",
        "https://github.com/basecamp/trix/commit/7656f578af0d03141a72a9d27cb3692e6947dae6",
        "https://github.com/basecamp/trix/pull/1149",
        "https://github.com/basecamp/trix/pull/1156"
      ],
      "provider_metadata": {
        "cwe_ids": [
          "CWE-79"
        ],
        "cna_assigner": "GitHub_M",
        "osv_generated_from": "https://github.com/CVEProject/cvelistV5/tree/main/cves/2024/43xxx/CVE-2024-43368.json"
      }
    },
    "related_cves": [
      {
        "value": "CVE-2024-43368",
        "evidence": "/id"
      }
    ],
    "security_relevant": true,
    "severity_evidence": "/severity/0/score"
  },
  "source_id": "core-osv",
  "document_id": 499942,
  "published_at": "2024-08-14T21:12:24.24+00:00"
}