VAITP Dataset

← Back to the dataset

CVE-2020-11057

XWiki Platform 7.2-11.10.2: Registered users can run Python/Groovy scripts in personal dashboards. Fixed in 11.3.7, 11.10.3, 12.0

  • CVSS 8.8
  • CWE-94 Improper Control of Generation of Code ('Code Injection')
  • Input Validation and Sanitization
  • Remote

In XWiki Platform 7.2 through 11.10.2, registered users without scripting/programming permissions are able to execute python/groovy scripts while editing personal dashboards. This has been fixed 11.3.7 , 11.10.3 and 12.0.

CVSS base score
8.8
Published
2020-05-12
OWASP
A07 Identification and Authentication 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
Affected component
XWiki Platform
Fixed by upgrading
Yes

Solution

Update to XWiki Platform version 11.3.7 or higher.

Vulnerable code sample

class User:
    def __init__(self, username, has_scripting_permissions):
        self.username = username
        self.has_scripting_permissions = has_scripting_permissions

class DashboardEditor:
    def __init__(self, user):
        self.user = user

    def edit_dashboard(self, script):
        # Vulnerability: No permission check before executing the script
        self.execute_script(script)

    def execute_script(self, script):
        # Implementation of script execution
        print(f"Executing script: {script}")

# Example usage
user_without_permission = User("guest", False)
editor = DashboardEditor(user_without_permission)

# This will execute the script despite the user not having permissions
editor.edit_dashboard("print('Hello, Guest! This should not be allowed.')")

Patched code sample

# Example of a fix for CVE-2020-11057
class User:
    def __init__(self, username, has_scripting_permissions):
        self.username = username
        self.has_scripting_permissions = has_scripting_permissions

class DashboardEditor:
    def __init__(self, user):
        self.user = user

    def edit_dashboard(self, script):
        if self.user.has_scripting_permissions:
            # Allow execution of the script
            self.execute_script(script)
        else:
            raise PermissionError("You do not have permission to execute scripts.")

    def execute_script(self, script):
        # Implementation of script execution
        print(f"Executing script: {script}")

# Example usage
user_with_permission = User("admin", True)
user_without_permission = User("guest", False)

editor_with_permission = DashboardEditor(user_with_permission)
editor_without_permission = DashboardEditor(user_without_permission)

# This will execute the script
editor_with_permission.edit_dashboard("print('Hello, Admin!')")

# This will raise a PermissionError
editor_without_permission.edit_dashboard("print('Hello, Guest!')")

Cite this entry

@misc{vaitp:cve202011057,
  title        = {{XWiki Platform 7.2-11.10.2: Registered users can run Python/Groovy scripts in personal dashboards. Fixed in 11.3.7, 11.10.3, 12.0}},
  author       = {Bogaerts, Fr\'ed\'eric and Ivaki, Naghmeh and Fonseca, Jos\'e},
  year         = {2020},
  note         = {VAITP Python Vulnerability Dataset, entry CVE-2020-11057},
  howpublished = {\url{https://netpack.pt/vaitp/vulnerability/CVE-2020-11057/}}
}

Download this entry as JSON Download the whole dataset

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 ::

Before you use the VAITP AI models

Please read and accept the following disclaimer:

By choosing "I understand and accept", you acknowledge that you understand and agree to these terms.