# CVE-2025-24374: Twig fixes a security issue where escaping was missing when using null coalesce operator (??)

- Severity: Medium 4.3 (CVSS:3.1, scored by GitHub_M) `CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:L/A:N`
- Known to be exploited: not in CISA's catalogue, which lists only what CISA has confirmed
- Likelihood of exploitation in the next 30 days (EPSS): 0.30%, higher than 24% of CVEs (2026-12-01)
- Published: 2025-01-29T15:22:34.012Z
- Modified: 2026-06-17T08:58:55.593Z
- Also known as: GHSA-3xg3-cgvq-2xwr
- Weaknesses: CWE-74
- SSVC (CISA-ADP): exploitation none, automatable no, technical impact partial
- Assigned by: GitHub_M

## Description

Twig is a template language for PHP. When using the ?? operator, output escaping was missing for the expression on the left side of the operator. This vulnerability is fixed in 3.19.0.

(As written by CVE List.)

## Affected

- twigphp Twig: >= 3.16.0, < 3.19.0
- twig/twig (Packagist): from 3.16.0 before 3.19.0

## Every score

- GitHub_M: CVSS:3.1 4.3 Medium `CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:L/A:N`
- GitHub: CVSS:3.1 4.3 Medium `CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:L/A:N`

## References

- <https://github.com/twigphp/Twig/security/advisories/GHSA-3xg3-cgvq-2xwr> (web)
- <https://github.com/twigphp/Twig/commit/38576b12f05df3cc871bf68f39ccb46b418334a3> (web)
- <https://nvd.nist.gov/vuln/detail/CVE-2025-24374> (advisory)
- <https://github.com/FriendsOfPHP/security-advisories/blob/master/twig/twig/CVE-2025-24374.yaml> (web)
- <https://github.com/twigphp/Twig> (package)
- <https://symfony.com/blog/twig-cve-2025-24374-missing-output-escaping-for-the-null-coalesce-operator> (web)

## Sources

- CVE List: [CVE-2025-24374](https://www.cve.org/CVERecord?id=CVE-2025-24374), CVE Terms of Use, modified 2025-01-29
- GitHub Advisory Database: [GHSA-3xg3-cgvq-2xwr](https://github.com/advisories/GHSA-3xg3-cgvq-2xwr), CC-BY-4.0, modified 2025-01-30
- NVD: [CVE-2025-24374](https://nvd.nist.gov/vuln/detail/CVE-2025-24374), Public domain, modified 2026-06-17

---

Page: https://cve.day/CVE-2025-24374 · Whole record: https://cve.day/CVE-2025-24374.json · Rebuilt by cve.day 2026-11-25T22:58:53.667Z
