mirror of
https://github.com/farcasclaudiu/Flowise.git
synced 2026-06-29 11:01:18 +03:00
Feat/Enhance security validation for MCP configurations (#5232)
feat: enhance security validation for MCP configurations - Added environment variable checks for CUSTOM_MCP_SECURITY_CHECK, CUSTOM_MCP_PROTOCOL, and HTTP_DENY_LIST across various Docker and application files. - Implemented validation functions in MCP core to prevent command injection and ensure safe environment variable usage
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
import { Tool } from '@langchain/core/tools'
|
||||
import { ICommonObject, INode, INodeData, INodeOptionsValue, INodeParams } from '../../../../src/Interface'
|
||||
import { getNodeModulesPackagePath } from '../../../../src/utils'
|
||||
import { MCPToolkit, validateArgsForLocalFileAccess } from '../core'
|
||||
import { MCPToolkit, validateMCPServerConfig } from '../core'
|
||||
|
||||
class Supergateway_MCP implements INode {
|
||||
label: string
|
||||
@@ -106,9 +106,9 @@ class Supergateway_MCP implements INode {
|
||||
args: [packagePath, ...processedArgs]
|
||||
}
|
||||
|
||||
if (process.env.CUSTOM_MCP_SECURITY_CHECK === 'true') {
|
||||
if (process.env.CUSTOM_MCP_SECURITY_CHECK !== 'false') {
|
||||
try {
|
||||
validateArgsForLocalFileAccess(processedArgs)
|
||||
validateMCPServerConfig(serverParams)
|
||||
} catch (error) {
|
||||
throw new Error(`Security validation failed: ${error.message}`)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user