Skip to content
Rapid7 Analysis: CVE-2022

Rapid7 Analysis: CVE-2022

Rapid7 June 17, 2026

On June 2, 2022, Atlassian published a security advisory for CVE-2022-26134, a critical unauthenticated remote code execution vulnerability in Confluence Server and Confluence Data Center. The vulnerability was unpatched when it was published on June 2 and is being exploited in the wild . As of June 3, both patches and a temporary workaround are available.

Atlassian updated their advisory on June 3 to reflect that it’s likely that all versions (whether supported or not) of Confluence Server and Data Center are affected, but they have yet to confirm the earliest affected version. Organizations should install patches OR apply the workaround on an emergency basis. If you are unable to mitigate the vulnerability for any version of Confluence, you should restrict or disable Confluence Server and Confluence Data Center instances immediately.

Multiple actors have already exploited this vulnerability. Rapid7 expects exploitation to continue at scale while unpatched servers remain internet facing.

CVE-2022-26314 is an unauthenticated and remote OGNL injection vulnerability resulting in code execution in the context of the Confluence server (typically the confluence user on Linux installations). Given the nature of the vulnerability, internet-facing Confluence servers are at very high risk.

Last year, Atlassian Confluence suffered from a different unauthenticated and remote OGNL injection, CVE-2021-26084 . Organizations maintaining an internet-facing Confluence or Data Server may want to consider permanently moving access behind a VPN.

As stated, the vulnerability is an OGNL injection vulnerability affecting the HTTP server. The OGNL payload is placed in the URI of an HTTP request. Any type of HTTP method appears to work, whether valid (GET, POST, PUT, etc) or invalid (e.g. “BALH”). In its simplest form, an exploit abusing the vulnerability looks like this (note the following will work on 7.13.6 LTS and below. See the last section in this writeup for information on 7.18.0 proof of concepts):

Above, the exploit is URL-encoded. The exploit encompasses everything from the start of the content location to the last instance of /. Decoded it looks like this:

Evidence of exploitation can typically be found in access logs because the exploit is stored in the HTTP request field. For example, on our test Confluence (version 7.13.6 LTS), the log file /opt/atlassian/confluence/logs/conf_access_log. .log contains the following entry after exploitation:

Scanning for vulnerable servers is easy because exploitation allows attackers to force the server to send command output in the HTTP response. For example, the following request will return the response of whoami in the attacker-created X-Cmd-Response HTTP field (credit to Rapid7’s Brandon Turner for the exploit below). Note the X-Cmd-Response: confluence line in the HTTP response:

Decoding the exploit in the curl request shows how this is achieved. The exploit saves the output of the exec call and uses setHeader to include the result in the server’s response to the attacker.

Our investigation led to the following partial call stack. The call stack demonstrates the OGNL injection starting from HttpServlet.service to OgnlValueStack.findValue and beyond.

OgnlValueStack findValue(str) is important as it is the starting point for the OGNL expression to be evaluated. As we can see in the call stack above, TextParseUtil.class invokes OgnlValueStack.findValue when this vulnerability is exploited.

ActionChainResult.class calls TextParseUtil.translateVariables using this.namespace as the provided expression:

Where namespace is created from the request URI string in com.opensymphony.webwork.dispatcher.ServletDispatcher.getNamespaceFromServletPath:

The result is that the attacker-provided URI will be translated into a namespace, which will then find its way down to OGNL expression evaluation. At a high level, this is very similar to CVE-2018-11776 , the Apache Struts2 namespace OGNL injection vulnerability. Just a reminder that there is nothing new in this world.

On June 3, 2022, Atlassian directed customers to replace xwork-1.0.3.6.jar with a newly released xwork-1.0.3-atlassian-10.jar. The xwork jars contain the ActionChainResult.class and TextParseUtil.class we identified as the path to OGNL expression evaluation.

The patch makes a number of small changes to fix this issue. For one, namespace is no longer passed down to TextParseUtil.translateVariables from ActionChainResult.execute:

Atlassian also added SafeExpressionUtil.class to the xworks jar. SafeExpressionUtil.class provides filtering of unsafe expressions, and has been inserted into OgnlValueStack.class in order to examine expressions when findValue is invoked. For example:

The OGNL injection primitive gives attackers many options. Volexity’s excellent Zero-Day Exploitation of Atlassian Confluence discusses JSP webshells being dropped to disk. However, Confluence Server should typically execute as confluence and not root. The confluence user is fairly restricted and unable to introduce web shells (to our knowledge).

Java does otherwise provide a wide variety of features that aid in achieving and maintaining execution (both with and without touching disk). It’s impossible to demonstrate all here, but a reverse shell routed through Java’s Nashorn engine is, perhaps, an interesting place for others to explore.

Decoded, the exploit looks like the following:

And results in a reverse shell:

Of course, shelling out can be highly risky for attackers if the victim is running some type of threat detection software. Executing in memory only is least likely to get an attacker caught. As an example, we put together a simple exploit that will read /etc/passwd and exfiltrate it to the attacker without shelling out.

When decoded, the reader can see that we again have relied on the Nashorn scripting engine.

Again, the attacker is listening for the exfiltration which looks, as you’d expect, like /etc/passd:

Finally, note that the exploit could be entirely URI-encoded as well. Writing any type of detection logic that relies on just the ASCII form will be quickly bypassed.

The above analysis was written for 7.13.6 LTS (what we believe to be the most likely enterprise target). Exploits for Confluence versions 7.15+ are a little different because Atlassian introduced an OGNL expression evaluation of sorts. The following curl proof of concept will exfiltrate an executed command on Confluence 7.18.0 and below. The command below executes whoami and will store it in the X-Cmd-Response HTTP header.

Extracted Entities