FlowiseAI/Flowise · error · Error

Invalid path: encoded path traversal attempt detected

Error message

Invalid path: encoded path traversal attempt detected

What it means

Thrown by validateVectorStorePath (packages/components/src/validator.ts:235) when the base path contains URL-encoded traversal sequences %2e (.), %2f (/) or %5c (\), case-insensitive. Attackers encode '..' to slip past naive substring filters; Flowise decodes the intent and rejects it before the path reaches the filesystem.

Source

Thrown at packages/components/src/validator.ts:235

        const bypassPath = userProvidedPath.trim()
        return path.isAbsolute(bypassPath) ? bypassPath : path.resolve(path.join(getUserHome(), '.flowise', bypassPath))
    }

    // If no path provided, use default secure location
    if (!userProvidedPath || userProvidedPath.trim() === '') {
        return path.join(getUserHome(), '.flowise', 'vectorstore')
    }

    const basePath = userProvidedPath.trim()

    // Check for explicit path traversal patterns (..)
    if (basePath.includes('..')) {
        throw new Error('Invalid path: path traversal attempt detected')
    }

    // Check for URL-encoded path traversal
    if (basePath.toLowerCase().includes('%2e') || basePath.toLowerCase().includes('%2f') || basePath.toLowerCase().includes('%5c')) {
        throw new Error('Invalid path: encoded path traversal attempt detected')
    }

    // Check for null bytes and control characters
    if (/\0/.test(basePath) || /[\x00-\x1f]/.test(basePath)) {
        throw new Error('Invalid path: null bytes or control characters detected')
    }

    // Check for Windows-specific absolute paths and UNC paths (even on Unix systems)
    // This prevents cross-platform attack vectors
    if (/^[a-zA-Z]:\\/.test(basePath)) {
        throw new Error('Invalid path: Windows absolute paths are not allowed')
    }
    if (/^\\\\[^\\]/.test(basePath)) {
        throw new Error('Invalid path: UNC paths are not allowed')
    }
    if (/^\\\\\?\\/.test(basePath)) {
        throw new Error('Invalid path: Extended-length paths are not allowed')
    }

View on GitHub (pinned to abe4a8601a)

Solutions

  1. decodeURIComponent() user input once before binding it to the node config, then pass a plain relative path.
  2. Use a plain relative name under ~/.flowise (no percent signs).
  3. Validate/sanitize upstream so encoded traversal never reaches Flowise.
  4. If you genuinely need encoded chars in a filename, pick names without %2e/%2f/%5c.

Example fix

// before
nodeParams.basePath = req.query.path   // '%2e%2e%2fetc'

// after
nodeParams.basePath = decodeURIComponent(req.query.path).replace(/\.\./g, '')
// better: nodeParams.basePath = 'my-vectors'
Defensive patterns

Strategy: validation

Validate before calling

const clean = (p) => decodeURIComponent(String(p ?? '')).replace(/[\x00-\x1f]/g, '');
if (clean(p).includes('..') || /%2e|%2f|%5c/i.test(p)) throw new Error('reject encoded traversal upstream');

Type guard

const isDecodedSafePath = (p: unknown): p is string => typeof p === 'string' && !p.includes('..') && !/%2e|%2f|%5c/i.test(p);

Try / catch

try { validateVectorStorePath(basePath) } catch (e) { if (e instanceof Error && /encoded path traversal/.test(e.message)) { basePath = 'fallback-store' } else throw e }

Prevention

When it happens

Trigger: A node config passes a path like '%2e%2e%2fetc', '..%2F..%2Fpasswd', or any value carrying %2e/%2f/%5c, including values forwarded from URL query params or chattools without decoding first.

Common situations: Passing request parameters straight into node config; double-encoding bugs where a framework already decoded once; copy-pasting URL-style paths from documentation.

Related errors


AI-assisted analysis of FlowiseAI/Flowise@abe4a8601a (2026-08-12). Data as JSON: /api/errors/dca5b0d2399fdf27. Report an issue: GitHub.