UBUNTU-CVE-2026-47732
Twig versions prior to 3.26.0 contain a vulnerability where several language constructs trigger PHP string coercion on Stringable objects without proper security checks. This allows sandboxed template authors to invoke the __toString() method on objects accessible in the render context via various template expressions and tags. The issue is fixed in Twig version 3.26.0.
AI Analysis
Technical Summary
The vulnerability in Twig, a PHP template language, exists in versions before 3.26.0. It arises because multiple Twig language constructs cause PHP to coerce objects implementing the Stringable interface to strings by invoking their __toString() method without consulting SecurityPolicy::checkMethodAllowed(). This bypass allows sandboxed template authors to execute __toString() on objects reachable in the rendering context through conditional expressions, comparison operators, tests, template-loading tags, dynamic attribute names, spread arguments, the do tag, and the range operator. This behavior can lead to unintended method invocation within sandboxed environments. The vulnerability is resolved in Twig 3.26.0.
Potential Impact
An attacker with the ability to author sandboxed templates can invoke the __toString() method on objects accessible in the rendering context without proper security policy checks. This may lead to unintended code execution paths or information disclosure within the sandboxed environment. The vulnerability affects the security boundary of sandboxed templates by allowing method invocation that should be restricted.
Mitigation Recommendations
This vulnerability is fixed in Twig version 3.26.0. Users should upgrade to version 3.26.0 or later to remediate this issue. No additional mitigations are indicated by the vendor advisory. Patch status is confirmed by the fix in version 3.26.0.
UBUNTU-CVE-2026-47732
Description
Twig versions prior to 3.26.0 contain a vulnerability where several language constructs trigger PHP string coercion on Stringable objects without proper security checks. This allows sandboxed template authors to invoke the __toString() method on objects accessible in the render context via various template expressions and tags. The issue is fixed in Twig version 3.26.0.
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
The vulnerability in Twig, a PHP template language, exists in versions before 3.26.0. It arises because multiple Twig language constructs cause PHP to coerce objects implementing the Stringable interface to strings by invoking their __toString() method without consulting SecurityPolicy::checkMethodAllowed(). This bypass allows sandboxed template authors to execute __toString() on objects reachable in the rendering context through conditional expressions, comparison operators, tests, template-loading tags, dynamic attribute names, spread arguments, the do tag, and the range operator. This behavior can lead to unintended method invocation within sandboxed environments. The vulnerability is resolved in Twig 3.26.0.
Potential Impact
An attacker with the ability to author sandboxed templates can invoke the __toString() method on objects accessible in the rendering context without proper security policy checks. This may lead to unintended code execution paths or information disclosure within the sandboxed environment. The vulnerability affects the security boundary of sandboxed templates by allowing method invocation that should be restricted.
Mitigation Recommendations
This vulnerability is fixed in Twig version 3.26.0. Users should upgrade to version 3.26.0 or later to remediate this issue. No additional mitigations are indicated by the vendor advisory. Patch status is confirmed by the fix in version 3.26.0.
Technical Details
- Gcve Source
- db.gcve.eu
- Osv Id
- UBUNTU-CVE-2026-47732
- 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: 6a58b49a68715ace43da82e1
Added to database: 07/16/2026, 10:38:18 UTC
Last enriched: 07/16/2026, 12:28:31 UTC
Last updated: 07/16/2026, 12:28:31 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.