VAITP Dataset

← Back to the dataset

CVE-2014-2331

Check_MK versions 1.2.2p2, 1.2.2p3, and 1.2.3i5 allow remote authenticated users to execute arbitrary Python code via a crafted rules.mk file

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

Check_MK 1.2.2p2, 1.2.2p3, and 1.2.3i5 allows remote authenticated users to execute arbitrary Python code via a crafted rules.mk file in a snapshot. NOTE: this can be exploited by remote attackers by leveraging CVE-2014-2330.

CVSS base score
8.5
Published
2015-08-31
OWASP
A07 Identification and Authentication 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
Check_MK
Fixed by upgrading
Yes

Solution

Update Check_MK to version 1.2.3i6 or higher.

Vulnerable code sample

def load_rules(file_path):
    with open(file_path, 'r') as file:
        content = file.read()
    # Use eval to load the rules, which allows execution of arbitrary Python code
    rules = eval(content)
    return rules

# Example usage
# rules = load_rules('rules.mk')

Patched code sample

import ast

def safe_load_rules(file_path):
    with open(file_path, 'r') as file:
        content = file.read()
    # Use ast.literal_eval to safely evaluate the content
    try:
        rules = ast.literal_eval(content)
    except (SyntaxError, ValueError):
        raise ValueError("Invalid rules format")
    return rules

# Example usage
# rules = safe_load_rules('rules.mk')

Cite this entry

@misc{vaitp:cve20142331,
  title        = {{Check_MK versions 1.2.2p2, 1.2.2p3, and 1.2.3i5 allow remote authenticated users to execute arbitrary Python code via a crafted rules.mk file}},
  author       = {Bogaerts, Fr\'ed\'eric and Ivaki, Naghmeh and Fonseca, Jos\'e},
  year         = {2015},
  note         = {VAITP Python Vulnerability Dataset, entry CVE-2014-2331},
  howpublished = {\url{https://netpack.pt/vaitp/vulnerability/CVE-2014-2331/}}
}

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.