UBUNTU-CVE-2026-46640
A vulnerability in the Twig PHP template engine versions from 3.15.0 up to but not including 3.26.0 allows an attacker to inject raw PHP code via dynamic attribute syntax without proper validation. This leads to execution of attacker-controlled PHP code at template load time. The issue is fixed in version 3.26.0. Multiple Ubuntu package versions of php-twig are affected.
AI Analysis
Technical Summary
Twig versions 3.15.0 through 3.25.x contain a vulnerability where the _self.(<string>) and import-alias dynamic attribute syntax can concatenate an attacker-controlled string into a MacroReferenceExpression name without validating the identifier. This results in raw PHP code being emitted into the generated template source, which is then executed when the template loads. The vulnerability is resolved in Twig version 3.26.0. Several Ubuntu package versions of php-twig are impacted by this issue.
Potential Impact
An attacker can cause arbitrary PHP code execution within the context of the application using Twig templates by exploiting this vulnerability. This can lead to full compromise of the application environment where Twig templates are processed. No known exploits in the wild have been reported at this time.
Mitigation Recommendations
Upgrade to Twig version 3.26.0 or later where this vulnerability is fixed. The affected Ubuntu package versions listed should be updated to versions that include the fix. Patch status is not explicitly provided in the input; users should consult the Ubuntu security advisories for official patches.
UBUNTU-CVE-2026-46640
Description
A vulnerability in the Twig PHP template engine versions from 3.15.0 up to but not including 3.26.0 allows an attacker to inject raw PHP code via dynamic attribute syntax without proper validation. This leads to execution of attacker-controlled PHP code at template load time. The issue is fixed in version 3.26.0. Multiple Ubuntu package versions of php-twig are affected.
CVSS v4.0
Affected software
pkg:deb/ubuntu/[email protected]~esm2?arch=source&distro=esm-apps/focalpkg:deb/ubuntu/[email protected]+esm2?arch=source&distro=esm-apps/jammypkg:deb/ubuntu/[email protected]+esm1?arch=source&distro=esm-apps/noblepkg:deb/ubuntu/[email protected]?arch=source&distro=questingpkg:deb/ubuntu/[email protected]~esm1?arch=source&distro=esm-apps/resoluteRun on your own infrastructure? Check whether these packages are installed with threat-finder — our free open-source scanner.
AI-Powered Analysis
Machine-generated threat intelligence
Technical Analysis
Twig versions 3.15.0 through 3.25.x contain a vulnerability where the _self.(<string>) and import-alias dynamic attribute syntax can concatenate an attacker-controlled string into a MacroReferenceExpression name without validating the identifier. This results in raw PHP code being emitted into the generated template source, which is then executed when the template loads. The vulnerability is resolved in Twig version 3.26.0. Several Ubuntu package versions of php-twig are impacted by this issue.
Potential Impact
An attacker can cause arbitrary PHP code execution within the context of the application using Twig templates by exploiting this vulnerability. This can lead to full compromise of the application environment where Twig templates are processed. No known exploits in the wild have been reported at this time.
Mitigation Recommendations
Upgrade to Twig version 3.26.0 or later where this vulnerability is fixed. The affected Ubuntu package versions listed should be updated to versions that include the fix. Patch status is not explicitly provided in the input; users should consult the Ubuntu security advisories for official patches.
Technical Details
- Gcve Source
- db.gcve.eu
- Osv Id
- UBUNTU-CVE-2026-46640
- Osv Schema Version
- 1.7.0
- Aliases
- []
- Ecosystems
- ["Ubuntu:Pro:20.04:LTS","Ubuntu:Pro:22.04:LTS","Ubuntu:Pro:24.04:LTS","Ubuntu:25.10","Ubuntu:Pro:26.04:LTS"]
- Database Specific Severity
- null
- Cvss Version
- 4.0
Threat ID: 6a58b49a68715ace43da82fc
Added to database: 07/16/2026, 10:38:18 UTC
Last enriched: 07/16/2026, 12:29:36 UTC
Last updated: 07/16/2026, 12:29:36 UTC
Views: 2
Community Reviews
0 reviewsCrowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.
Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.
Actions
Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.
External Links
Need more coverage?
Upgrade to Pro Console for AI refresh and higher limits.
For incident response and remediation, OffSeq services can help resolve threats faster.
Latest Threats
Check if your credentials are on the dark web
Instant breach scanning across billions of leaked records. Free tier available.