Skip to content
RCE Write-up Advanced

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.

Benny Jacob Follow

Published on github.com

History

snowyyowl (@bennyyjacob), on github.com

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

  1. Decompile the webwork jar using JD GUI.
  2. Copy AbstractUITag.java and SafeExpressionUtil.java to a temporary folder.
  3. Add print statements to dump OGNL evaluation results.
  4. Compile the modified files and inject them back into the jar.
  5. Replace the original jar with the instrumented version.
  6. 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.

More from Atlassian

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Remote code execution

The lesson behind this report.

Running the attacker's code on the target's servers: through command or code injection, unsafe deserialisation or template injection.