VAITP Dataset

← Back to the dataset

CVE-2007-1359

ModSecurity 2.1.0 and earlier ASCII 0x00 in POST data bypasses rules

  • CVSS 6.8
  • CWE-20: Improper Input Validation
  • Input Validation and Sanitization
  • Remote

Interpretation conflict in ModSecurity (mod_security) 2.1.0 and earlier allows remote attackers to bypass request rules via application/x-www-form-urlencoded POST data that contains an ASCIIZ (0x00) byte, which mod_security treats as a terminator even though it is still processed as normal data by some HTTP parsers including PHP 5.2.0, and possibly parsers in Perl, and Python.

CVSS base score
6.8
Published
2007-03-08
OWASP
A03 Injection
Orthogonal defect classification
Function
Code defect classification
Incorrect Functionality
Category
Input Validation and Sanitization
Subcategory
Insecure Parsing or Deserialization
Accessibility scope
Remote
Impact
Unauthorized Access
Fixed by upgrading
Yes

Solution

Update ModSecurity to version 2.1.1 or higher.

Vulnerable code sample

from flask import Flask, request

app = Flask(__name__)

@app.route('/submit', methods=['POST'])
def submit():
    form_data = request.form.to_dict()
    
    print("Received data:", form_data)

    return "Data processed successfully", 200

if __name__ == '__main__':
    app.run()

Patched code sample

from flask import Flask, request

app = Flask(__name__)

@app.route('/submit', methods=['POST'])
def submit():

    raw_data = request.data

    if b'\x00' in raw_data:
        return "Invalid input: Null byte detected", 400

    form_data = request.form.to_dict()

    return "Data processed successfully", 200

if __name__ == '__main__':
    app.run()

Cite this entry

@misc{vaitp:cve20071359,
  title        = {{ModSecurity 2.1.0 and earlier ASCII 0x00 in POST data bypasses rules}},
  author       = {Bogaerts, Fr\'ed\'eric and Ivaki, Naghmeh and Fonseca, Jos\'e},
  year         = {2007},
  note         = {VAITP Python Vulnerability Dataset, entry CVE-2007-1359},
  howpublished = {\url{https://netpack.pt/vaitp/vulnerability/CVE-2007-1359/}}
}
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 ::