VAITP Dataset

← Back to the dataset

CVE-2022-28696

Uncontrolled search path vulnerability in Intel Python < 2022.0.3 allows local privilege escalation

  • CVSS 7.8
  • CWE-427 Uncontrolled Search Path Element
  • Authentication, Authorization, and Session Management
  • Local

Uncontrolled search path in the Intel(R) Distribution for Python before version 2022.0.3 may allow an authenticated user to potentially enable escalation of privilege via local access.

CVSS base score
7.8
Published
2022-08-18
OWASP
A05 Security Misconfiguration
Orthogonal defect classification
Function
Code defect classification
Incorrect Functionality
Category
Authentication, Authorization, and Session Management
Subcategory
Privilege Escalation
Accessibility scope
Local
Impact
Privilege Escalation
Affected component
Intel Distribution for Python
Fixed by upgrading
Yes

Solution

Update Intel(R) Distribution for Python to version 2022.0.3 or higher.

Vulnerable code sample

import os
import sys

# Uncontrolled search path for imports
def unsafe_import(module_name):
    # Appending current directory to sys.path
    sys.path.append(os.getcwd())

    # Attempt to import the module
    try:
        module = __import__(module_name)
        return module
    except ImportError as e:
        print(f"Error importing module {module_name}: {e}")
        return None

# Example usage
if __name__ == "__main__":
    # Import a module without any restrictions
    my_module = unsafe_import('my_module')

Patched code sample

import os
import sys

# Securely define the search path for libraries
def secure_import(module_name):
    # Define a safe path for imports
    safe_path = '/usr/local/lib/python3.8/site-packages'  # Example path, adjust as needed
    if safe_path not in sys.path:
        sys.path.insert(0, safe_path)

    # Attempt to import the module
    try:
        module = __import__(module_name)
        return module
    except ImportError as e:
        print(f"Error importing module {module_name}: {e}")
        return None

# Example usage
if __name__ == "__main__":
    # Securely import a module
    my_module = secure_import('my_secure_module')

Cite this entry

@misc{vaitp:cve202228696,
  title        = {{Uncontrolled search path vulnerability in Intel Python < 2022.0.3 allows local privilege escalation}},
  author       = {Bogaerts, Fr\'ed\'eric and Ivaki, Naghmeh and Fonseca, Jos\'e},
  year         = {2022},
  note         = {VAITP Python Vulnerability Dataset, entry CVE-2022-28696},
  howpublished = {\url{https://netpack.pt/vaitp/vulnerability/CVE-2022-28696/}}
}

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.