Craft CMS
cpe:2.3:a:craftcms:craft_cms:*:*:*:*:*:*:*
- >= 5.0.0-RC1, < 5.9.0-beta.1
- >= 4.0.0-RC1, < 4.17.0-beta.1
A remote code execution vulnerability has been identified in Craft CMS versions prior to 5.8.22 and 4.16.18. The issue arises from improper handling of Twig input in text fields under the Settings menu or through the System Messages utility. Administrators can inadvertently create malicious payloads that exploit this vulnerability. For exploitation, administrator access is required, and the 'allowAdminChanges' setting must be enabled, which is not recommended for non-development environments. Alternatively, a non-administrator account can be used if 'allowAdminChanges' is disabled, but access to the System Messages utility is needed.
Exploitation of this vulnerability allows for authenticated remote code execution on the server where Craft CMS is hosted.
To reproduce this vulnerability, an administrator must enable the 'allowAdminChanges' setting and then create a malicious payload using the Twig 'map' filter in a text field that accepts Twig input. This can be done under the Settings menu in the Craft control panel or through the System Messages utility. Once the payload is crafted, it can be executed to achieve remote code execution on the server.
Users should update to Craft CMS versions 5.8.22 or 4.16.18, where this vulnerability has been patched.
Our algorithm analyzes dozens of metrics to generate these 8 key vulnerability categories, which are then combined to calculate the overall risk score.