{"id":"CVE-2026-47730","aliases":["CLSA-2026-1793788688","CLSA-2026-1793789212","CLSA-2026-1793789309","CLSA-2026-1794214791","DEBIAN-CVE-2026-47730","EUVD-2026-44567","GHSA-2g2g-8p8h-fgwm","UBUNTU-CVE-2026-47730"],"status":"published","title":"Twig: XSS in profiler HtmlDumper via unescaped template and profile names","description":"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.","severity":{"version":"4.0","score":5.1,"vector":"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","level":"medium","assessor":"cna","from":"cve"},"epss":{"day":"2026-11-09","score":0.00295,"percentile":0.22312,"model":"v2026.06.15"},"facts":{"in_kev":false,"known_exploited":false,"public_exploit":false,"fix_available":true},"cwes":["CWE-79"],"published":"2026-06-05T21:46:26Z","modified":"2026-11-09T19:15:14Z","fixes":[{"ecosystem":"Packagist","package":"twig/twig","fixed_in":["3.26.0"],"sources":["ghsa","osv"]},{"ecosystem":"TuxCare:Packagist","package":"twig/twig","fixed_in":["v1.44.8-p3+tuxcare","v2.15.6-p3+tuxcare"],"sources":["osv"]},{"ecosystem":"Debian:12","package":"php-twig","fixed_in":["3.5.1-1+deb12u3"],"sources":["osv"]},{"ecosystem":"Debian:13","package":"php-twig","fixed_in":["3.27.0-0+deb13u1"],"sources":["osv"]},{"ecosystem":"Debian:14","package":"php-twig","fixed_in":["3.26.0-1"],"sources":["osv"]}],"affected":[{"source":"ghsa","ecosystem":"Packagist","package":"twig/twig","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"3.0.0"},{"fixed":"3.26.0"}]}]},{"source":"osv","ecosystem":"TuxCare:Packagist","package":"twig/twig","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"v1.44.8"},{"fixed":"v1.44.8-p3+tuxcare"}]}],"versions":["v1.44.8","v1.44.8-p1+tuxcare","v1.44.8-p2+tuxcare"]},{"source":"osv","ecosystem":"TuxCare:Packagist","package":"twig/twig","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"v2.15.6"},{"fixed":"v2.15.6-p3+tuxcare"}]}],"versions":["v2.15.6","v2.15.6-p1+tuxcare","v2.15.6-p2+tuxcare"]},{"source":"osv","ecosystem":"TuxCare:Packagist","package":"twig/twig","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"v2.16.1"},{"fixed":"v2.16.1-p3+tuxcare"}]}],"versions":["v2.16.1","v2.16.1-p1+tuxcare","v2.16.1-p2+tuxcare"],"bundled":2},{"source":"osv","ecosystem":"TuxCare:Packagist","package":"twig/twig","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"v3.19.0"},{"fixed":"v3.19.0-p1+tuxcare"}]}],"versions":["v3.19.0"],"bundled":10},{"source":"osv","ecosystem":"Debian:12","package":"php-twig","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"3.5.1-1+deb12u3"}]}],"versions":["3.5.1-1","3.5.1-1+deb12u1","3.5.1-1+deb12u2"]},{"source":"osv","ecosystem":"Debian:13","package":"php-twig","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"3.27.0-0+deb13u1"}]}],"versions":["3.20.0-2","3.21.1-1","3.21.1-2","3.21.1-3","3.22.0-1","3.22.0-2","3.22.1-1","3.22.1-2","3.22.1-3","3.22.2-1","3.22.2-2","3.23.0-1","3.23.0-2","3.24.0-1","3.26.0-0+deb13u1","3.26.0-1"]},{"source":"osv","ecosystem":"Debian:14","package":"php-twig","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"3.26.0-1"}]}],"versions":["3.20.0-2","3.21.1-1","3.21.1-2","3.21.1-3","3.22.0-1","3.22.0-2","3.22.1-1","3.22.1-2","3.22.1-3","3.22.2-1","3.22.2-2","3.23.0-1","3.23.0-2","3.24.0-1"]},{"source":"osv","ecosystem":"Packagist","package":"twig/twig","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"3.0.0"},{"fixed":"3.26.0"}]}],"versions":["v3.0.0","v3.0.1","v3.0.2","v3.0.3","v3.0.4","v3.0.5","v3.1.0","v3.1.1","v3.10.0","v3.10.1","v3.10.2","v3.10.3","v3.11.0","v3.11.1","v3.11.2","v3.11.3","v3.12.0","v3.13.0","v3.14.0","v3.14.1","v3.14.2","v3.15.0","v3.16.0","v3.17.0","v3.17.1","v3.18.0","v3.19.0","v3.2.1","v3.20.0","v3.21.0","v3.21.1","v3.22.0","v3.22.1","v3.22.2","v3.23.0","v3.24.0","v3.25.0","v3.3.0","v3.3.1","v3.3.10","v3.3.2","v3.3.3","v3.3.4","v3.3.5","v3.3.6","v3.3.7","v3.3.8","v3.3.9","v3.4.0","v3.4.1","v3.4.2","v3.4.3","v3.5.0","v3.5.1","v3.6.0","v3.6.1","v3.7.0","v3.7.1","v3.8.0","v3.9.0","v3.9.1","v3.9.2","v3.9.3"]},{"source":"osv","ecosystem":"Ubuntu:Pro:20.04:LTS","package":"php-twig","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"}]}],"versions":["2.11.3-2","2.12.1-1","2.12.2-1","2.12.3-1","2.12.5-1","2.12.5-1ubuntu0.1~esm1","2.12.5-1ubuntu0.1~esm2"]},{"source":"osv","ecosystem":"Ubuntu:Pro:22.04:LTS","package":"php-twig","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"}]}],"versions":["3.3.2-1ubuntu3","3.3.4-1","3.3.6-1","3.3.7-1","3.3.8-2ubuntu4","3.3.8-2ubuntu4+esm1","3.3.8-2ubuntu4+esm2"]},{"source":"osv","ecosystem":"Ubuntu:Pro:24.04:LTS","package":"php-twig","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"}]}],"versions":["3.7.0-1","3.7.1-1","3.8.0-2","3.8.0-2ubuntu0.1~esm1","3.8.0-2ubuntu1","3.8.0-2ubuntu1+esm1"]},{"source":"osv","ecosystem":"Ubuntu:25.10","package":"php-twig","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"}]}],"versions":["3.20.0-2ubuntu1"]},{"source":"osv","ecosystem":"Ubuntu:26.10","package":"php-twig","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"}]}],"versions":["3.23.0-2build7","3.27.1-1","3.28.0-1"]},{"source":"osv","ecosystem":"Ubuntu:Pro:26.04:LTS","package":"php-twig","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"}]}],"versions":["3.20.0-2ubuntu1","3.23.0-2build5","3.23.0-2build7","3.23.0-2ubuntu0.1~esm1"]}],"products":[{"vendor":"symfony","product":"twig"},{"vendor":"twigphp","product":"twig"}],"references":[{"url":"https://github.com/twigphp/Twig/security/advisories/GHSA-2g2g-8p8h-fgwm","tags":["x_refsource_CONFIRM","Vendor Advisory","advisory","web"]},{"url":"https://github.com/twigphp/Twig/commit/a5f6e8793e603ef34fa86aed2a72f9fbe0b43745","tags":["x_refsource_MISC","Patch","fix"]},{"url":"https://github.com/twigphp/Twig/releases/tag/v3.26.0","tags":["x_refsource_MISC","Release Notes","web"]},{"url":"https://github.com/FriendsOfPHP/security-advisories/blob/master/twig/twig/CVE-2026-47730.yaml","tags":["web"]},{"url":"https://symfony.com/cve-2026-47730","tags":["web"]},{"url":"https://github.com/advisories/GHSA-2g2g-8p8h-fgwm"},{"url":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/47xxx/CVE-2026-47730.json","tags":["advisory"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2026-47730","tags":["advisory"]},{"url":"https://security-tracker.debian.org/tracker/CVE-2026-47730","tags":["advisory"]},{"url":"https://github.com/twigphp/Twig","tags":["package"]},{"url":"https://ubuntu.com/security/CVE-2026-47730","tags":["report"]},{"url":"https://www.cve.org/CVERecord?id=CVE-2026-47730","tags":["report"]},{"url":"https://symfony.com/blog/cve-2026-47730-xss-in-profiler-htmldumper-via-unescaped-template-and-profile-names","tags":["report"]}],"sources":{"cve":[{"id":"CVE-2026-47730","title":"Twig: XSS in profiler HtmlDumper via unescaped template and profile names","description":"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.","status":"published","published":"2026-07-14T21:21:10.185Z","modified":"2026-07-21T14:45:11.407Z","cvss":[{"version":"4.0","score":5.1,"vector":"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","level":"medium","assessor":"cna"}],"cwes":["CWE-79"],"updated_at":"2026-11-02T13:36:29.327819Z"}],"euvd":[{"id":"EUVD-2026-44567","description":"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.","status":"published","published":"2026-07-14T21:21:10Z","modified":"2026-07-21T14:45:11Z","cvss":[{"version":"4.0","score":5.1,"vector":"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","level":"medium"}],"updated_at":"2026-11-02T18:19:47.436242Z"}],"ghsa":[{"id":"GHSA-2g2g-8p8h-fgwm","title":"Twig: XSS in profiler HtmlDumper via unescaped template and profile names","description":"### Description\n\n`Twig\\Profiler\\Dumper\\HtmlDumper` writes `Profile::getTemplate()` and `Profile::getName()` straight into its HTML output without escaping:\n\n```php\nprotected function formatTemplate(Profile $profile, $prefix): string\n{\n    return \\sprintf('%s└ \u003cspan style=\"background-color: %s\"\u003e%s\u003c/span\u003e', $prefix, self::$colors['template'], $profile-\u003egetTemplate());\n}\n```\n\nThe template name comes from the loader (the array key for `ArrayLoader`, a row id for a database-backed loader, etc.). When that name is attacker-controlled, the profiler dump emits arbitrary HTML, and any browser that renders it executes the injected markup. This is an output-encoding bug in profiler/debug tooling, not a sandbox escape.\n\n### Resolution\n\n`HtmlDumper` now runs both `Profile::getTemplate()` and `Profile::getName()` through `htmlspecialchars()` before inserting them into the HTML output.\n\n### Credits\n\nTwig would like to thank El Kharoubi Iosif for reporting the issue and Nicolas Grekas for fixing it.","status":"published","published":"2026-06-05T21:46:26Z","modified":"2026-06-05T21:47:33Z","cwes":["CWE-79"],"updated_at":"2026-11-02T14:40:17.745826Z"}],"nvd":[{"id":"CVE-2026-47730","description":"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.","status":"published","published":"2026-07-14T22:16:59.53Z","modified":"2026-10-24T22:10:00.21Z","cvss":[{"version":"4.0","score":5.1,"vector":"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/E:X/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X","level":"medium","assessor":"secondary"},{"version":"3.1","score":5.4,"vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:C/C:L/I:L/A:N","level":"medium","assessor":"primary"}],"cwes":["CWE-79"],"updated_at":"2026-11-02T14:12:29.879716Z"}],"osv":[{"id":"CVE-2026-47730","title":"Twig: XSS in profiler HtmlDumper via unescaped template and profile names","description":"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.","status":"published","published":"2026-07-14T21:21:10.185Z","modified":"2026-10-28T02:30:24.777631983Z","cvss":[{"version":"4.0","score":5.1,"vector":"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","level":"medium"}],"cwes":["CWE-79"],"updated_at":"2026-11-02T15:45:06.231145Z"},{"id":"DEBIAN-CVE-2026-47730","description":"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.","status":"published","published":"2026-07-14T22:16:59.53Z","modified":"2026-10-25T09:47:42.01763311Z","cvss":[{"version":"3.1","score":5.4,"vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:C/C:L/I:L/A:N","level":"medium"}],"updated_at":"2026-11-02T15:45:56.444225Z"},{"id":"UBUNTU-CVE-2026-47730","description":"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.","status":"published","published":"2026-07-14T22:16:00Z","modified":"2026-10-17T12:58:27.821307179Z","cvss":[{"version":"4.0","score":5.1,"vector":"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","level":"medium"},{"version":"3.1","score":5.4,"vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:C/C:L/I:L/A:N","level":"medium"}],"updated_at":"2026-11-02T16:56:33.391918Z"},{"id":"CLSA-2026-1793788688","title":"TuxCare security update for twig/twig (1 CVE)","description":"TuxCare rebuilt twig/twig to address 1 CVE. Fixed in v1.44.8-p3+tuxcare.","status":"published","published":"2026-11-04T11:38:09Z","modified":"2026-11-04T14:45:04.927310458Z","updated_at":"2026-11-04T15:03:54.132276Z"},{"id":"CLSA-2026-1793789212","title":"TuxCare security update for twig/twig (1 CVE)","description":"TuxCare rebuilt twig/twig to address 1 CVE. Fixed in v2.15.6-p3+tuxcare.","status":"published","published":"2026-11-04T11:46:53Z","modified":"2026-11-04T14:45:05.597469222Z","updated_at":"2026-11-04T15:03:54.132276Z"},{"id":"CLSA-2026-1793789309","title":"TuxCare security update for twig/twig (2 CVEs)","description":"TuxCare rebuilt twig/twig to address 2 CVEs. Fixed in v2.16.1-p3+tuxcare.","status":"published","published":"2026-11-04T11:48:30Z","modified":"2026-11-04T14:45:06.030035329Z","updated_at":"2026-11-04T15:03:54.132276Z"},{"id":"CLSA-2026-1794214791","title":"TuxCare security update for twig/twig (10 CVEs)","description":"TuxCare rebuilt twig/twig to address 10 CVEs. Fixed in v3.19.0-p1+tuxcare.","status":"published","published":"2026-11-09T09:59:52Z","modified":"2026-11-09T19:15:14.540306307Z","updated_at":"2026-11-09T19:38:09.278998Z"},{"id":"GHSA-2g2g-8p8h-fgwm","title":"Twig: XSS in profiler HtmlDumper via unescaped template and profile names","description":"### Description\n\n`Twig\\Profiler\\Dumper\\HtmlDumper` writes `Profile::getTemplate()` and `Profile::getName()` straight into its HTML output without escaping:\n\n```php\nprotected function formatTemplate(Profile $profile, $prefix): string\n{\n    return \\sprintf('%s└ \u003cspan style=\"background-color: %s\"\u003e%s\u003c/span\u003e', $prefix, self::$colors['template'], $profile-\u003egetTemplate());\n}\n```\n\nThe template name comes from the loader (the array key for `ArrayLoader`, a row id for a database-backed loader, etc.). When that name is attacker-controlled, the profiler dump emits arbitrary HTML, and any browser that renders it executes the injected markup. This is an output-encoding bug in profiler/debug tooling, not a sandbox escape.\n\n### Resolution\n\n`HtmlDumper` now runs both `Profile::getTemplate()` and `Profile::getName()` through `htmlspecialchars()` before inserting them into the HTML output.\n\n### Credits\n\nTwig would like to thank El Kharoubi Iosif for reporting the issue and Nicolas Grekas for fixing it.","status":"published","published":"2026-06-05T21:46:26Z","modified":"2026-09-10T03:51:07.469938305Z","cwes":["CWE-79"],"updated_at":"2026-11-02T15:46:34.338541Z"}]}}
