{"record":{"id":"f6a2b1ea1517bd4d","repo":"FlowiseAI/Flowise","slug":"invalid-sqlite-path-unc-paths-are-not-allowed","errorCode":null,"errorMessage":"Invalid SQLite path: UNC paths are not allowed","messagePattern":"Invalid SQLite path: UNC paths are not allowed","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/components/src/validator.ts","lineNumber":345,"sourceCode":"        }\n        const bypassPath = userProvidedPath.trim()\n        return path.isAbsolute(bypassPath) ? bypassPath : path.resolve(path.join(defaultDir, bypassPath))\n    }\n\n    if (!userProvidedPath || userProvidedPath.trim() === '') {\n        throw new Error('Invalid SQLite path: database path is required')\n    }\n\n    const basePath = userProvidedPath.trim()\n\n    if (basePath.includes('..')) throw new Error('Invalid SQLite path: path traversal attempt detected')\n    if (basePath.toLowerCase().includes('%2e') || basePath.toLowerCase().includes('%2f') || basePath.toLowerCase().includes('%5c'))\n        throw new Error('Invalid SQLite path: encoded path traversal attempt detected')\n    // eslint-disable-next-line no-control-regex\n    if (/\\0/.test(basePath) || /[\\x00-\\x1f]/.test(basePath))\n        throw new Error('Invalid SQLite path: null bytes or control characters detected')\n    if (/^[a-zA-Z]:\\\\/.test(basePath)) throw new Error('Invalid SQLite path: Windows absolute paths are not allowed')\n    if (/^\\\\\\\\[^\\\\]/.test(basePath)) throw new Error('Invalid SQLite path: UNC paths are not allowed')\n    if (/^\\\\\\\\\\?\\\\/.test(basePath)) throw new Error('Invalid SQLite path: extended-length paths are not allowed')\n\n    const resolvedPath = path.isAbsolute(basePath) ? path.resolve(basePath) : path.resolve(path.join(defaultDir, basePath))\n\n    if (resolvedPath.includes('..')) throw new Error('Invalid SQLite path: path traversal detected in resolved path')\n\n    if (!isPathWithinAllowedSQLiteDirs(resolvedPath, allowedDirs)) {\n        throw new Error(\n            `Invalid SQLite path: path must be within allowed directories (${allowedDirs.join(', ')}). Attempted path: ${resolvedPath}`\n        )\n    }\n\n    return resolvedPath\n}\n\n/**\n * Restricts SQL executed against a SQLite database opened via validateSQLitePath to a\n * single read-only SELECT/WITH statement.","sourceCodeStart":327,"sourceCodeEnd":363,"githubUrl":"https://github.com/FlowiseAI/Flowise/blob/abe4a8601a058047b350c260676826e21dd14101/packages/components/src/validator.ts#L327-L363","documentation":"Thrown by validateSQLitePath (packages/components/src/validator.ts:345) when the path matches ^\\\\\\\\[^\\\\] — a UNC path like '\\\\\\\\server\\\\share\\\\db.sqlite'. UNC paths can address arbitrary network locations, so Flowise forbids them.","triggerScenarios":"A Database Path such as '\\\\\\\\fileserver\\\\ai\\\\app.db' or '\\\\\\\\localhost\\\\c$\\\\data\\\\db.sqlite' is supplied.","commonSituations":"Windows deployments keeping the DB on a network share; containers inheriting SMB-mounted configs; UNC-mapped drive copy-paste.","solutions":["Mount the share locally and use an allowed absolute path (under ~/.flowise or DATABASE_PATH).","Copy the DB into ~/.flowise/ and use a plain filename.","Set DATABASE_PATH to the mount point and keep the filename simple."],"exampleFix":"// before\nnodeParams.databasePath = '\\\\\\\\fileserver\\\\ai\\\\app.db'\n\n// after\nnodeParams.databasePath = 'app.db'   // DB copied to ~/.flowise/app.db","handlingStrategy":"validation","validationCode":"if (/^\\\\\\\\[^\\\\]/.test(String(databasePath ?? ''))) throw new Error('UNC DB path not allowed; use a local mount');","typeGuard":"const isNotUnc = (p: unknown): p is string => typeof p === 'string' && !/^\\\\\\\\[^\\\\]/.test(p);","tryCatchPattern":"try { validateSQLitePath(databasePath) } catch (e) { if (e instanceof Error && /UNC paths/.test(e.message)) { throw new Error('mount the share and use a local path') } else throw e }","preventionTips":["Mount network shares to a local path; never use UNC in DB paths.","Set DATABASE_PATH to the mount point.","Document the local-path convention for DB files."],"tags":["path-traversal","security","validation","unc","windows","network","sqlite","database","flowise"],"backgroundTag":null,"analyzedSha":"abe4a8601a058047b350c260676826e21dd14101","analyzedAt":"2026-08-12T16:04:40.823Z","schemaVersion":2},"datasetVersion":"2026-08-12T18:17:37.767Z"}