VAITP Dataset

← Back to the dataset

CVE-2023-37914

XWiki Platform allows remote code execution via script macros

  • CVSS 8.8
  • CWE-94 Improper Control of Generation of Code ('Code 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 view `Invitation.WebHome` 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. This vulnerability has been patched on XWiki 14.4.8, 15.2-rc-1, and 14.10.6. Users are advised to upgrade. Users unable to upgrade may manually apply the patch on `Invitation.InvitationCommon` and `Invitation.InvitationConfig`, but there are otherwise no known workarounds for this vulnerability.

CVSS base score
8.8
Published
2023-08-17
OWASP
A08 Software and Data Integrity Failures
Orthogonal defect classification
Function
Code defect classification
Incorrect Functionality
Category
Input Validation and Sanitization
Subcategory
Insecure Direct Object References (IDOR)
Accessibility scope
Remote
Impact
Arbitrary Code Execution
Fixed by upgrading
Yes

Solution

Upgrade XWiki to version 14.4.8, 15.2-rc-1, or 14.10.6.

Vulnerable code sample

def execute_macro(macro_code):
    """Vulnerable function that demonstrates the security issue."""
    exec(macro_code)

macro_input = "import os; os.system('echo Vulnerable!')"
execute_macro(macro_input)

Patched code sample

import ast

def execute_macro(macro_code):
    """Secure function that fixes the vulnerability."""
    try:
        result = ast.literal_eval(macro_code)
        print(f"Macro result: {result}")
        return result
    except Exception:
        raise ValueError("Invalid or unsafe macro code.")

macro_input = "import os; os.system('echo Vulnerable!')"
execute_macro(macro_input)

Cite this entry

@misc{vaitp:cve202337914,
  title        = {{XWiki Platform allows remote code execution via script macros}},
  author       = {Bogaerts, Fr\'ed\'eric and Ivaki, Naghmeh and Fonseca, Jos\'e},
  year         = {2023},
  note         = {VAITP Python Vulnerability Dataset, entry CVE-2023-37914},
  howpublished = {\url{https://netpack.pt/vaitp/vulnerability/CVE-2023-37914/}}
}
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 ::