mirror of
https://github.com/farcasclaudiu/Flowise.git
synced 2026-06-29 09:01:06 +03:00
Chore/Custom MCP Validation (#4996)
- Updated `validateMCPServerSecurity` to only allow whitelisted commands, removing the extensive list of dangerous commands. - Introduced `validateArgsForLocalFileAccess` to check for potential local file access patterns and null byte injections. - Updated `Supergateway_MCP` to utilize the new argument validation function. - Added a warning in `CustomMCP` regarding upcoming changes to Remote MCP support.
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, validateMCPServerSecurity } from '../core'
|
||||
import { MCPToolkit, validateArgsForLocalFileAccess } from '../core'
|
||||
|
||||
class Supergateway_MCP implements INode {
|
||||
label: string
|
||||
@@ -108,7 +108,7 @@ class Supergateway_MCP implements INode {
|
||||
|
||||
if (process.env.CUSTOM_MCP_SECURITY_CHECK === 'true') {
|
||||
try {
|
||||
validateMCPServerSecurity(serverParams)
|
||||
validateArgsForLocalFileAccess(processedArgs)
|
||||
} catch (error) {
|
||||
throw new Error(`Security validation failed: ${error.message}`)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user