Skip to content

CVE-2023-22527 — Atlassian Confluence Template Injection RCE

Key facts

CVE-2023-22527 is a Critical (10.0) vulnerability: Atlassian Confluence Template Injection RCE. This entry ships ready-to-deploy detection and prevention rules (Snort, YARA, Nginx, Apache) plus a detection-only PoC and a Docker test lab. It is on the CISA Known Exploited Vulnerabilities (KEV) catalog (added 2024-01-24), confirming active exploitation in the wild, and is linked to known ransomware campaigns.

Actively exploited — on the CISA KEV catalog

CVE-2023-22527 is listed on the CISA Known Exploited Vulnerabilities (KEV) catalog (added 2024-01-24), confirming exploitation in the wild. It is linked to known ransomware campaigns. Federal remediation deadline: 2024-02-14. Prioritise patching and deploy the detection and prevention rules below.

CVE CVE-2023-22527
Severity Critical (10.0)
CISA KEV Actively exploited (added 2024-01-24) · ransomware
Detection / prevention Snort, YARA, Nginx, Apache
PoC poc.py
Source 2023/CVE-2023-22527/

Details

CVE-2023-22527 is a Critical (10.0) vulnerability: Atlassian Confluence Template Injection RCE. This entry ships a detection-only proof-of-concept (PoC), a Docker test lab, and ready-to-deploy detection and prevention rules (Snort, YARA, Nginx, Apache) — see Detection and prevention below. Source: NVD record.

Overview

Attribute Value
CVE ID CVE-2023-22527
Severity Critical
CVSS Score 10.0
Affected Product Atlassian Confluence Data Center/Server
Vulnerability Type Template Injection / RCE
Exploitation Status Actively Exploited

Description

CVE-2023-22527 is a maximum severity (CVSS 10.0) template injection vulnerability in Atlassian Confluence that allows unauthenticated attackers to achieve remote code execution.

Affected Versions

  • Confluence Data Center/Server 8.0.x
  • Confluence Data Center/Server 8.1.x
  • Confluence Data Center/Server 8.2.x
  • Confluence Data Center/Server 8.3.x
  • Confluence Data Center/Server 8.4.x
  • Confluence Data Center/Server 8.5.0 - 8.5.3

Technical Details

Root Cause

The vulnerability exists in how Confluence processes Velocity templates. An attacker can inject malicious template code through specific endpoints, which is then executed server-side.

Attack Vector

  1. Attacker sends request to vulnerable Confluence endpoint
  2. Injects OGNL/Velocity template expression
  3. Template engine processes malicious code
  4. Arbitrary code executes on server

Impact

  • Unauthenticated remote code execution
  • Complete server compromise
  • Data theft and exfiltration
  • Lateral movement in enterprise networks

Mitigation

  1. Upgrade to fixed versions immediately
  2. If unable to patch, restrict access to Confluence
  3. Atlassian Cloud customers are not affected
  4. Monitor for exploitation attempts

Verification Process

The PoC uses a multi-stage verification approach:

Step 1: Product/Version Detection (Passive)

[*] Query target endpoint
[*] Detect product signatures and extract version
[*] Check if version is in vulnerable range

Step 2: Active Vulnerability Testing

Method Description Detection
Error-based Tests for error messages indicating vulnerability Error indicators in response
Timing-based Measures response delay with payload Response time significantly longer
Response-based Checks for expected patterns in response Vulnerability indicators present

Verification Flow

┌─────────────────────────────────────────────────────────────┐
│                    Product Detection                         │
│  Query target → Detect product/version                      │
│  Check if version in vulnerable range                       │
└─────────────────────────────────────────────────────────────┘
                              ↓
┌─────────────────────────────────────────────────────────────┐
│               Active Vulnerability Testing                   │
│                                                              │
│  1. Error-based Test                                         │
│     └─ Send payload → Check for error indicators            │
│     └─ If error found → CONFIRMED VULNERABLE                │
│                                                              │
│  2. Timing-based Test                                        │
│     └─ Send delay payload → Measure response time           │
│     └─ If delayed → CONFIRMED VULNERABLE                    │
│                                                              │
│  3. Response-based Test                                      │
│     └─ Send payload → Check response content                │
│     └─ If pattern matches → CONFIRMED VULNERABLE            │
└─────────────────────────────────────────────────────────────┘

Usage

# Full vulnerability check (version + active testing)
python3 poc.py -t https://target.com -c

# Version-only check (passive, no payloads sent)
python3 poc.py -t https://target.com -c --version-only

References

Detection and prevention

