CVE-2023-35158

9.6 CRITICAL

📋 TL;DR

This is a cross-site scripting (XSS) vulnerability in XWiki Platform that allows attackers to inject malicious JavaScript via specially crafted URLs. The vulnerability affects the restore template functionality and can be exploited by any user who can access the vulnerable XWiki instance. This impacts all XWiki installations running affected versions.

💻 Affected Systems

Products:
  • XWiki Platform
Versions: XWiki 9.4-rc-1 through 14.10.4, and 15.0.0 through 15.0.0
Operating Systems: All
Default Config Vulnerable: ⚠️ Yes
Notes: All XWiki installations using affected versions are vulnerable by default. The vulnerability exists in the core platform.

📦 What is this software?

⚠️ Risk & Real-World Impact

🔴

Worst Case

Complete compromise of user sessions, account takeover, data theft, and potential server-side compromise if combined with other vulnerabilities.

🟠

Likely Case

Session hijacking, credential theft, defacement, and client-side data exfiltration from users who visit malicious links.

🟢

If Mitigated

Limited impact if proper Content Security Policy (CSP) headers are implemented and user input validation is enforced.

🌐 Internet-Facing: HIGH
🏢 Internal Only: MEDIUM

🎯 Exploit Status

Public PoC: ⚠️ Yes
Weaponized: LIKELY
Unauthenticated Exploit: ⚠️ Yes
Complexity: LOW

Exploit details and example URLs are publicly available in the advisory. The vulnerability requires user interaction (clicking a malicious link).

🛠️ Fix & Mitigation

✅ Official Fix

Patch Version: XWiki 14.10.5 and 15.1-rc-1

Vendor Advisory: https://github.com/xwiki/xwiki-platform/security/advisories/GHSA-mwxj-g7fw-7hc8

Restart Required: Yes

Instructions:

1. Backup your XWiki installation. 2. Upgrade to XWiki 14.10.5 or 15.1-rc-1. 3. Restart the XWiki application server. 4. Verify the fix by checking the version.

🔧 Temporary Workarounds

Input Validation Filter

all

Implement server-side validation to reject URLs containing javascript: protocol in xredirect parameter

Configure web application firewall rules to block requests with javascript: in URL parameters

Content Security Policy

all

Implement strict CSP headers to prevent script execution from untrusted sources

Add 'Content-Security-Policy: script-src 'self'' to HTTP headers

🧯 If You Can't Patch

  • Implement strict Content Security Policy headers to block inline scripts
  • Deploy WAF rules to block requests containing javascript: protocol in parameters

🔍 How to Verify

Check if Vulnerable:

Check if your XWiki version is between 9.4-rc-1 and 14.10.4, or exactly 15.0.0. Test with a safe payload: /xwiki/bin/view/XWiki/Main?xpage=restore&showBatch=true&xredirect=javascript:console.log('test')

Check Version:

Check XWiki administration panel or view /xwiki/bin/view/Main/WebHome page footer for version information

Verify Fix Applied:

After patching, attempt the exploit URL and verify JavaScript is not executed. Check that xredirect parameter properly validates URLs.

📡 Detection & Monitoring

Log Indicators:

  • HTTP requests containing 'xpage=restore' with 'xredirect=javascript:' in URL parameters
  • Unusual JavaScript execution errors in browser console logs

Network Indicators:

  • HTTP GET requests with javascript: protocol in query parameters
  • Outbound connections to suspicious domains following XWiki access

SIEM Query:

http.url:*xpage=restore* AND http.url:*xredirect=javascript:*

🔗 References

📤 Share & Export