VAITP Dataset

← Back to the dataset

CVE-2011-1156

Impact: Remote application crash

  • CVSS 5.0
  • CWE-399
  • Input Validation and Sanitization
  • Remote

feedparser.py in Universal Feed Parser (aka feedparser or python-feedparser) before 5.0.1 allows remote attackers to cause a denial of service (application crash) via a malformed DOCTYPE declaration.

CVSS base score
5.0
Published
2011-04-11
OWASP
A08 Software and Data Integrity Failures
Orthogonal defect classification
Function
Code defect classification
Incorrect Functionality
Category
Input Validation and Sanitization
Subcategory
Insecure Parsing or Deserialization
Accessibility scope
Remote
Impact
Denial of Service (DoS)
Affected component
feedparser
Fixed by upgrading
Yes

Solution

Update feedparser.py to version 5.0.1 or higher.

Vulnerable code sample

import feedparser

def vulnerable_parse(feed_url):
    # This simulates parsing a feed without any restrictions on DOCTYPE
    parsed_feed = feedparser.parse(feed_url)
    return parsed_feed

# Example usage with a potentially malicious feed URL
feed_url = "http://example.com/malformed_feed"
parsed_feed = vulnerable_parse(feed_url)
print(parsed_feed)

Patched code sample

import feedparser
from feedparser import FeedParserDict

def safe_parse(feed_url):
    # Create a custom FeedParserDict to override the default behavior
    class SafeFeedParserDict(FeedParserDict):
        def __init__(self):
            super().__init__()
            self.allow_doctype = False  # Disable DOCTYPE declarations

    # Use the safe parser
    parser = SafeFeedParserDict()
    return parser.parse(feed_url)

# Example usage
feed_url = "http://example.com/feed"
parsed_feed = safe_parse(feed_url)
print(parsed_feed)

Cite this entry

@misc{vaitp:cve20111156,
  title        = {{Impact: Remote application crash}},
  author       = {Bogaerts, Fr\'ed\'eric and Ivaki, Naghmeh and Fonseca, Jos\'e},
  year         = {2011},
  note         = {VAITP Python Vulnerability Dataset, entry CVE-2011-1156},
  howpublished = {\url{https://netpack.pt/vaitp/vulnerability/CVE-2011-1156/}}
}

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.