GHSL-2020-047: Server-side template injection in dotCMS
A user with template editing privileges could bypass the Velocity sandbox and execute arbitrary Java code or system commands. This could lead to remote code execution with the privileges of the dotCMS process.
Originally disclosed on GitHub Security Lab
A user with privileges to edit templates may execute arbitrary Java code or run arbitrary system commands with the same privileges as the account running dotCMS.
The full write-up lives on its author's site
It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
How it worked
Root cause
Likely, the Velocity sandbox (SecureUberspector) is insufficient because the Templating API exposes objects whose object graph allows instantiation of arbitrary Java classes.
Impact
This issue may lead to Remote Code Execution.
What the attacker needed
Privileges to edit templates
The fix
The issue was fixed as part of the 5.3 release.
Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
dotCMS lets users create templates that are processed on the server. The server tries to restrict what those templates can do, but the restrictions can be bypassed. An attacker who can edit templates could then run their own code on the server, taking full control.
What is RCE?
Running the attacker's code on the target's servers: through command or code injection, unsafe deserialisation or template injection.