php-twig — security advisory
Twig is a template language for PHP. Prior to 3.26.0, Compiler::string() does not escape single quotes when a template name from a {% use %} tag is placed inside a PHP single-quoted string literal, allowing a crafted template name to terminate the string and inject arbitrary PHP expressions into the compiled cache file. This issue is fixed in version 3.26.0.
- Products
- php-twig
- Affected 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, 3.20.0-2ubuntu1, 3.23.0-2build5, 3.23.0-2build7, 3.23.0-2ubuntu0.1~esm1, 3.27.1-1, 3.28.0-1, 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, 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
- Fixed versions
- Not specified
- CVEs
- CVE-2026-46633
- Confirmed fixed CVEs
- Not specified
- Updated in this feed
- 31 Oct 2026, 02:17 UTC · Revision 1
Source evidence
Twig is a template language for PHP. Prior to 3.26.0, Compiler::string() does not escape single quotes when a template name from a {% use %} tag is placed inside a PHP single-quoted string literal, allowing a crafted template name to terminate the string and inject arbitrary PHP expressions into the compiled cache file. This issue is fixed in version 3.26.0.
osv:UBUNTU-CVE-2026-46633
php-twig
Fixed versions: Not specified
php-twig
Fixed versions: Not specified
php-twig
Fixed versions: Not specified
php-twig
Fixed versions: Not specified
php-twig
Fixed versions: Not specified
php-twig
Fixed versions: Not specified
Complete source record
{
"id": "866deffe0ffe1510ed522e4308e54b317e20acea2feb91ad2ca6f1ce40cf98d5",
"url": "https://osv.dev/vulnerability/UBUNTU-CVE-2026-46633",
"method": "structured",
"payload": {
"kind": "advisory",
"title": "UBUNTU-CVE-2026-46633",
"summary": "Twig is a template language for PHP. Prior to 3.26.0, Compiler::string() does not escape single quotes when a template name from a {% use %} tag is placed inside a PHP single-quoted string literal, allowing a crafted template name to terminate the string and inject arbitrary PHP expressions into the compiled cache file. This issue is fixed in version 3.26.0.",
"evidence": "osv:UBUNTU-CVE-2026-46633",
"products": [
{
"name": {
"value": "php-twig",
"evidence": "/affected/0/package/name"
},
"prerequisites": [],
"fixed_versions": [],
"affected_versions": [
{
"value": "2.11.3-2",
"evidence": "/affected/0/versions"
},
{
"value": "2.12.1-1",
"evidence": "/affected/0/versions"
},
{
"value": "2.12.2-1",
"evidence": "/affected/0/versions"
},
{
"value": "2.12.3-1",
"evidence": "/affected/0/versions"
},
{
"value": "2.12.5-1",
"evidence": "/affected/0/versions"
},
{
"value": "2.12.5-1ubuntu0.1~esm1",
"evidence": "/affected/0/versions"
},
{
"value": "2.12.5-1ubuntu0.1~esm2",
"evidence": "/affected/0/versions"
}
]
},
{
"name": {
"value": "php-twig",
"evidence": "/affected/1/package/name"
},
"prerequisites": [],
"fixed_versions": [],
"affected_versions": [
{
"value": "3.3.2-1ubuntu3",
"evidence": "/affected/1/versions"
},
{
"value": "3.3.4-1",
"evidence": "/affected/1/versions"
},
{
"value": "3.3.6-1",
"evidence": "/affected/1/versions"
},
{
"value": "3.3.7-1",
"evidence": "/affected/1/versions"
},
{
"value": "3.3.8-2ubuntu4",
"evidence": "/affected/1/versions"
},
{
"value": "3.3.8-2ubuntu4+esm1",
"evidence": "/affected/1/versions"
},
{
"value": "3.3.8-2ubuntu4+esm2",
"evidence": "/affected/1/versions"
}
]
},
{
"name": {
"value": "php-twig",
"evidence": "/affected/2/package/name"
},
"prerequisites": [],
"fixed_versions": [],
"affected_versions": [
{
"value": "3.7.0-1",
"evidence": "/affected/2/versions"
},
{
"value": "3.7.1-1",
"evidence": "/affected/2/versions"
},
{
"value": "3.8.0-2",
"evidence": "/affected/2/versions"
},
{
"value": "3.8.0-2ubuntu0.1~esm1",
"evidence": "/affected/2/versions"
},
{
"value": "3.8.0-2ubuntu1",
"evidence": "/affected/2/versions"
},
{
"value": "3.8.0-2ubuntu1+esm1",
"evidence": "/affected/2/versions"
}
]
},
{
"name": {
"value": "php-twig",
"evidence": "/affected/3/package/name"
},
"prerequisites": [],
"fixed_versions": [],
"affected_versions": [
{
"value": "3.20.0-2ubuntu1",
"evidence": "/affected/3/versions"
}
]
},
{
"name": {
"value": "php-twig",
"evidence": "/affected/4/package/name"
},
"prerequisites": [],
"fixed_versions": [],
"affected_versions": [
{
"value": "3.23.0-2build7",
"evidence": "/affected/4/versions"
},
{
"value": "3.27.1-1",
"evidence": "/affected/4/versions"
},
{
"value": "3.28.0-1",
"evidence": "/affected/4/versions"
}
]
},
{
"name": {
"value": "php-twig",
"evidence": "/affected/5/package/name"
},
"prerequisites": [],
"fixed_versions": [],
"affected_versions": [
{
"value": "3.20.0-2ubuntu1",
"evidence": "/affected/5/versions"
},
{
"value": "3.23.0-2build5",
"evidence": "/affected/5/versions"
},
{
"value": "3.23.0-2build7",
"evidence": "/affected/5/versions"
},
{
"value": "3.23.0-2ubuntu0.1~esm1",
"evidence": "/affected/5/versions"
}
]
}
],
"severity": "critical",
"structured": {
"id": "UBUNTU-CVE-2026-46633",
"aliases": [
"UBUNTU-CVE-2026-46633"
],
"metrics": [
{
"type": "CVSS_V4",
"score": "CVSS:4.0/AV:N/AC:L/AT:N/PR:L/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N"
},
{
"type": "CVSS_V3",
"score": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H"
},
{
"type": "Ubuntu",
"score": "medium"
}
],
"affected": [
{
"ranges": [
{
"type": "ECOSYSTEM",
"events": [
{
"introduced": "0"
}
]
}
],
"package": {
"name": "php-twig",
"purl": "pkg:deb/ubuntu/php-twig?arch=source&distro=esm-apps%2Ffocal",
"ecosystem": "Ubuntu:Pro:20.04:LTS"
},
"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"
],
"database_specific": {
"source": "https://github.com/canonical/ubuntu-security-notices/blob/main/osv/cve/2026/UBUNTU-CVE-2026-46633.json"
},
"ecosystem_specific": {
"binaries": [
{
"binary_name": "php-twig",
"binary_version": "2.12.5-1ubuntu0.1~esm2"
},
{
"binary_name": "php-twig-cssinliner-extra",
"binary_version": "2.12.5-1ubuntu0.1~esm2"
},
{
"binary_name": "php-twig-extra-bundle",
"binary_version": "2.12.5-1ubuntu0.1~esm2"
},
{
"binary_name": "php-twig-html-extra",
"binary_version": "2.12.5-1ubuntu0.1~esm2"
},
{
"binary_name": "php-twig-inky-extra",
"binary_version": "2.12.5-1ubuntu0.1~esm2"
},
{
"binary_name": "php-twig-intl-extra",
"binary_version": "2.12.5-1ubuntu0.1~esm2"
},
{
"binary_name": "php-twig-markdown-extra",
"binary_version": "2.12.5-1ubuntu0.1~esm2"
}
]
}
},
{
"ranges": [
{
"type": "ECOSYSTEM",
"events": [
{
"introduced": "0"
}
]
}
],
"package": {
"name": "php-twig",
"purl": "pkg:deb/ubuntu/php-twig?arch=source&distro=esm-apps%2Fjammy",
"ecosystem": "Ubuntu:Pro:22.04:LTS"
},
"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"
],
"database_specific": {
"source": "https://github.com/canonical/ubuntu-security-notices/blob/main/osv/cve/2026/UBUNTU-CVE-2026-46633.json"
},
"ecosystem_specific": {
"binaries": [
{
"binary_name": "php-twig",
"binary_version": "3.3.8-2ubuntu4+esm2"
},
{
"binary_name": "php-twig-cache-extra",
"binary_version": "3.3.8-2ubuntu4+esm2"
},
{
"binary_name": "php-twig-cssinliner-extra",
"binary_version": "3.3.8-2ubuntu4+esm2"
},
{
"binary_name": "php-twig-extra-bundle",
"binary_version": "3.3.8-2ubuntu4+esm2"
},
{
"binary_name": "php-twig-html-extra",
"binary_version": "3.3.8-2ubuntu4+esm2"
},
{
"binary_name": "php-twig-inky-extra",
"binary_version": "3.3.8-2ubuntu4+esm2"
},
{
"binary_name": "php-twig-intl-extra",
"binary_version": "3.3.8-2ubuntu4+esm2"
},
{
"binary_name": "php-twig-markdown-extra",
"binary_version": "3.3.8-2ubuntu4+esm2"
},
{
"binary_name": "php-twig-string-extra",
"binary_version": "3.3.8-2ubuntu4+esm2"
}
]
}
},
{
"ranges": [
{
"type": "ECOSYSTEM",
"events": [
{
"introduced": "0"
}
]
}
],
"package": {
"name": "php-twig",
"purl": "pkg:deb/ubuntu/php-twig?arch=source&distro=esm-apps%2Fnoble",
"ecosystem": "Ubuntu:Pro:24.04:LTS"
},
"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"
],
"database_specific": {
"source": "https://github.com/canonical/ubuntu-security-notices/blob/main/osv/cve/2026/UBUNTU-CVE-2026-46633.json"
},
"ecosystem_specific": {
"binaries": [
{
"binary_name": "php-twig",
"binary_version": "3.8.0-2ubuntu1+esm1"
},
{
"binary_name": "php-twig-cache-extra",
"binary_version": "3.8.0-2ubuntu1+esm1"
},
{
"binary_name": "php-twig-cssinliner-extra",
"binary_version": "3.8.0-2ubuntu1+esm1"
},
{
"binary_name": "php-twig-extra-bundle",
"binary_version": "3.8.0-2ubuntu1+esm1"
},
{
"binary_name": "php-twig-html-extra",
"binary_version": "3.8.0-2ubuntu1+esm1"
},
{
"binary_name": "php-twig-inky-extra",
"binary_version": "3.8.0-2ubuntu1+esm1"
},
{
"binary_name": "php-twig-intl-extra",
"binary_version": "3.8.0-2ubuntu1+esm1"
},
{
"binary_name": "php-twig-markdown-extra",
"binary_version": "3.8.0-2ubuntu1+esm1"
},
{
"binary_name": "php-twig-string-extra",
"binary_version": "3.8.0-2ubuntu1+esm1"
}
]
}
},
{
"ranges": [
{
"type": "ECOSYSTEM",
"events": [
{
"introduced": "0"
}
]
}
],
"package": {
"name": "php-twig",
"purl": "pkg:deb/ubuntu/php-twig?arch=source&distro=questing",
"ecosystem": "Ubuntu:25.10"
},
"versions": [
"3.20.0-2ubuntu1"
],
"database_specific": {
"source": "https://github.com/canonical/ubuntu-security-notices/blob/main/osv/cve/2026/UBUNTU-CVE-2026-46633.json"
},
"ecosystem_specific": {
"binaries": [
{
"binary_name": "php-twig",
"binary_version": "3.20.0-2ubuntu1"
},
{
"binary_name": "php-twig-cache-extra",
"binary_version": "3.20.0-2ubuntu1"
},
{
"binary_name": "php-twig-cssinliner-extra",
"binary_version": "3.20.0-2ubuntu1"
},
{
"binary_name": "php-twig-extra-bundle",
"binary_version": "3.20.0-2ubuntu1"
},
{
"binary_name": "php-twig-html-extra",
"binary_version": "3.20.0-2ubuntu1"
},
{
"binary_name": "php-twig-inky-extra",
"binary_version": "3.20.0-2ubuntu1"
},
{
"binary_name": "php-twig-intl-extra",
"binary_version": "3.20.0-2ubuntu1"
},
{
"binary_name": "php-twig-markdown-extra",
"binary_version": "3.20.0-2ubuntu1"
},
{
"binary_name": "php-twig-string-extra",
"binary_version": "3.20.0-2ubuntu1"
}
]
}
},
{
"ranges": [
{
"type": "ECOSYSTEM",
"events": [
{
"introduced": "0"
}
]
}
],
"package": {
"name": "php-twig",
"purl": "pkg:deb/ubuntu/php-twig?arch=source&distro=stonking",
"ecosystem": "Ubuntu:26.10"
},
"versions": [
"3.23.0-2build7",
"3.27.1-1",
"3.28.0-1"
],
"database_specific": {
"source": "https://github.com/canonical/ubuntu-security-notices/blob/main/osv/cve/2026/UBUNTU-CVE-2026-46633.json"
},
"ecosystem_specific": {
"binaries": [
{
"binary_name": "php-twig",
"binary_version": "3.28.0-1"
},
{
"binary_name": "php-twig-cache-extra",
"binary_version": "3.28.0-1"
},
{
"binary_name": "php-twig-cssinliner-extra",
"binary_version": "3.28.0-1"
},
{
"binary_name": "php-twig-extra-bundle",
"binary_version": "3.28.0-1"
},
{
"binary_name": "php-twig-html-extra",
"binary_version": "3.28.0-1"
},
{
"binary_name": "php-twig-inky-extra",
"binary_version": "3.28.0-1"
},
{
"binary_name": "php-twig-intl-extra",
"binary_version": "3.28.0-1"
},
{
"binary_name": "php-twig-markdown-extra",
"binary_version": "3.28.0-1"
},
{
"binary_name": "php-twig-string-extra",
"binary_version": "3.28.0-1"
}
]
}
},
{
"ranges": [
{
"type": "ECOSYSTEM",
"events": [
{
"introduced": "0"
}
]
}
],
"package": {
"name": "php-twig",
"purl": "pkg:deb/ubuntu/php-twig?arch=source&distro=esm-apps%2Fresolute",
"ecosystem": "Ubuntu:Pro:26.04:LTS"
},
"versions": [
"3.20.0-2ubuntu1",
"3.23.0-2build5",
"3.23.0-2build7",
"3.23.0-2ubuntu0.1~esm1"
],
"database_specific": {
"source": "https://github.com/canonical/ubuntu-security-notices/blob/main/osv/cve/2026/UBUNTU-CVE-2026-46633.json"
},
"ecosystem_specific": {
"binaries": [
{
"binary_name": "php-twig",
"binary_version": "3.23.0-2ubuntu0.1~esm1"
},
{
"binary_name": "php-twig-cache-extra",
"binary_version": "3.23.0-2ubuntu0.1~esm1"
},
{
"binary_name": "php-twig-cssinliner-extra",
"binary_version": "3.23.0-2ubuntu0.1~esm1"
},
{
"binary_name": "php-twig-extra-bundle",
"binary_version": "3.23.0-2ubuntu0.1~esm1"
},
{
"binary_name": "php-twig-html-extra",
"binary_version": "3.23.0-2ubuntu0.1~esm1"
},
{
"binary_name": "php-twig-inky-extra",
"binary_version": "3.23.0-2ubuntu0.1~esm1"
},
{
"binary_name": "php-twig-intl-extra",
"binary_version": "3.23.0-2ubuntu0.1~esm1"
},
{
"binary_name": "php-twig-markdown-extra",
"binary_version": "3.23.0-2ubuntu0.1~esm1"
},
{
"binary_name": "php-twig-string-extra",
"binary_version": "3.23.0-2ubuntu0.1~esm1"
}
]
}
}
],
"modified": "2026-10-17T12:58:25.053790068Z",
"provider": "osv",
"upstream": [
"CVE-2026-46633"
],
"references": [
"https://ubuntu.com/security/CVE-2026-46633",
"https://www.cve.org/CVERecord?id=CVE-2026-46633",
"https://symfony.com/blog/cve-2026-46633-php-code-injection-via-use-template-name"
]
},
"related_cves": [
{
"value": "CVE-2026-46633",
"evidence": "/upstream"
}
],
"security_relevant": true,
"severity_evidence": "/severity/1/score"
},
"source_id": "core-osv",
"document_id": 358660,
"published_at": "2026-07-14T22:16:00+00:00"
}