CVE-2008-0982
Spyce 2.1.3 info disclosure via error message
- CVSS 5.8
- CWE-20 Improper Input Validation
- Information Leakage
- Remote
Spyce – Python Server Pages (PSP) 2.1.3 allows remote attackers to obtain sensitive information via a direct request for spyce/examples/automaton.spy, which reveals the path in an error message.
- CVSS base score
- 5.8
- Published
- 2008-02-25
- OWASP
- A05 Security Misconfiguration
- Orthogonal defect classification
- Checking
- Code defect classification
- Incorrect Check
- Category
- Information Leakage
- Subcategory
- Information Disclosure
- Accessibility scope
- Remote
- Impact
- Information Disclosure
- Affected component
- Spyce
- Fixed by upgrading
- Yes
Solution
Update Spyce to version 2.1.4 or higher.
Vulnerable code sample
# Example of the vulnerable code allowing direct access to example files
from flask import Flask
app = Flask(__name__)
@app.route('/spyce/examples/<filename>')
def serve_example(filename):
# Directly serve example files without restrictions
file_path = f'spyce/examples/{filename}'
return open(file_path).read() # Vulnerable to exposing sensitive information
if __name__ == '__main__':
app.run()Patched code sample
# Example of fixing the vulnerability by restricting access to example files
import os
from flask import Flask, abort
app = Flask(__name__)
@app.route('/spyce/examples/<filename>')
def serve_example(filename):
# Restrict access to example files
if filename == 'automaton.spy':
abort(403) # Forbidden
# Serve other files if necessary
file_path = os.path.join('spyce/examples', filename)
if os.path.isfile(file_path):
return open(file_path).read()
else:
abort(404) # Not Found
if __name__ == '__main__':
app.run()Cite this entry
@misc{vaitp:cve20080982,
title = {{Spyce 2.1.3 info disclosure via error message}},
author = {Bogaerts, Fr\'ed\'eric and Ivaki, Naghmeh and Fonseca, Jos\'e},
year = {2008},
note = {VAITP Python Vulnerability Dataset, entry CVE-2008-0982},
howpublished = {\url{https://netpack.pt/vaitp/vulnerability/CVE-2008-0982/}}
}
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 ::
