Arbitrary Code Injection Affecting craftcms/cms package, versions >=4.0.0-RC1, <4.16.5>=5.0.0-RC1, <5.8.7


Severity

Recommended
0.0
high
0
10

CVSS assessment by Snyk's Security Team. Learn more

Threat Intelligence

EPSS
0.54% (67th percentile)

Do your applications use this vulnerable package?

In a few clicks we can analyze your entire application and see what components are vulnerable in your application, and suggest you quick fixes.

Test your applications
  • Snyk IDSNYK-PHP-CRAFTCMSCMS-12219161
  • published28 Aug 2025
  • disclosed25 Aug 2025
  • creditsingetu0096

Introduced: 25 Aug 2025

NewCVE-2025-57811  (opens in a new tab)
CWE-1336  (opens in a new tab)

How to fix?

Upgrade craftcms/cms to version 4.16.5, 5.8.7 or higher.

Overview

craftcms/cms is a content management system.

Affected versions of this package are vulnerable to Arbitrary Code Injection via the checkArrowFunction function in src/web/twig/Extension.php. An attacker can execute arbitrary code by injecting malicious payloads into templates.

Note: This is exploitable if the attacker has administrator access and the ALLOW_ADMIN_CHANGES setting is enabled.

CVSS Base Scores

version 4.0
version 3.1