CVE-2024-45601
Vulnerability in Mesop allows unauthorized file access due to input validation issues.
- CVSS 7.5
- CWE-20
- Input Validation and Sanitization
- Remote
Mesop is a Python-based UI framework designed for rapid web apps development. A vulnerability has been discovered and fixed in Mesop that could potentially allow unauthorized access to files on the server hosting the Mesop application. The vulnerability was related to insufficient input validation in a specific endpoint. This could have allowed an attacker to access files not intended to be served. Users are strongly advised to update to the latest version of Mesop immediately. The latest version includes a fix for this vulnerability. At time of publication 0.12.4 is the most recently available version of Mesop.
- CWE
- CWE-20
- CVSS base score
- 7.5
- Published
- 2024-09-18
- OWASP
- A01 Broken Access Control
- Orthogonal defect classification
- Checking
- Code defect classification
- Missing Check
- Category
- Input Validation and Sanitization
- Subcategory
- Insecure Direct Object References (IDOR)
- Accessibility scope
- Remote
- Impact
- Unauthorized Access
- Affected component
- Mesop
- Fixed by upgrading
- Yes
Solution
Upgrade to version 0.12.4 or later.
Vulnerable code sample
from flask import Flask, send_from_directory
app = Flask(__name__)
@app.route('/files/<path:filename>', methods=['GET'])
def get_file(filename):
return send_from_directory('.', filename)
if __name__ == '__main__':
app.run()Patched code sample
from flask import Flask, request, abort, send_from_directory
import os
app = Flask(__name__)
SAFE_DIRECTORY = "/path/to/directory"
@app.route('/files/<path:filename>', methods=['GET'])
def get_file(filename):
if '..' in filename or filename.startswith('/'):
abort(403)
return send_from_directory(SAFE_DIRECTORY, filename)
if __name__ == '__main__':
app.run()Payload
/files/../../etc/passwd
Cite this entry
@misc{vaitp:cve202445601,
title = {{Vulnerability in Mesop allows unauthorized file access due to input validation issues.}},
author = {Bogaerts, Fr\'ed\'eric and Ivaki, Naghmeh and Fonseca, Jos\'e},
year = {2024},
note = {VAITP Python Vulnerability Dataset, entry CVE-2024-45601},
howpublished = {\url{https://netpack.pt/vaitp/vulnerability/CVE-2024-45601/}}
}
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 ::
