CVE-2024-51754: Twig has unguarded calls to `__toString()` when nesting an object into an array

low Affects twig/twig. Feed 2026.10.29.1, updated 2026-10-28; published ; advisory modified .

Twig has unguarded calls to `__toString()` when nesting an object into an array

Package
twig/twig Composer
Affected versions
<3.11.2 or >=3.12 and <3.14.1 or >=1.0.0 and <2.0.0 or >=2.0.0 and <3.0.0 or >=3.0.0 and <3.11.2 or >=3.12.0 and <3.14.1
Fixed in
3.11.2, 3.14.1
Severity
low  CVSS 2.2
Exploitation
not on CISA KEV · EPSS 0% (37.6th percentile)
Published
2024-11-06
Source
osv.dev

References

CWE-668
NVD recordtwig/twig advisories

Am I affected?

Find out in one command. phpwarden checks your composer.lock against this advisory and 20,000+ others, ranked by real-world exploitation (CISA KEV + EPSS). Free, offline, open data.

# one-time install
pip install phpwarden

# then
phpwarden deps composer.lock

Or keep it checked automatically: GitHub Action · pre-commit hook · GitLab CI · Laravel artisan command

Install docs   How findings are ranked

Related advisories