{"record":{"id":"118cb8ca918ef2f1","repo":"n8n-io/n8n","slug":"dangerous-column-header-header-trim-found-i","errorCode":null,"errorMessage":"Dangerous column header \"${header.trim()}\" found in ${format} data","messagePattern":"Dangerous column header \"(.+?)\" found in (.+?) data","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/@n8n/instance-ai/src/parsers/structured-file-parser.ts","lineNumber":306,"sourceCode":"\t\treturn { rawHeaders: [], allRows: [] };\n\t}\n\n\tlet rawHeaders: string[];\n\tlet dataRows: string[][];\n\n\tif (options.hasHeader) {\n\t\trawHeaders = records[0];\n\t\tdataRows = records.slice(1);\n\t} else {\n\t\tconst colCount = records[0].length;\n\t\trawHeaders = Array.from({ length: colCount }, (_, i) => `column_${i}`);\n\t\tdataRows = records;\n\t}\n\n\t// Check for dangerous keys in CSV/TSV headers (consistent with JSON validation)\n\tfor (const header of rawHeaders) {\n\t\tif (DANGEROUS_KEYS.has(header.trim())) {\n\t\t\tthrow new Error(`Dangerous column header \"${header.trim()}\" found in ${format} data`);\n\t\t}\n\t}\n\n\treturn { rawHeaders, allRows: dataRows };\n}\n\nfunction parseJson(content: string): {\n\trawHeaders: string[];\n\tallRows: Array<Record<string, unknown>>;\n} {\n\tlet parsed: unknown;\n\ttry {\n\t\tparsed = JSON.parse(content);\n\t} catch {\n\t\tthrow new Error('Invalid JSON: failed to parse');\n\t}\n\n\tif (!Array.isArray(parsed)) {","sourceCodeStart":288,"sourceCodeEnd":324,"githubUrl":"https://github.com/n8n-io/n8n/blob/5ac6606e81f67bb9534255570cd4e86fd8101eee/packages/@n8n/instance-ai/src/parsers/structured-file-parser.ts#L288-L324","documentation":"Error \"Dangerous column header \"${header.trim()}\" found in ${format} data\" thrown in n8n-io/n8n.","triggerScenarios":"Thrown at packages/@n8n/instance-ai/src/parsers/structured-file-parser.ts:306 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"5ac6606e81f67bb9534255570cd4e86fd8101eee","analyzedAt":"2026-08-12T05:26:35.080Z","schemaVersion":2},"datasetVersion":"2026-08-12T18:17:37.767Z"}