CVE-2025-58049
Executive Summary
CVE-2025-58049 is a vulnerability in XWiki Platform that exposes sensitive cookies (including session tokens and potentially authentication credentials) in plaintext within PDF export job statuses. This flaw allows an attacker with local access to the XWiki data directory (e.g., via a backup or file system compromise) to extract these credentials. The vulnerability affects versions from 14.4.2 up to, but not including, 16.4.8, 16.5.0-rc-1 to 16.10.7, and 17.0.0-rc-1 to 17.4.0-rc-1. The CVSS score is 5.8 (Medium), with a local attack vector and low complexity. No public proof-of-concept (PoC) or exploit code is currently available. The EPSS score is 0.0%, indicating a very low probability of exploitation in the wild at this time.
This record — and 170,000+ others — are available via the ValtersIT API. One endpoint replaces five: NVD + GitHub CVE + CISA KEV + EPSS + Nuclei + Exploit-DB, unified.
No signup required
Supply Chain & Package Security
XWiki is a Java-based platform distributed as a WAR file or via Docker images. The vulnerability is in the core platform code, not in a third-party package. However, organizations using XWiki should verify their deployment version and apply the patch immediately. The fix is included in the official releases listed above.
CVSS Breakdown & Threat Level
- Attack Vector (AV): Local (L) – The attacker must have local access to the file system or a backup.
- Attack Complexity (AC): Low (L) – No special conditions are required.
- Privileges Required (PR): Low (L) – The attacker needs read access to the data directory.
- User Interaction (UI): None (N) – No user action is required.
- Scope (S): Unchanged (U) – The vulnerability does not affect other components.
- Confidentiality (C): High (H) – Sensitive cookies are exposed.
- Integrity (I): None (N) – No data modification is possible.
- Availability (A): None (N) – No denial of service.
Threat Level: Medium. The vulnerability requires local access, but the impact on confidentiality is high. The lack of public exploits and low EPSS score reduce the immediate threat.
Deep Dive & Mechanics
The vulnerability resides in the PDF export functionality of XWiki. When a user triggers a PDF export, the system creates a job status object that stores metadata about the export process. This job status includes the cookies used during the export session. Due to a coding oversight, these cookies are stored in plaintext (unencrypted) within the job status, which is persisted to the XWiki data directory.
An attacker who gains access to the data directory (e.g., via a backup, file inclusion, or compromised server) can read these job status files and extract the plaintext cookies. These cookies may include session tokens, authentication credentials, or other sensitive data that can be used to impersonate users or gain unauthorized access.
The root cause is a failure to sanitize or encrypt sensitive data before storing it in job statuses. The fix involves either encrypting the cookies or removing them from the job status entirely.
Vulnerable vs. Patched Code
The vulnerable code is in the PDF export job implementation. The exact file is not publicly disclosed, but the fix involves modifying the job status handling to not store cookies in plaintext.
Vulnerable Code (Conceptual):
// Vulnerable: stores cookies directly in job status
public class PDFExportJob {
public void run() {
// ... export logic ...
JobStatus status = new JobStatus();
status.setCookies(request.getCookies()); // Stores cookies in plaintext
jobManager.storeStatus(status);
}
}
Patched Code (Conceptual):
// Patched: removes cookies from job status
public class PDFExportJob {
public void run() {
// ... export logic ...
JobStatus status = new JobStatus();
// Cookies are not stored
jobManager.storeStatus(status);
}
}
The patch ensures that cookies are not included in the job status object, preventing their exposure.
Exploitation & Lab Setup
Red Team
Prerequisites:
- Access to the XWiki data directory (e.g., via a backup or file system read).
- Knowledge of the XWiki version (vulnerable range).
Steps:
- Locate the job status files in the data directory. These are typically stored in
data/jobs/or similar. - Search for files containing "PDFExport" or "export" in the filename.
- Open the files and look for cookie data. Cookies are often stored as key-value pairs.
- Extract the cookies and use them to impersonate users or access protected resources.
Example (Linux):
# Find job status files
find /path/to/xwiki/data -name "*.job" -type f
# Search for cookies in the files
grep -r "cookie" /path/to/xwiki/data/jobs/
Blue Team
Detection:
- Monitor for unauthorized access to the data directory.
- Use file integrity monitoring (FIM) to detect changes to job status files.
- Review backups for exposed cookies.
Mitigation:
- Apply the patch immediately.
- Rotate all cookies and session tokens after patching.
- Restrict access to the data directory to only necessary processes.
Indicators of Compromise (IOCs)
- File Paths:
data/jobs/*.job(or similar) containing plaintext cookies. - Log Entries: Unusual access to job status files.
- Network Traffic: Use of stolen cookies to authenticate to XWiki.
Detection Engineering
YARA Rule
rule CVE_2025_58049_XWiki_Cookie_Exposure {
meta:
description = "Detects plaintext cookies in XWiki job status files"
author = "Valters IT"
date = "2025-04-10"
reference = "CVE-2025-58049"
strings:
$cookie = /cookie\s*=\s*[a-zA-Z0-9%]+/ nocase
$job_status = "JobStatus" nocase
condition:
$job_status and #cookie > 0
}
Sigma Rule
title: XWiki Plaintext Cookie Exposure in Job Status
id: 12345678-1234-1234-1234-123456789012
status: experimental
description: Detects plaintext cookies in XWiki job status files
author: Valters IT
date: 2025-04-10
references:
- https://nvd.nist.gov/vuln/detail/CVE-2025-58049
logsource:
category: file_event
product: linux
detection:
selection:
TargetFilename|contains: 'data/jobs/'
TargetFilename|endswith: '.job'
condition: selection
falsepositives:
- Legitimate job status files (should not contain cookies)
level: high
Suricata Rule
alert http any any -> any any (msg:"CVE-2025-58049 XWiki Cookie Exposure Attempt"; flow:to_server; content:"/data/jobs/"; nocase; content:".job"; nocase; sid:1000001; rev:1;)
Remediation & Mitigation
Immediate Actions:
- Upgrade XWiki to version 16.4.8, 16.10.7, or 17.4.0-rc-1 (or later).
- Rotate all session tokens and cookies after patching.
- Review backups for exposed cookies and invalidate them.
Long-term Measures:
- Implement file integrity monitoring on the data directory.
- Restrict access to the data directory to only the XWiki process.
- Regularly audit job status files for sensitive data.
Workarounds:
- If patching is not immediately possible, disable PDF export functionality.
- Use a web application firewall (WAF) to block access to job status files.
Valters IT
Securing Digital Frontiers