Skip to content
Heist/ feed
Back to feed
Medium

Twig: XSS in profiler HtmlDumper via unescaped template and profile names

Type: advisorySources: OSV

Twig is a template language for PHP. From 3.0.0 until 3.26.0, Twig\Profiler\Dumper\HtmlDumper writes Profile::getTemplate() and Profile::getName() into HTML output without escaping, allowing attacker-controlled template or profile names to inject arbitrary HTML when a browser renders the profiler dump. This issue is fixed in version 3.26.0.

Products
Not specified
Affected versions
Not specified
Fixed versions
Not specified
CVEs
CVE-2026-47730
Confirmed fixed CVEs
Not specified
Updated in this feed
3 Nov 2026, 01:23 UTC · Revision 1

Source evidence

Twig: XSS in profiler HtmlDumper via unescaped template and profile names

core-osv · Original source

Published 14 Jul 2026, 21:21 UTC

Twig is a template language for PHP. From 3.0.0 until 3.26.0, Twig\Profiler\Dumper\HtmlDumper writes Profile::getTemplate() and Profile::getName() into HTML output without escaping, allowing attacker-controlled template or profile names to inject arbitrary HTML when a browser renders the profiler dump. This issue is fixed in version 3.26.0.

osv:CVE-2026-47730
Complete source record
{
  "id": "35a4b33afd5fa5cdf4a27d080c4ee22689b555dccc315f8ed131afd498ef1ed8",
  "url": "https://osv.dev/vulnerability/CVE-2026-47730",
  "method": "structured",
  "payload": {
    "kind": "advisory",
    "title": "Twig: XSS in profiler HtmlDumper via unescaped template and profile names",
    "summary": "Twig is a template language for PHP. From 3.0.0 until 3.26.0, Twig\\Profiler\\Dumper\\HtmlDumper writes Profile::getTemplate() and Profile::getName() into HTML output without escaping, allowing attacker-controlled template or profile names to inject arbitrary HTML when a browser renders the profiler dump. This issue is fixed in version 3.26.0.",
    "evidence": "osv:CVE-2026-47730",
    "products": [],
    "severity": "medium",
    "structured": {
      "id": "CVE-2026-47730",
      "aliases": [
        "CVE-2026-47730",
        "GHSA-2g2g-8p8h-fgwm"
      ],
      "metrics": [
        {
          "type": "CVSS_V4",
          "score": "CVSS:4.0/AV:N/AC:L/AT:N/PR:L/UI:P/VC:N/VI:N/VA:N/SC:L/SI:L/SA:N"
        }
      ],
      "affected": [
        {
          "ranges": [
            {
              "repo": "https://github.com/twigphp/twig",
              "type": "GIT",
              "events": [
                {
                  "introduced": "9b58bb8ac7a41d72fbb5a7dc643e07923e5ccc26"
                },
                {
                  "fixed": "1fcae487b180d78e6351f4e0afa91f9eab96a2bc"
                },
                {
                  "fixed": "a5f6e8793e603ef34fa86aed2a72f9fbe0b43745"
                }
              ],
              "database_specific": {
                "extracted_events": [
                  {
                    "cpe": "cpe:2.3:a:symfony:twig:*:*:*:*:*:*:*:*",
                    "range": [
                      {
                        "introduced": "3.0.0"
                      },
                      {
                        "fixed": "3.26.0"
                      }
                    ],
                    "source": "CPE_RANGE"
                  },
                  {
                    "range": [
                      {
                        "fixed": "a5f6e8793e603ef34fa86aed2a72f9fbe0b43745"
                      }
                    ],
                    "source": "REFERENCES_COMMIT"
                  },
                  {
                    "range": [
                      {
                        "fixed": "1fcae487b180d78e6351f4e0afa91f9eab96a2bc"
                      }
                    ],
                    "source": "REFERENCES_TAG",
                    "original_tag": "v3.26.0"
                  }
                ]
              }
            }
          ],
          "versions": [
            "v3.25.0",
            "v3.24.0",
            "v3.23.0",
            "v3.22.2",
            "v3.22.1",
            "v3.22.0",
            "v3.21.1",
            "v3.21.0",
            "v3.20.0",
            "v3.19.0",
            "v3.18.0",
            "v3.17.1",
            "v3.17.0",
            "v3.16.0",
            "v3.15.0",
            "v3.14.0",
            "v3.11.0",
            "v3.13.0",
            "v3.12.0",
            "v3.10.3",
            "v3.10.2",
            "v3.10.1",
            "v3.10.0",
            "v3.9.3",
            "v3.9.2",
            "v3.9.1",
            "v3.9.0",
            "v3.8.0",
            "v3.7.1",
            "v3.7.0",
            "v3.6.1",
            "v3.6.0",
            "v3.5.1",
            "v3.5.0",
            "v3.4.3",
            "v3.4.2",
            "v3.4.1",
            "v3.4.0",
            "v3.3.10",
            "v3.3.9",
            "v3.3.8",
            "v3.3.7",
            "v3.3.6",
            "v3.3.5",
            "v3.3.4",
            "v3.3.3",
            "v3.3.2",
            "v3.3.1",
            "v3.3.0",
            "v3.2.1",
            "v3.1.1",
            "v3.1.0",
            "v3.0.5",
            "v3.0.4",
            "v3.0.3",
            "v3.0.2",
            "v3.0.1",
            "v3.0.0"
          ],
          "database_specific": {
            "source": "https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2026-47730.json"
          }
        }
      ],
      "modified": "2026-10-28T02:30:24.777631983Z",
      "provider": "osv",
      "references": [
        "https://github.com/twigphp/Twig/releases/tag/v3.26.0",
        "https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/47xxx/CVE-2026-47730.json",
        "https://github.com/twigphp/Twig/security/advisories/GHSA-2g2g-8p8h-fgwm",
        "https://nvd.nist.gov/vuln/detail/CVE-2026-47730",
        "https://github.com/twigphp/Twig/commit/a5f6e8793e603ef34fa86aed2a72f9fbe0b43745"
      ],
      "provider_metadata": {
        "cwe_ids": [
          "CWE-79"
        ],
        "cna_assigner": "GitHub_M",
        "osv_generated_from": "https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/47xxx/CVE-2026-47730.json"
      }
    },
    "related_cves": [
      {
        "value": "CVE-2026-47730",
        "evidence": "/id"
      }
    ],
    "security_relevant": true,
    "severity_evidence": "/severity/0/score"
  },
  "source_id": "core-osv",
  "document_id": 491570,
  "published_at": "2026-07-14T21:21:10.185+00:00"
}