2.2low
Unguarded calls to __isset() and to array-accesses when the sandbox is enabled in Twig
- Severity
- 2.2low CVSS:3.1 by GitHub_M
- Exploit likelihood
- 0.43% (higher than 38% of CVEs; EPSS, by FIRST)
- Published
- Last changed
- Assigned by
- GitHub_M
- Also known as
- GHSA-jjxq-ff2g-95vh
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.
Affected
| Product or package | Versions | Reported by |
|---|---|---|
| twigphp Twig | < 3.11.2, >= 3.12.0, < 3.14.1 | CVE List |
| twig/twig (Packagist) | before 3.11.2, from 3.12 before 3.14.1 | GitHub Advisory Database |
All scores
| GitHub_M | 2.2low CVSS:3.1 | CVSS:3.1/AV:N/AC:H/PR:H/UI:N/S:U/C:L/I:N/A:N |
| GitHub | 2.2low CVSS:3.1 | CVSS:3.1/AV:N/AC:H/PR:H/UI:N/S:U/C:L/I:N/A:N |
| GitHub | low CVSS:4.0 | CVSS:4.0/AV:N/AC:L/AT:P/PR:H/UI:N/VC:L/VI:N/VA:N/SC:N/SI:N/SA:N |
Classification
SSVC (CISA-ADP): exploitation none, automatable no, technical impact partial.
What each source says
CVE List
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.
GitHub Advisory Database
Description
In a sandbox, and 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.
Resolution
The sandbox mode now ensures access to array-like's properties is allowed.
The patch for this issue is available here for the 3.11.x branch, and here for the 3.x branch.
Credits
We would like to thank Jamie Schouten for reporting the issue and Nicolas Grekas for providing the fix.
NVD (es)
Twig es un lenguaje de plantillas para PHP. En un entorno aislado, un atacante puede acceder a los atributos de objetos similares a matrices, ya que no fueron comprobados por la política de seguridad. Ahora se comprueban a través de la política de propiedades y se llama al método `__isset()` después de la comprobación de seguridad. Esto es una falla de BC. Este problema se ha corregido en las versiones 3.11.2 y 3.14.1. Se recomienda a todos los usuarios que actualicen. No hay workarounds para este problema.
References
Sources
| Source | Record | Licence |
|---|---|---|
| CVE List | CVE-2024-51755 changed 2024-11-07 | CVE Terms of Use |
| GitHub Advisory Database | GHSA-jjxq-ff2g-95vh changed 2024-11-12 | CC-BY-4.0 |
| NVD | CVE-2024-51755 changed 2026-06-17 | Public domain |