VAITP Dataset

← Back to the dataset

CVE-2025-20233

Splunk App < 4.0.5 allows low-privilege users broad read/execute access.

  • CVSS 3.3
  • CWE-732
  • Configuration Issues
  • Local

In the Splunk App for Lookup File Editing versions below 4.0.5, a script in the app used the `chmod` and `makedirs` Python functions in a way that resulted in overly broad read and execute permissions. This could lead to improper access control for a low-privileged user.

CVSS base score
3.3
Published
2025-03-26
OWASP
A01 Broken Access Control
Orthogonal defect classification
Interface
Code defect classification
Incorrect Check
Category
Configuration Issues
Subcategory
Poorly Designed Access Controls
Accessibility scope
Local
Impact
Privilege Escalation
Affected component
Python

Solution

Upgrade to version 4.0.5 or later.

Vulnerable code sample

import os
import os.path

def create_directory_with_permissions(path):
    """
    Creates a directory at the given path with broad permissions.
    This is a simplified example of the vulnerability described in CVE-2025-20233.
    """
    try:
        os.makedirs(path, exist_ok=True)
        os.chmod(path, 0o777)  # Read, write, and execute for everyone! Vulnerability!
    except OSError as e:
        print(f"Error creating directory: {e}")

# Example Usage:
directory_path = "/opt/splunk/etc/apps/lookup_editor/lookups/new_directory"
create_directory_with_permissions(directory_path)

def create_file_with_permissions(file_path):
    """
    Creates an empty file at the given path with broad permissions.
    This demonstrates how file permissions could be set incorrectly.
    """
    try:
        with open(file_path, 'w') as f:
            f.write("") # Creates an empty file
        os.chmod(file_path, 0o777)
    except OSError as e:
        print(f"Error creating file: {e}")

# Example Usage:
file_path = "/opt/splunk/etc/apps/lookup_editor/lookups/new_file.csv"
create_file_with_permissions(file_path)

Patched code sample

import os
import stat

def create_directory_securely(path, mode=0o750):  # Restrictive default mode
    """
    Creates a directory with specified permissions securely, avoiding overly permissive modes.
    """
    try:
        os.makedirs(path, exist_ok=True) # Create if it does not exist

        # Explicitly set permissions after creation to avoid umask issues
        os.chmod(path, mode)
        print(f"Directory '{path}' created with permissions {oct(mode)}")

    except OSError as e:
        print(f"Error creating directory '{path}': {e}")


def create_file_securely(path, content, mode=0o640):  # Restrictive default mode
    """
    Creates a file and writes content to it with specified permissions securely.
    """
    try:
        with open(path, 'w') as f:
            f.write(content)

        # Explicitly set permissions after creation
        os.chmod(path, mode)
        print(f"File '{path}' created with permissions {oct(mode)}")

    except OSError as e:
        print(f"Error creating file '{path}': {e}")


# Example usage (demonstrating fix):
if __name__ == '__main__':
    directory_path = "secure_dir"
    file_path = os.path.join(directory_path, "secure_file.txt")

    # Create directory with restricted permissions (owner and group read/write/execute)
    create_directory_securely(directory_path)

    # Create file with restricted permissions (owner read/write, group read)
    create_file_securely(file_path, "This is some sensitive data.")


    # Example of what NOT to do (vulnerable code - DO NOT USE):
    # os.makedirs("insecure_dir", exist_ok=True)
    # os.chmod("insecure_dir", 0o777)  # World-readable and executable! DANGEROUS

Payload

import os

# Assuming the vulnerable code uses something like this:
# filepath = os.path.join("/opt/splunk/etc/apps/lookup_editor/lookups", filename)
# os.makedirs(os.path.dirname(filepath), exist_ok=True)
# os.chmod(filepath, 0o777) # Vulnerable line

filename = "../../etc/passwd"  # Attempt to create a "lookup" file that overwrites /etc/passwd (or similar sensitive file)

# OR, to create a directory with overly permissive access
filename = "owned_directory/.owned"

Cite this entry

@misc{vaitp:cve202520233,
  title        = {{Splunk App < 4.0.5 allows low-privilege users broad read/execute access.
}},
  author       = {Bogaerts, Fr\'ed\'eric and Ivaki, Naghmeh and Fonseca, Jos\'e},
  year         = {2025},
  note         = {VAITP Python Vulnerability Dataset, entry CVE-2025-20233},
  howpublished = {\url{https://netpack.pt/vaitp/vulnerability/CVE-2025-20233/}}
}
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 ::