Description
A sandbox information disclosure exists in Twig before 1.38.0 and 2.x before 2.7.0 because, under some circumstances, it is possible to call the __toString() method on an object even if not allowed by the security policy in place.
Fixed in Linux distributions
Distributions backport fixes, so the version that fixes this vulnerability differs per release — upgrade to at least the version shown. From the distributions' security trackers and advisories.
Debian
Security tracker ↗| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| Debian 9 | twig | 1.24.0-2+deb9u1 | DSA-4419-1 |
Ubuntu
Security tracker ↗| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| Ubuntu Pro 22.04 LTS | php-twig | 3.3.8-2ubuntu4+esm1 | USN-5947-1 |
| Ubuntu Pro 20.04 LTS | php-twig | 2.12.5-1ubuntu0.1~esm1 | USN-5947-1 |
| Ubuntu Pro 18.04 LTS | twig | 2.4.6-1ubuntu0.1~esm1 | USN-5947-1 |
Show 1 more (older releases, extended support, other products)Fewer releases
| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| Ubuntu Pro 16.04 LTS | twig | 1.23.1-1ubuntu4+esm1 | USN-5947-1 |
Affected packages
| Ecosystem | Package | Affected | Fixed | Record |
|---|---|---|---|---|
| Packagist | twig/twig | < 1.38.0 | 1.38.0 | GHSA-vxrc-68xx-x48g |
| Packagist | twig/twig | >= 2.0.0, < 2.7.0 | 2.7.0 | GHSA-vxrc-68xx-x48g |
Advisories 2
- USN-5947-1 php-twig, twig vulnerabilities Ubuntu Security Notices (USN) · Jun 25, 2026
- DSA-4419-1 twig - security update Debian Security (DSA / DLA) · Mar 9, 2026