CVE-2015-5306
Remote code execution via OpenStack Ironic Inspector debug mode
- CVSS 6.8
- CWE-254
- Input Validation and Sanitization
- Remote
OpenStack Ironic Inspector (aka ironic-inspector or ironic-discoverd), when debug mode is enabled, might allow remote attackers to access the Flask console and execute arbitrary Python code by triggering an error.
- CWE
- CWE-254
- CVSS base score
- 6.8
- Published
- 2015-11-25
- 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
- Arbitrary Code Execution
- Affected component
- Flask
- Fixed by upgrading
- Yes
Solution
Update OpenStack Ironic Inspector to the latest version.
Vulnerable code sample
from flask import Flask, request
app = Flask(__name__)
# Debug mode enabled, which can expose the interactive debugger
app.debug = True
@app.route('/some_endpoint', methods=['GET'])
def some_endpoint():
# Example code that may raise an exception
raise Exception("An intentional error for demonstration.")
if __name__ == '__main__':
app.run()Patched code sample
from flask import Flask, request, jsonify
import logging
app = Flask(__name__)
# Disable debug mode in production
app.debug = False
@app.route('/some_endpoint', methods=['GET'])
def some_endpoint():
try:
# Your endpoint logic here
return jsonify({"message": "Success"}), 200
except Exception as e:
logging.error(f"An error occurred: {e}")
return jsonify({"error": "An internal error occurred."}), 500
if __name__ == '__main__':
app.run()Cite this entry
@misc{vaitp:cve20155306,
title = {{Remote code execution via OpenStack Ironic Inspector debug mode}},
author = {Bogaerts, Fr\'ed\'eric and Ivaki, Naghmeh and Fonseca, Jos\'e},
year = {2015},
note = {VAITP Python Vulnerability Dataset, entry CVE-2015-5306},
howpublished = {\url{https://netpack.pt/vaitp/vulnerability/CVE-2015-5306/}}
}
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 ::
