Skip to content
RCE Write-up Advanced

CVE-2021-26084: Details on the Recently Exploited Atlassian Confluence OGNL Injection Bug

An OGNL injection in Atlassian Confluence's Webwork module allowed unauthenticated attackers to execute arbitrary code by sending crafted requests with a Unicode escape that broke out of a string literal in a Velocity template. The vulnerability was due to insufficient input validation and an incomplete blocklist of unsafe OGNL expressions.

zerodayinitiative.com

Published on zerodayinitiative.com

An Object-Graph Navigation Language (OGNL) injection has been reported in the Webwork module of Atlassian Confluence Server and Data Center. The vulnerability is due to insufficient input validation leading to OGNL evaluation of user-supplied input.

The author, on zerodayinitiative.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 application failed to sanitise user input before embedding it in a single-quoted OGNL expression in a Velocity template, and the blocklist of unsafe OGNL elements was incomplete.

Impact

A remote, unauthenticated attacker could execute arbitrary code on the server, and mass exploitation for cryptocurrency mining has been reported.

What the attacker needed

Network access to Confluence; no authentication required

How it was found

  1. Identify a vulnerable Confluence endpoint that accepts user input used in an OGNL expression.
  2. Send an HTTP request (GET or POST) with a parameter containing the Unicode escape for a single quote.
  3. Append an arbitrary OGNL expression after the escaped quote to execute code.

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 uses a template system that can evaluate expressions written in a language called OGNL. If user input is placed inside a quoted string in such a template without proper escaping, an attacker can include a special character sequence that ends the string early and then add their own OGNL code. That code runs on the server, letting the attacker run commands as the Confluence user.

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.