VAITP Dataset

← Back to the dataset

CVE-2008-1679

Multiple integer overflows in imageop.c in Python before 2.5.3

  • CVSS 6.8
  • CWE-190
  • Numeric Errors
  • Local

Multiple integer overflows in imageop.c in Python before 2.5.3 allow context-dependent attackers to cause a denial of service (crash) and possibly execute arbitrary code via crafted images that trigger heap-based buffer overflows. NOTE: this issue is due to an incomplete fix for CVE-2007-4965.

CVSS base score
6.8
Published
2008-04-22
OWASP
A08 Software and Data Integrity Failures
Orthogonal defect classification
Function
Code defect classification
Incorrect Functionality
Category
Numeric Errors
Subcategory
Integer Overflows
Accessibility scope
Local
Impact
Denial of Service (DoS), Arbitrary Code Execution
Fixed by upgrading
Yes

Solution

Upgrade to Python 2.5.3 or higher.

Vulnerable code sample

import imageop

def image_processing(image_data):
    processed_image = imageop.some_image_operation(image_data)
    return processed_image

crafted_image_data = b'\x00' * (2**32)
image_processing(crafted_image_data)

Patched code sample

import imageop

MAX_IMAGE_SIZE = 1024 * 1024

def image_processing(image_data):
    try:
        if len(image_data) <= 0 or len(image_data) > MAX_IMAGE_SIZE:
            raise ValueError("Invalid image data size")

        processed_image = imageop.some_image_operation(image_data)
        return processed_image
    except Exception as e:
        print(f"Error processing image: {e}")

crafted_image_data = b'\x00' * (2**32)
image_processing(crafted_image_data)

Cite this entry

@misc{vaitp:cve20081679,
  title        = {{Multiple integer overflows in imageop.c in Python before 2.5.3}},
  author       = {Bogaerts, Fr\'ed\'eric and Ivaki, Naghmeh and Fonseca, Jos\'e},
  year         = {2008},
  note         = {VAITP Python Vulnerability Dataset, entry CVE-2008-1679},
  howpublished = {\url{https://netpack.pt/vaitp/vulnerability/CVE-2008-1679/}}
}
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 ::