{"record":{"id":"60cd09028881190a","repo":"FlowiseAI/Flowise","slug":"potentially-dangerous-argument-arg","errorCode":null,"errorMessage":"Potentially dangerous argument: ${arg}","messagePattern":"Potentially dangerous argument: (.+?)","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"warning","filePath":"packages/components/nodes/vectorstores/Supabase/filterParser.ts","lineNumber":178,"sourceCode":"        }\n\n        // Handle booleans\n        if (arg === 'true') return true\n        if (arg === 'false') return false\n        if (arg === 'null') return null\n\n        // Handle arrays (basic support)\n        if (arg.startsWith('[') && arg.endsWith(']')) {\n            const arrayContent = arg.slice(1, -1).trim()\n            if (!arrayContent) return []\n\n            // Simple array parsing - just split by comma and parse each element\n            return arrayContent.split(',').map((item) => this.parseArgument(item.trim()))\n        }\n\n        // For everything else, treat as string (but validate it doesn't contain dangerous characters)\n        if (arg.includes('require') || arg.includes('process') || arg.includes('eval') || arg.includes('Function')) {\n            throw new Error(`Potentially dangerous argument: ${arg}`)\n        }\n\n        return arg\n    }\n\n    private static buildFilterFunction(chain: Array<{ method: string; args: any[] }>): (rpc: any) => any {\n        return (rpc: any) => {\n            let result = rpc\n\n            for (const { method, args } of chain) {\n                if (typeof result[method] !== 'function') {\n                    throw new Error(`Method ${method} is not available on the RPC object`)\n                }\n\n                try {\n                    result = result[method](...args)\n                } catch (error) {\n                    throw new Error(`Failed to call ${method}: ${error.message}`)","sourceCodeStart":160,"sourceCodeEnd":196,"githubUrl":"https://github.com/FlowiseAI/Flowise/blob/abe4a8601a058047b350c260676826e21dd14101/packages/components/nodes/vectorstores/Supabase/filterParser.ts#L160-L196","documentation":"In `parseArgument`, after handling arrays/numbers/strings/etc., any remaining token is treated as a raw string but first checked against a blacklist: if it contains 'require', 'process', 'eval', or 'Function', it throws 'Potentially dangerous argument:'. This is a coarse injection guard meant to block Node-centric code execution attempts inside filter arguments.","triggerScenarios":"A filter argument containing any of the substrings require/process/eval/Function — either a genuine injection attempt (e.g. `eval(\"...\")`, `process.exit`) or a false positive where a legitimate value contains one of these words (e.g. a sentence containing 'process', a field named 'Function').","commonSituations":"Malicious/curiosity input trying to escape the DSL; benign metadata text that happens to include the word 'process' or 'require'; LLM-generated filter embedding one of the banned words.","solutions":["Remove the offending substring from the argument or pass it as a properly quoted string literal if the parser supports it.","If the value is legitimately benign (e.g. a sentence), sanitize/encode it before submission.","Do not rely on this blacklist as your only defense — it is bypassable; treat it as defense-in-depth.","For user metadata containing these words, filter on a different field or pre-hash the value."],"exampleFix":"// before: filter(\"note\",\"eq\",'the process failed') -> Potentially dangerous argument\n// after: filter(\"note\",\"eq\",'the procedure failed')  // or store sanitized metadata","handlingStrategy":"validation","validationCode":"const DANGEROUS = ['require','process','eval','Function']\nfunction sanitizeArg(arg: string): string {\n  if (DANGEROUS.some(d => arg.includes(d))) throw new Error(`Argument contains a blocked token: ${arg}`)\n  return arg\n}","typeGuard":"null","tryCatchPattern":"null","preventionTips":["Do not store user prose containing 'process'/'require' in filtered fields; sanitize first.","Treat the blacklist as defense-in-depth only; it is bypassable.","Prefer filtering on IDs/hashes over free-text for safety.","Encode/quote legitimate values to avoid substring matches."],"tags":["supabase","filter-parser","security","injection","input-validation"],"backgroundTag":null,"analyzedSha":"abe4a8601a058047b350c260676826e21dd14101","analyzedAt":"2026-08-12T16:04:40.823Z","schemaVersion":2},"datasetVersion":"2026-08-12T18:17:37.767Z"}