InvokeAI Path Traversal Vulnerability Allowing Arbitrary File Deletion
Vulnerability
A path traversal vulnerability has been identified in InvokeAI versions through v6.0.0a1. This vulnerability allows attackers to manipulate filename arguments in the GET /api/v1/images/download/{bulk_download_item_name} endpoint, enabling them to read and delete any files on the server. This includes sensitive system files such as SSH keys, databases, and configuration files. The vulnerability arises because the endpoint does not properly validate file paths, allowing for unauthorized file access and deletion.
Impact
Exploitation of this vulnerability allows for unrestricted reading and deletion of files on the server, including critical system files. This leads to significant impacts on confidentiality, integrity, and availability.
Reproduction
To reproduce this vulnerability, send a GET request to the /api/v1/images/download/{bulk_download_item_name} endpoint. Manipulate the bulk_download_item_name parameter to include directory traversal sequences that navigate up the directory structure. This can be done by using encoded characters that represent the traversal sequences, such as '%5C' for backslashes. The request will return the contents of the targeted file and delete it from the server.
Vulnerability Rating
Our algorithm analyzes dozens of metrics to generate these 8 key vulnerability categories, which are then combined to calculate the overall risk score.
