CVE-2022–26134: The Confluence RCE That Shook Enterprise Security
A zero-day remote code execution vulnerability in Atlassian Confluence allowed unauthenticated attackers to send HTTP requests containing OGNL expressions that were evaluated on the server. Attackers could execute arbitrary commands and were observed deploying cryptocurrency miners and establishing command-and-control channels.
Published on medium.com
Today’s discussion might be a bit different because we’re stepping slightly away from the usual territory. We’re diving into the remote code execution (RCE) vulnerability that made waves in 2022: CVE-2022–26134, classified as High severity.
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
User-controlled URIs were passed directly to the OGNL expression parser, allowing arbitrary Java expressions to be evaluated.
Impact
Attackers could execute arbitrary code on vulnerable Confluence servers, and in observed campaigns they deployed cryptocurrency miners, disabled firewalls, escalated privileges, moved laterally via SSH, and established persistence.
What the attacker needed
Network access to Confluence; no authentication required
The fix
Atlassian fixed it by stopping the translation of code within HTTP requests and filtering suspicious OGNL patterns.
How it was found
- Send an HTTP request to Confluence containing an OGNL expression that executes a command.
- Convert the command output to a string using a utility class.
- Add the output as a custom HTTP response header named X-Cmd-Response.
- Observe the command output in the response header to confirm code execution.
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 flaw in a popular team collaboration tool called Confluence. The software took special code-like text from web requests and actually ran it on the server, so an attacker could make the server run their own commands without needing a password. That let them take control of the machine and install harmful software.
What is RCE?
Running the attacker's code on the target's servers: through command or code injection, unsafe deserialisation or template injection.