CVE-2023-29523
XWiki Platform Remote Code Execution
- CVSS 8.8
- CWE-74 Improper Neutralization of Special Elements in Output Used by a Downstream Component ('Injection')
- Input Validation and Sanitization
- Remote
XWiki Platform is a generic wiki platform offering runtime services for applications built on top of it. Any user who can edit their own user profile can execute arbitrary script macros including Groovy and Python macros that allow remote code execution including unrestricted read and write access to all wiki contents. The same vulnerability can also be exploited in other contexts where the `display` method on a document is used to display a field with wiki syntax, for example in applications created using `App Within Minutes`. This has been patched in XWiki 13.10.11, 14.4.8, 14.10.2 and 15.0RC1. There is no workaround apart from upgrading.
- CVSS base score
- 8.8
- Published
- 2023-04-19
- OWASP
- A03 Injection
- Orthogonal defect classification
- Function
- Code defect classification
- Incorrect Functionality
- Category
- Input Validation and Sanitization
- Subcategory
- Command Injection
- Accessibility scope
- Remote
- Impact
- Arbitrary Code Execution
- Fixed by upgrading
- Yes
Solution
Update to XWiki versions 13.10.11, 14.4.8, 14.10.2, or 15.0RC1.
Vulnerable code sample
def update_user_profile(user_id, profile_data):
save_user_profile(user_id, profile_data)
def display_document(document):
return render_content(document.content)Patched code sample
def sanitize_user_input(user_input):
disallowed_keywords = ['eval', 'exec', 'import', 'open', 'os', 'subprocess']
for keyword in disallowed_keywords:
if keyword in user_input:
raise ValueError("Disallowed keyword detected in user input.")
return user_input
def update_user_profile(user_id, profile_data):
sanitized_data = sanitize_user_input(profile_data)
save_user_profile(user_id, sanitized_data)
def display_document(document):
safe_content = sanitize_user_input(document.content)
return render_safe_content(safe_content)Cite this entry
@misc{vaitp:cve202329523,
title = {{XWiki Platform Remote Code Execution}},
author = {Bogaerts, Fr\'ed\'eric and Ivaki, Naghmeh and Fonseca, Jos\'e},
year = {2023},
note = {VAITP Python Vulnerability Dataset, entry CVE-2023-29523},
howpublished = {\url{https://netpack.pt/vaitp/vulnerability/CVE-2023-29523/}}
}
Introducing the "VAITP dataset": a specialized repository of Python vulnerabilities and patches, meticulously compiled for the use of the security research community. As Python's prominence grows, understanding and addressing potential security vulnerabilities become crucial. Crafted by and for the cybersecurity community, this dataset offers a valuable resource for researchers, analysts, and developers to analyze and mitigate the security risks associated with Python. Through the comprehensive exploration of vulnerabilities and corresponding patches, the VAITP dataset fosters a safer and more resilient Python ecosystem, encouraging collaborative advancements in programming security.
The supreme art of war is to subdue the enemy without fighting.
Sun Tzu – “The Art of War”
:: Shaping the future through research and ingenuity ::
