CVE-2023-29509
📋 TL;DR
This vulnerability allows any user with view rights on commonly accessible documents to execute arbitrary Groovy, Python, or Velocity code in XWiki, leading to full administrative access to the XWiki installation. The issue stems from improper escaping of the documentTree macro parameters in a default-installed page. All XWiki installations with the vulnerable versions are affected.
💻 Affected Systems
- XWiki Commons
- XWiki Platform
📦 What is this software?
Xwiki by Xwiki
Xwiki by Xwiki
Xwiki by Xwiki
⚠️ Risk & Real-World Impact
Worst Case
Full compromise of the XWiki installation with complete administrative access, data theft, and potential lateral movement to connected systems.
Likely Case
Remote code execution leading to complete control over the XWiki instance, data exfiltration, and installation of backdoors.
If Mitigated
Limited impact if proper network segmentation and least privilege access controls are implemented, though code execution would still be possible.
🎯 Exploit Status
Exploitation requires only view rights on commonly accessible documents, making it accessible to most users. The vulnerability is well-documented in public advisories.
🛠️ Fix & Mitigation
✅ Official Fix
Patch Version: XWiki 13.10.11, 14.4.7, or 14.10
Vendor Advisory: https://github.com/xwiki/xwiki-platform/security/advisories/GHSA-f4v8-58f6-mwj4
Restart Required: Yes
Instructions:
1. Backup your XWiki installation and database. 2. Upgrade to XWiki 13.10.11, 14.4.7, or 14.10. 3. Restart the XWiki application server. 4. Verify the fix by checking the version and testing the vulnerability.
🔧 Temporary Workarounds
Remove vulnerable macro
allDelete or restrict access to the FlamingoThemesCode.WebHome page containing the vulnerable documentTree macro
Access XWiki administration interface
Navigate to FlamingoThemesCode.WebHome
Delete or modify permissions
Restrict view permissions
allApply strict view permissions to limit access to commonly accessible documents
Access XWiki rights management
Review and restrict view permissions on all documents
Apply principle of least privilege
🧯 If You Can't Patch
- Implement strict network segmentation to isolate XWiki from critical systems
- Apply aggressive monitoring and alerting for suspicious activity and code execution attempts
🔍 How to Verify
Check if Vulnerable:
Check XWiki version against affected versions. Review if FlamingoThemesCode.WebHome page exists with default permissions.
Check Version:
Check XWiki administration panel or view the XWiki version in the web interface footer.
Verify Fix Applied:
Verify XWiki version is 13.10.11, 14.4.7, or 14.10 or later. Test that documentTree macro no longer allows code injection.
📡 Detection & Monitoring
Log Indicators:
- Unusual Groovy, Python, or Velocity script execution
- Unexpected administrative actions
- Suspicious document modifications
Network Indicators:
- Unusual outbound connections from XWiki server
- Data exfiltration patterns
SIEM Query:
source="xwiki" AND ("Groovy" OR "Python" OR "Velocity") AND event_type="code_execution"
🔗 References
- https://github.com/xwiki/xwiki-platform/commit/80d5be36f700adcd56b6c8eb3ed8b973f62ec0ae
- https://github.com/xwiki/xwiki-platform/security/advisories/GHSA-f4v8-58f6-mwj4
- https://jira.xwiki.org/browse/XWIKI-20279
- https://github.com/xwiki/xwiki-platform/commit/80d5be36f700adcd56b6c8eb3ed8b973f62ec0ae
- https://github.com/xwiki/xwiki-platform/security/advisories/GHSA-f4v8-58f6-mwj4
- https://jira.xwiki.org/browse/XWIKI-20279