Ready-to-deploy defensive rules for CVE-2023-22527, for authorized testing and blue-team detection engineering:

References: NVD — CVE-2023-22527 · full write-up on the searchable site

Detection & prevention rules

# CVE-2023-22527 - Snort IDS Rules
# Severity: High

# Detect potential exploit attempts
alert tcp $EXTERNAL_NET any -> $HOME_NET $HTTP_PORTS (
    msg:"CVE-2023-22527 Potential Exploit Attempt";
    flow:to_server,established;
    content:".."; http_uri;
    classtype:web-application-attack;
    sid:2023225271;
    rev:1;
    metadata:cve CVE-2023-22527, severity high;
)

# Detect suspicious patterns in request
alert tcp $EXTERNAL_NET any -> $HOME_NET $HTTP_PORTS (
    msg:"CVE-2023-22527 Suspicious Request Pattern";
    flow:to_server,established;
    pcre:"/(%2e%2e|%252e|\x00)/Ui";
    classtype:web-application-attack;
    sid:2023225272;
    rev:1;
    metadata:cve CVE-2023-22527, severity high;
)

:material-file-download: prevention/snort.rules

/*
 * CVE-2023-22527 - YARA Detection Rules
 */

rule CVE_2023_22527_Exploit {
    meta:
        description = "Detects potential CVE-2023-22527 exploit attempts"
        author = "Security Research Team"
        severity = "high"
        cve = "CVE-2023-22527"

    strings:
        $path_traversal1 = "../" ascii wide
        $path_traversal2 = "..\" ascii wide
        $encoded1 = "%2e%2e" ascii wide nocase
        $encoded2 = "%252e" ascii wide nocase
        $null_byte = "%00" ascii wide

    condition:
        any of them
}

:material-file-download: prevention/yara.yar

# CVE-2023-22527 - Prevention Rules for Nginx

# Block common exploit patterns
location / {
    # Rate limiting
    limit_req zone=general burst=20 nodelay;

    # Block suspicious patterns
    if ($request_uri ~* "(\.\.[\/]|%2e%2e|%252e)") {
        return 403;
    }

    # Security headers
    add_header X-Content-Type-Options "nosniff" always;
    add_header X-Frame-Options "DENY" always;
    add_header X-XSS-Protection "1; mode=block" always;
}

# Log suspicious activity
access_log /var/log/nginx/CVE-2023-22527-access.log;
error_log /var/log/nginx/CVE-2023-22527-error.log;

:material-file-download: prevention/nginx.conf

# CVE-2023-22527 - Prevention Rules for Apache httpd

# Block common exploit patterns
<IfModule mod_rewrite.c>
    RewriteEngine On

    # Block path traversal
    RewriteCond %{REQUEST_URI} (\.\.[\/]|%2e%2e|%252e) [NC]
    RewriteRule .* - [F,L]

    # Block null bytes
    RewriteCond %{REQUEST_URI} %00 [NC]
    RewriteRule .* - [F,L]
</IfModule>

# Security headers
Header always set X-Content-Type-Options "nosniff"
Header always set X-Frame-Options "DENY"
Header always set X-XSS-Protection "1; mode=block"

# Enable logging
CustomLog /var/log/httpd/CVE-2023-22527-access.log combined
ErrorLog /var/log/httpd/CVE-2023-22527-error.log

:material-file-download: prevention/httpd.conf

Frequently asked questions

What is CVE-2023-22527?

CVE-2023-22527 is a Critical (10.0) vulnerability: Atlassian Confluence Template Injection RCE. This entry ships ready-to-deploy detection and prevention rules (Snort, YARA, Nginx, Apache) plus a detection-only PoC and a Docker test lab. It is on the CISA Known Exploited Vulnerabilities (KEV) catalog (added 2024-01-24), confirming active exploitation in the wild, and is linked to known ransomware campaigns.

How do I detect CVE-2023-22527?

Deploy the Snort and YARA detection rule included with this entry (see Detection & prevention rules below), then validate it against the detection-only PoC in the Docker test lab.

How do I block or mitigate CVE-2023-22527?

Apply the Nginx and Apache mitigation config included with this entry, and upgrade to a fixed version per the vendor advisory (see the NVD record for affected versions).

Is CVE-2023-22527 actively exploited?

Yes. CVE-2023-22527 is on the CISA Known Exploited Vulnerabilities (KEV) catalog, added 2024-01-24, which means it has been exploited in the wild. CISA also links it to known ransomware campaigns. CISA set a federal remediation deadline of 2024-02-14. Prioritise patching and deploy the detection and prevention rules above.


For authorized security testing and research only. See the full source and NVD record.