Application/Framework Misconfiguration
Overview
Misconfigurations in application frameworks can lead to serious security vulnerabilities that attackers can exploit. This page lists common misconfigurations detected by BugZ along with their descriptions, severity levels, and best practices for mitigation. BugZ detects these misconfigurations by analyzing the codebase for patterns indicative of insecure practices. By addressing these issues and following best practices, developers can significantly reduce the risk of security breaches and protect their applications from exploitation.
Vulnerabilities
6001: flask_debug_true
- Description: Test for use of Flask app with debug set to true. Running Flask applications in debug mode results in the Werkzeug debugger being enabled. This includes a feature that allows arbitrary code execution. Documentation for both Flask 1 and Werkzeug 2 strongly suggests that debug mode should never be enabled on production systems.
- Severity: High
- CWE: CWE-94 (opens in a new tab)
- Reference Links:
6002: tarfile_unsafe_members
- Description: Test for
tarfile.extractall. This plugin will look for usage oftarfile.extractall(). Severity is set based on how themembersargument is handled.tarfile.extractall(members=function(tarfile)): LOWtarfile.extractall(members=?)(member is not a function): MEDIUMtarfile.extractall()(members from the archive is trusted): HIGH
- Severity: High
- CWE: CWE-22 (opens in a new tab)
- Reference Links:
Best Practices
- Flask Debug Mode: Avoid running Flask applications in debug mode (
debug=True) in production environments to prevent the exposure of the Werkzeug debugger and potential execution of arbitrary code. Setdebug=Falsein production configurations. - Tarfile Extraction: When using
tarfile.extractall(), always validate and discard dangerous members from the archive. Implement a function to inspect each member and discard files that contain directory traversal sequences or other potentially harmful content. Only extract trusted members from the archive.
By incorporating these best practices and BugZ into their development processes, developers can enhance the security of their applications and protect against Misconfiguration vulnerabilities effectively.