VAITP Dataset

← Back to the dataset

CVE-2024-21644

pyLoad 0.5.0b3.dev77 allows unauthenticated access to Flask config, exposing SECRET_KEY

  • CVSS 7.5
  • CWE-284 Improper Access Control
  • Design Defects
  • Remote

pyLoad is the free and open-source Download Manager written in pure Python. Any unauthenticated user can browse to a specific URL to expose the Flask config, including the `SECRET_KEY` variable. This issue has been patched in version 0.5.0b3.dev77.

CVSS base score
7.5
Published
2024-01-08
OWASP
A05 Security Misconfiguration
Orthogonal defect classification
Checking
Code defect classification
Missing Check
Category
Design Defects
Subcategory
Security Misconfigurations
Accessibility scope
Remote
Impact
Information Disclosure
Fixed by upgrading
Yes

Solution

Update pyLoad to version 0.5.0b3.dev77 or later

Vulnerable code sample

from flask import Flask, jsonify

app = Flask(__name__)

app.secret_key = 'your-secret-key'

@app.route('/config', methods=['GET'])
def get_config():
    # VULNERABLE: This code is susceptible to deserialization
    return jsonify({'SECRET_KEY': app.secret_key})

if __name__ == '__main__':
    app.run()

Patched code sample

from flask import Flask, jsonify

app = Flask(__name__)

app.secret_key = 'your-secret-key'

@app.route('/config', methods=['GET'])
def get_config():
    # SECURE: This version prevents deserialization
    return jsonify({'message': 'Access denied'}), 403

if __name__ == '__main__':
    app.run()

Cite this entry

@misc{vaitp:cve202421644,
  title        = {{pyLoad 0.5.0b3.dev77 allows unauthenticated access to Flask config, exposing SECRET_KEY}},
  author       = {Bogaerts, Fr\'ed\'eric and Ivaki, Naghmeh and Fonseca, Jos\'e},
  year         = {2024},
  note         = {VAITP Python Vulnerability Dataset, entry CVE-2024-21644},
  howpublished = {\url{https://netpack.pt/vaitp/vulnerability/CVE-2024-21644/}}
}
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 ::