CVE-2023-40176

9.0 CRITICAL

📋 TL;DR

This stored XSS vulnerability in XWiki Platform allows any registered user to inject malicious JavaScript into their time zone preference, which executes when other users view their profile. Attackers can steal session cookies, perform actions as victims, and potentially escalate to programming rights. All XWiki instances with versions from 4.1M2 to before 14.10.5/15.1RC1 are affected.

💻 Affected Systems

Products:
  • XWiki Platform
Versions: 4.1M2 to 14.10.4, and 15.0 to 15.0
Operating Systems: All
Default Config Vulnerable: ⚠️ Yes
Notes: All XWiki installations with user registration enabled are vulnerable; the time zone preference is a standard feature.

📦 What is this software?

⚠️ Risk & Real-World Impact

🔴

Worst Case

Attacker gains programming rights through privilege escalation, takes full control of the XWiki instance, and compromises all user accounts and data.

🟠

Likely Case

Attacker steals session cookies or authentication tokens from administrators or other users, leading to account takeover and data theft.

🟢

If Mitigated

With proper input validation and output encoding, malicious scripts are neutralized, preventing execution and limiting impact to failed injection attempts.

🌐 Internet-Facing: HIGH
🏢 Internal Only: HIGH

🎯 Exploit Status

Public PoC: ✅ No
Weaponized: LIKELY
Unauthenticated Exploit: ✅ No
Complexity: LOW

Exploitation requires a registered user account; attackers can use browser developer tools or direct API calls to inject payloads.

🛠️ Fix & Mitigation

✅ Official Fix

Patch Version: 14.10.5 or 15.1RC1

Vendor Advisory: https://github.com/xwiki/xwiki-platform/security/advisories/GHSA-h8cm-3v5f-rgp6

Restart Required: Yes

Instructions:

1. Backup your XWiki instance. 2. Upgrade to XWiki 14.10.5 or 15.1RC1. 3. Restart the application server. 4. Verify the fix by checking the version and testing user profile time zone inputs.

🔧 Temporary Workarounds

Disable User Registration

all

Prevent new user registrations to block attackers from creating accounts to exploit this vulnerability.

Edit xwiki.cfg or web.xml to restrict registration; consult XWiki documentation for specific steps.

Apply Input Validation Filter

all

Implement a web application firewall (WAF) or custom filter to sanitize time zone parameter inputs.

Configure WAF rules to block malicious scripts in user profile parameters; example regex: /<script.*?>.*?<\/script>/i

🧯 If You Can't Patch

  • Restrict user profile access to trusted users only via access controls.
  • Monitor logs for suspicious time zone value changes and investigate anomalies.

🔍 How to Verify

Check if Vulnerable:

Check XWiki version via admin interface or by examining the application files; if version is between 4.1M2 and 14.10.4 or 15.0, it is vulnerable.

Check Version:

Check the XWiki admin dashboard or run: grep -r "xwiki.version" in the installation directory.

Verify Fix Applied:

After patching, attempt to inject a simple XSS payload (e.g., <script>alert('test')</script>) into the time zone field via developer tools; it should be escaped and not execute.

📡 Detection & Monitoring

Log Indicators:

  • Unusual time zone value updates in user profile logs, such as strings containing script tags or JavaScript code.

Network Indicators:

  • HTTP requests to user profile save URLs with suspicious query parameters (e.g., timezone parameter with script payloads).

SIEM Query:

source="xwiki.log" AND ("timezone" NEAR "script" OR "timezone" NEAR "javascript")

🔗 References

📤 Share & Export