Skip to content
RCE Write-up Advanced

CVE202126084 Remote Code Execution on Confluence Servers

An unauthenticated OGNL injection in Confluence Server's Velocity templates allowed remote code execution. Attackers could execute arbitrary commands on the server.

github.com

Published on github.com

Raw

The author, 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, user input was embedded into a Velocity template and evaluated as an OGNL expression without proper sanitisation, allowing expression injection.

Impact

An unauthenticated attacker could execute arbitrary commands on the Confluence server, leading to full compromise.

What the attacker needed

Confluence Server unpatched; No authentication required

How it was found

  1. Identify the vulnerable Velocity template file from the patch.
  2. Find the URL route that renders the template.
  3. Send a request with a parameter that breaks out of the single-quoted context using a unicode escape.
  4. Inject an OGNL expression to evaluate simple arithmetic, confirming injection.
  5. Bypass the isSafeExpression blacklist by accessing the class property via array accessor.
  6. Use Java reflection to execute arbitrary commands.

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.

This is a bug in a web application that lets an attacker run commands on the server without logging in. The attacker sends a specially crafted request that the server mistakenly evaluates as code, giving them control.

What is RCE?

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

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.