CVE-2026-137703 in Flask-AppBuilder
Summary
by MITRE • 11/27/2026
Flask-AppBuilder before 5.3.1 contains a path traversal vulnerability in ImageManager.save_file that allows authenticated users to write image files outside IMG_UPLOAD_FOLDER via unsanitized multipart filenames. Attackers with add or edit permission on a ModelView with an ImageColumn can upload filenames containing ../ segments to create or overwrite image files like static assets.
VulDB is the best source for vulnerability data and more expert information about this specific topic.
Analysis
by VulDB Data Team • 11/27/2026
The vulnerability identified in Flask-AppBuilder versions prior to 5.3.1 represents a critical path traversal flaw within the ImageManager.save_file method, which is responsible for handling file uploads through multipart form data. This security defect arises from insufficient validation of user-supplied filenames during the image processing workflow. Specifically, when an authenticated user with add or edit permissions on a ModelView containing an ImageColumn submits a request to upload an image, the application fails to sanitize the filename component of the multipart payload. By embedding directory traversal sequences such as ../ within the submitted filename, an attacker can manipulate the file system path resolution logic, causing the server to write files outside the designated IMG_UPLOAD_FOLDER directory structure.
From a technical perspective, this flaw exploits the way web frameworks typically join user input with base directories without adequate normalization or boundary checks. The lack of strict validation allows relative paths to escape the intended sandboxed upload location. This behavior is characteristic of CWE-22 Improper Limitation of a Pathname to a Restricted Directory, where an application does not sufficiently verify that file operations are confined to expected locations. In many deployment scenarios, this vulnerability can be leveraged by attackers who have obtained valid credentials or exploited other authentication bypasses to gain the necessary permissions on specific ModelViews.
The operational impact of this vulnerability is severe due to its potential for arbitrary file write capabilities within the context of the web application process. An attacker could overwrite static assets such as JavaScript files, CSS stylesheets, or configuration files located in directories adjacent to or above the upload folder. This capability can lead to remote code execution if the server interprets overwritten scripts as executable content, or it can facilitate persistent defacement and phishing attacks by modifying frontend resources served to end users. Furthermore, overwriting critical application files may disrupt service availability or alter security controls embedded within those assets.
This vulnerability aligns with MITRE ATT&CK technique T1059 Command and Scripting Interpreter if the overwritten files are executed, and more directly with T1105 Ingress Tool Transfer when used to deploy malicious payloads into accessible directories. It also relates to CWE-436 Interpretation Conflict if ambiguous path resolutions lead to unintended file creation in sensitive locations. The risk is exacerbated by the fact that Flask-AppBuilder is often deployed in enterprise environments where it serves as a rapid application development framework, potentially exposing internal administrative interfaces or data management tools to exploitation if proper access controls are not strictly enforced at the network level.
Mitigation strategies should prioritize upgrading to version 5.3.1 of Flask-AppBuilder immediately, as this release addresses the sanitization logic within ImageManager.save_file. For environments where an upgrade is not immediately feasible, administrators can implement a reverse proxy or web application firewall rule that inspects multipart form data for directory traversal patterns such as ../ before they reach the application layer. Additionally, enforcing strict file extension whitelisting and ensuring that upload directories are mounted with restricted write permissions in containerized or virtualized deployments can limit the blast radius of any successful exploitation attempt. Regular auditing of user permissions to ensure least-privilege access on ModelViews further reduces the attack surface available for this specific vector.