VAITP Dataset

← Back to the dataset

CVE-2021-39271

OrbiTeam BSCW Classic < 7.4.3 RCE via malicious .bscw file

  • CVSS 8.8
  • CWE-77: Improper Neutralization of Special Elements used in a Command ('Command Injection')
  • Input Validation and Sanitization
  • Remote

OrbiTeam BSCW Classic before 7.4.3 allows authenticated remote code execution (RCE) during archive extraction via attacker-supplied Python code in the class attribute of a .bscw file. This is fixed in 5.0.12, 5.1.10, 5.2.4, 7.3.3, and 7.4.3.

CVSS base score
8.8
Published
2021-08-30
OWASP
A08 Software and Data Integrity Failures
Orthogonal defect classification
Function
Code defect classification
Incorrect Functionality
Category
Input Validation and Sanitization
Subcategory
Command Injection
Accessibility scope
Remote
Impact
Arbitrary Code Execution
Affected component
Python
Fixed by upgrading
Yes

Solution

Update to BSCW Classic version 7.4.3 or higher.

Vulnerable code sample

import zipfile

def vulnerable_extract(zip_file, extract_to):
    with zipfile.ZipFile(zip_file) as zf:
        zf.extractall(path=extract_to)

# Usage
vulnerable_extract('example.bscw', '/extraction/path')

Patched code sample

import zipfile
import os

def safe_extract(zip_file, extract_to):
    # Ensure the extraction path is safe
    if not os.path.exists(extract_to):
        os.makedirs(extract_to)

    with zipfile.ZipFile(zip_file) as zf:
        for member in zf.namelist():
            # Prevent directory traversal attacks
            if os.path.commonpath([extract_to, os.path.join(extract_to, member)]) != extract_to:
                raise Exception("Attempted Path Traversal in Zip File")
        
        zf.extractall(path=extract_to)

# Usage
safe_extract('example.bscw', '/safe/extraction/path')

Cite this entry

@misc{vaitp:cve202139271,
  title        = {{OrbiTeam BSCW Classic < 7.4.3 RCE via malicious .bscw file}},
  author       = {Bogaerts, Fr\'ed\'eric and Ivaki, Naghmeh and Fonseca, Jos\'e},
  year         = {2021},
  note         = {VAITP Python Vulnerability Dataset, entry CVE-2021-39271},
  howpublished = {\url{https://netpack.pt/vaitp/vulnerability/CVE-2021-39271/}}
}

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.