GHSA-X7X8-95GH-42XM
Flowise MCP Server Config cwd Parameter Validation Bypass
CVSS:4.0/AV:N/AC:H/AT:N/PR:L/UI:N/VC:H/VI:H/VA:H/SC:H/SI:H/SA:H
Fuente: GitHub
Ciclo de vida de la vulnerabilidad
| Fecha | Fase | Evento | Detalle |
|---|---|---|---|
| Remediación | Parche 3.1.4 | flowise · -33 d desde divulgación | |
| Divulgación | Publicada | GHSA-X7X8-95GH-42XM divulgada · CVSS 9 (GitHub) | |
| Monitoreo | Detectada | Ingresó al índice | |
| Monitoreo | Verificada | Última verificación contra las fuentes |
### Summary
A validation bypass in Flowise's MCP server configuration allows authenticated attackers to achieve arbitrary code execution by exploiting an unvalidated `cwd` parameter that bypasses existing security controls.
### Root Cause
The `validateMCPServerConfig()` function in `packages/components/nodes/tools/MCP/core.ts` validates the `command`, `args`, and `env` parameters but completely ignores the `cwd` parameter. This parameter is later passed directly to `StdioClientTransport`, allowing attackers to bypass path validation by using clean filenames in `args` while controlling the working directory via `cwd`.
### Attack Vector
1. Attacker uses clean filename in `args` array: `["script.js"]` (passes validation)
2. Attacker sets `cwd` to point to directory with malicious files: `"/upload/path"` (unvalidated)
3. Validation succeeds because filename contains no path traversal
4. Process spawns from attacker-controlled directory, executing malicious code
### Impact
- Authenticated remote code execution
- Bypass of existing security controls
- Affects all current Flowise installations
## Affected Versions
- All current versions of Flowise (tested on latest Docker image)
- Specifically affects MCP server configuration functionality
## Vulnerable Code Location
File: `packages/components/nodes/tools/MCP/core.ts`
Function: `validateMCPServerConfig()` (lines 364-392)
export const validateMCPServerConfig = (serverParams: any): void => {
// Validates command, args, env but NOT cwd
// ...
// BUG: serverParams.cwd is never validated but gets passed to StdioClientTransport
}Proof of Concept
// Vulnerable configuration that passes validation:
const maliciousConfig = {
command: 'node',
args: ['script.js'], // Clean filename - passes validation
cwd: '/tmp/uploaded-files', // Unvalidated - contains malicious script.js
env: {}
};
// This bypasses all existing security checks## Suggested Fix
Add cwd validation to `validateMCPServerConfig()`:
// Add after existing validations:
if (serverParams.cwd) {
if (typeof serverParams.cwd !== 'string') {
throw new Error('cwd parameter must be a string');
}
if (path.isAbsolute(serverParams.cwd)) {
throw new Error('cwd parameter cannot be an absolute path');
}
if (serverParams.cwd.includes('..')) {
throw new Error('cwd parameter cannot contain path traversal');
}
const safeCwdPattern = /^[a-zA-Z0-9_-]+$/;
if (!safeCwdPattern.test(serverParams.cwd)) {
throw new Error('cwd parameter contains invalid characters');
}
}Another option is to block it completely.
## Relationship to Existing CVEs
This appears to be separate from CVE-2026-40933, which addressed command flag validation. This vulnerability involves a different parameter (`cwd` vs `args`) and requires a separate fix.
## CWE Classification
- CWE-20: Improper Input Validation
- CWE-78: OS Command Injection
## Reporter Information
Name: Diego Meyer
## Request CVE Assignment
☑️ Yes, please request a CVE ID for this vulnerability
## Coordinated Disclosure
☑️ This is being reported privately first to allow for coordinated disclosure
Incluye detalles técnicos publicados por el investigador. Úselos solo para validar y corregir sus propios sistemas.
Desglose de métricas
Rangos afectados
Estado del parche por paquete
| Paquete / producto | Estado | Corregida en | Desde divulgación | Última versión |
|---|---|---|---|---|
npmflowise |
Corregida | 3.1.4 | -33 d | 3.1.4 no afectada |
npmflowise-components |
Corregida | 3.1.4 | -33 d | 3.1.4 no afectada |
3.1.4Arsenal público
Sin exploits, módulos ni PoC públicos conocidos a la fecha de verificación.
https://github.com/FlowiseAI/Flowise/security/advisories/GHSA-x7x8-95gh-42xmLas referencias externas se muestran para copiar: cve.llama.ec no lo redirige a otros sitios.
