VAITP Dataset

← Back to the dataset

CVE-2004-0096

Denial of service in mod_python 2.7.9 (CAN-2003-0973 variant)

  • CVSS 5.0
  • CWE-400: Uncontrolled Resource Consumption
  • Resource Management
  • Remote

Unknown vulnerability in mod_python 2.7.9 allows remote attackers to cause a denial of service (httpd crash) via a certain query string, a variant of CAN-2003-0973.

CVSS base score
5.0
Published
2004-03-03
OWASP
A03 Injection
Orthogonal defect classification
Function
Code defect classification
Incorrect Functionality
Category
Resource Management
Subcategory
Resource Exhaustion
Accessibility scope
Remote
Impact
Denial of Service (DoS)
Fixed by upgrading
Yes

Solution

Update mod_python to version 3.5.0 or higher

Vulnerable code sample

from mod_python import apache

def handler(req):
    query_string = req.args

    req.write("Processing query string: " + query_string)

    return apache.OK

Patched code sample

from mod_python import apache

def handler(req):
    try:
        query_string = req.args
        if not is_valid_query_string(query_string):
            raise ValueError("Invalid query string")

        req.write("Query string processed successfully.")
    except Exception as e:
        req.log_error(f"Error processing request: {str(e)}")
        req.status = apache.HTTP_INTERNAL_SERVER_ERROR
        req.write("Internal Server Error")
        return apache.DONE

    return apache.OK

def is_valid_query_string(query_string):
    if len(query_string) > 1000:
        return False
    return True

Cite this entry

@misc{vaitp:cve20040096,
  title        = {{Denial of service in mod_python 2.7.9 (CAN-2003-0973 variant)}},
  author       = {Bogaerts, Fr\'ed\'eric and Ivaki, Naghmeh and Fonseca, Jos\'e},
  year         = {2004},
  note         = {VAITP Python Vulnerability Dataset, entry CVE-2004-0096},
  howpublished = {\url{https://netpack.pt/vaitp/vulnerability/CVE-2004-0096/}}
}
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 ::