Craft CMS: Potential authenticated Remote Code Execution via referrer redirect
The advisory, in context
Requirements:
- Control panel access
- Permissions to edit an entry
Details
Control panel users with the ability to edit entries can execute unsandboxed Twig code via the HTTP Referrer header.
The issue happens when a user is saving entries. Strings for a signed redirect URL are being compiled as a Twig template via renderObjectTemplate(), and while a sandboxed alternative already exists (renderSandboxedObjectTemplate()), it is not used in this case. This signed URL can be specified by users, as it is reflected in the “Referer” HTTP request header, which is under attacker control.
This has been fixed in Craft 5.10.0. Affected users should update to that version or higher to get the fix.
Resources
Affected packages
Start with the recorded fix for your release branch. Check your installed version and test compatibility before upgrading. Fixing this advisory does not rule out other vulnerabilities in the release.
From 5.9.0 before 5.10.0
Fixed in 5.10.0
24 explicitly affected versions
5.9.0, 5.9.1, 5.9.10, 5.9.11, 5.9.12, 5.9.13, 5.9.14, 5.9.15, 5.9.16, 5.9.17, 5.9.18, 5.9.19, 5.9.2, 5.9.20, 5.9.21, 5.9.22, 5.9.23, 5.9.3, 5.9.4, 5.9.5, 5.9.6, 5.9.7, 5.9.8, 5.9.9
View affected-version evidence
{
"ranges": [
{
"events": [
{
"introduced": "5.9.0"
},
{
"fixed": "5.10.0"
}
],
"type": "ECOSYSTEM"
}
],
"versions": [
"5.9.0",
"5.9.1",
"5.9.10",
"5.9.11",
"5.9.12",
"5.9.13",
"5.9.14",
"5.9.15",
"5.9.16",
"5.9.17",
"5.9.18",
"5.9.19",
"5.9.2",
"5.9.20",
"5.9.21",
"5.9.22",
"5.9.23",
"5.9.3",
"5.9.4",
"5.9.5",
"5.9.6",
"5.9.7",
"5.9.8",
"5.9.9"
]
}