InvokeAI has External Control of File Name or Path
The bulk downloads API in InvokeAI concatenated a user-supplied file name into a filesystem path without canonicalisation, allowing an unauthenticated attacker to read files outside the media directory. In some storage configurations, the same flaw could also overwrite or delete files referenced by the crafted path.
invoke-ai/invokeai
Originally disclosed on huntr
Path Traversal Vulnerability in InvokeAI
A path traversal vulnerability in InvokeAI (versions < 6.7.0) allows an unauthenticated remote attacker to read files outside the intended media directory via the bulk downloads API.
The endpoint accepts a user-controlled file/item name and concatenates it into a filesystem path without proper canonicalization or allow-listing. By supplying sequences such as ../ (or absolute paths), an attacker can cause the server to traverse directories and return arbitrary files.
In certain storage or back-end configurations, abusing attacker-controlled paths can also lead to unintended overwriting or deletion of files referenced by the crafted path.
The issue is fixed in 6.7.0, which normalizes and validates input paths and rejects traversal attempts.
Affected versions: < 6.7.0
Patched version: 6.7.0
From the GitHub Advisory Database (GHSA-vv9c-xxg7-wmv7, CC BY 4.0).
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
How it worked
Root cause
The endpoint concatenated a user-controlled item name into a filesystem path without canonicalisation or an allow-list, so traversal sequences or absolute paths escaped the media directory.
Impact
An unauthenticated attacker could read arbitrary files outside the media directory, and in certain storage or back-end configurations could also overwrite or delete files referenced by the crafted path.
What the attacker needed
No authentication required; reachable bulk downloads API
The fix
It was fixed in 6.7.0 by normalising and validating input paths and rejecting traversal attempts.
Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
A web server stores user files in a folder and builds the path by joining a folder name with a name supplied by the user. If the user supplies a name containing '..' (which means 'go up one folder'), the server can be tricked into reading files from elsewhere on the disk. This is called path traversal, and here it needed no login at all.
What is Path traversal?
Input that builds a file path escapes the intended folder, reading or writing files the application should never touch.