CVE-2021-26084
Confluence Server and Data Center used Webwork tags with a value attribute containing a $ construct, causing double evaluation of user input as an OGNL expression. An attacker could craft a URL with an OGNL payload to execute arbitrary code on the server.
Published on github.com
History
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 write-up has not been written yet. The Original tab links to the source.
How it worked
Root cause
Likely, the Webwork tag's value attribute was evaluated twice: first by Velocity and then as an OGNL expression, allowing user-controlled input to be executed as code.
Impact
An attacker could execute arbitrary code on the Confluence server, potentially leading to full system compromise.
What the attacker needed
Access to the Confluence web interface; For some payloads, a valid user account; For unauthenticated signup payload, signup enabled
How it was found
- Decompile the webwork jar using JD GUI.
- Copy AbstractUITag.java and SafeExpressionUtil.java to a temporary folder.
- Add print statements to dump OGNL evaluation results.
- Compile the modified files and inject them back into the jar.
- Replace the original jar with the instrumented version.
- Run Confluence and observe console output.
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 write-up has not been written yet. The Original tab links to the source.
Confluence is a team collaboration tool. A part of its code took input from the web address and ran it as a programming command without proper checking. This let an attacker run their own commands on the server, which is very dangerous.
What is RCE?
Running the attacker's code on the target's servers: through command or code injection, unsafe deserialisation or template injection.