Flowise
Static analysis for Flowise chatflow exports to detect agent loops, connection cycles, and credential exposure.
Quick Start
# Export chatflow from Flowise UI, then scan
inkog scan ./chatflowsWhat Inkog Detects
| Finding | Severity | Description |
|---|---|---|
| Agent Loop | CRITICAL | AgentExecutor without maxIterations |
| Connection Cycle | HIGH | Circular node connections |
| Credential Leak | CRITICAL | API keys in exported JSON |
| Unsafe Tool | CRITICAL | Custom tools with shell access |
| Memory Overflow | HIGH | Memory nodes without limits |
AgentExecutor Loops
AgentExecutor nodes without iteration limits run forever.
Vulnerable
No maxIterations - agent loops forever
{
"nodes": [
{
"id": "agentExecutor_0",
"type": "customNode",
"data": {
"category": "Agents",
"name": "agentExecutor",
"inputs": {
"model": "",
"tools": []
}
}
}
]
}Secure
Explicit iteration limit
{
"nodes": [
{
"id": "agentExecutor_0",
"type": "customNode",
"data": {
"category": "Agents",
"name": "agentExecutor",
"inputs": {
"model": "",
"tools": [],
"maxIterations": "10",
"returnIntermediateSteps": "false"
}
}
}
]
}Connection Cycles
Circular connections between nodes cause infinite loops.
Vulnerable
Output feeds back to LLM - infinite loop
{
"nodes": [
{"id": "llm_0", "data": {"name": "chatOpenAI"}},
{"id": "chain_0", "data": {"name": "llmChain"}},
{"id": "output_0", "data": {"name": "outputParser"}}
],
"edges": [
{"source": "llm_0", "target": "chain_0"},
{"source": "chain_0", "target": "output_0"},
{"source": "output_0", "target": "llm_0"}
]
}Secure
Linear flow without cycles
{
"nodes": [
{"id": "llm_0", "data": {"name": "chatOpenAI"}},
{"id": "chain_0", "data": {"name": "llmChain"}},
{"id": "output_0", "data": {"name": "outputParser"}}
],
"edges": [
{"source": "llm_0", "target": "chain_0"},
{"source": "chain_0", "target": "output_0"}
]
}API Key Exposure
Exported chatflows can contain plaintext credentials.
Vulnerable
API key hardcoded in node
{
"nodes": [
{
"id": "chatOpenAI_0",
"data": {
"name": "chatOpenAI",
"inputs": {
"openAIApiKey": "sk-abc123...",
"modelName": "gpt-4"
}
}
}
]
}Secure
Credential reference from Flowise store
{
"nodes": [
{
"id": "chatOpenAI_0",
"data": {
"name": "chatOpenAI",
"inputs": {
"modelName": "gpt-4"
},
"credential": {
"openAIApi": {
"id": "credential_id",
"name": "OpenAI Production"
}
}
}
}
]
}Unsafe Custom Tools
Custom tool nodes with code execution are dangerous.
Vulnerable
Shell command execution
{
"nodes": [
{
"id": "customTool_0",
"data": {
"name": "customTool",
"inputs": {
"toolName": "shell",
"toolDesc": "Run shell commands",
"toolFunc": "const { execSync } = require('child_process'); return execSync(input);"
}
}
}
]
}Secure
Restricted to safe math operations
{
"nodes": [
{
"id": "customTool_0",
"data": {
"name": "customTool",
"inputs": {
"toolName": "calculator",
"toolDesc": "Perform safe math calculations",
"toolFunc": "const allowed = /^[0-9+\-*/().\s]+$/; if (!allowed.test(input)) return 'Invalid'; return eval(input);"
}
}
}
]
}Memory Without Limits
Memory nodes accumulating messages indefinitely.
Vulnerable
Unbounded buffer memory
{
"nodes": [
{
"id": "bufferMemory_0",
"data": {
"name": "bufferMemory",
"inputs": {}
}
}
]
}Secure
Window memory with k=10 limit
{
"nodes": [
{
"id": "bufferWindowMemory_0",
"data": {
"name": "bufferWindowMemory",
"inputs": {
"k": "10"
}
}
}
]
}How to Export Chatflows
To scan Flowise chatflows:
- From UI: Chatflow menu → Export
- Via API:
# List chatflows
curl -X GET "http://localhost:3000/api/v1/chatflows"
# Export specific chatflow
curl -X GET "http://localhost:3000/api/v1/chatflows/{id}" \
-o chatflow.jsonThen scan:
inkog scan ./chatflow.jsonDocument Loaders
Document loaders can access sensitive files.
Vulnerable
User controls file path - path traversal
{
"nodes": [
{
"id": "docLoader_0",
"data": {
"name": "textFile",
"inputs": {
"filePath": "={{$input}}"
}
}
}
]
}Secure
Fixed path to approved directory
{
"nodes": [
{
"id": "docLoader_0",
"data": {
"name": "textFile",
"inputs": {
"filePath": "./data/approved/"
}
}
}
]
}Best Practices
- Set
maxIterationson all Agent nodes (recommended: 5-15) - Use Flowise credential store - never hardcode keys
- Avoid Custom Tool nodes with
require()orexec() - Use Buffer Window Memory with
klimit - Check for cycles before deploying
- Review exports before sharing
CLI Examples
# Scan chatflow exports
inkog scan ./chatflows
# Check for credential exposure
inkog scan . -severity critical
# HTML report
inkog scan . -output html > report.htmlRelated
- n8n - Similar workflow platform
- LangChain - Underlying framework
- Resource Exhaustion
Last updated on