CVE-2011-1158
XSS in Universal Feed Parser 5.x (pre-5.0.1) via URI scheme
- CVSS 4.3
- CWE-79 Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')
- Configuration Issues
- Remote
Cross-site scripting (XSS) vulnerability in feedparser.py in Universal Feed Parser (aka feedparser or python-feedparser) 5.x before 5.0.1 allows remote attackers to inject arbitrary web script or HTML via an unexpected URI scheme, as demonstrated by a javascript: URI.
- CVSS base score
- 4.3
- Published
- 2011-04-11
- OWASP
- A03 Injection
- Orthogonal defect classification
- Function
- Code defect classification
- Incorrect Functionality
- Category
- Configuration Issues
- Subcategory
- Cross-Site Scripting (XSS)
- Accessibility scope
- Remote
- Impact
- Arbitrary Code Execution
- Affected component
- feedparser
- Fixed by upgrading
- Yes
Solution
Update Universal Feed Parser to version 5.0.1 or higher.
Vulnerable code sample
def parse_feed(uri):
# No validation of URI scheme
# This allows potentially dangerous URIs like 'javascript:'
# to be processed without any checks
# ...
print(f"Parsing feed from {uri}")
# Proceed with feed parsing logic
# ...Patched code sample
import re
def is_valid_uri(uri):
# Allow only specific URI schemes (http, https, ftp)
valid_schemes = ['http:', 'https:', 'ftp:']
scheme = uri.split(':', 1)[0] + ':'
return scheme in valid_schemes
def parse_feed(uri):
if not is_valid_uri(uri):
raise ValueError("Invalid URI scheme")
# Proceed with feed parsing logic
# ...Cite this entry
@misc{vaitp:cve20111158,
title = {{XSS in Universal Feed Parser 5.x (pre-5.0.1) via URI scheme}},
author = {Bogaerts, Fr\'ed\'eric and Ivaki, Naghmeh and Fonseca, Jos\'e},
year = {2011},
note = {VAITP Python Vulnerability Dataset, entry CVE-2011-1158},
howpublished = {\url{https://netpack.pt/vaitp/vulnerability/CVE-2011-1158/}}
}
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 ::
