logo

Database

N8n Expression In Git Path

Description

Detects when a Git node in the published version of an n8n workflow builds the path of its local repository, or the list of files it stages, from an expression. Whoever controls the data that reaches that expression, for example through a trigger, can then choose which repository the node reads, changes or pushes, and which of its files the node stages.

Weakness:

063 - Lack of data validation - Path Traversal

Category: Unexpected Injection

Detection Strategy

    • Lists every workflow the API key's user can see through the n8n public API, all of them for an owner or admin key, and reads only the version of each one that is published, skipping disabled nodes

    • Keeps the Git nodes, and the Git tools an AI agent can call, and reads their Repository Path option and the list of files the add operation stages, an operation set by an expression counting as add

    • Counts a value as built from an expression when it starts with = and contains double braces, the part n8n evaluates as code

    • Reports a vulnerability when either value is built from an expression, and records which of the two in the evidence; a workflow whose listing omits the published version field, or whose published version has no node list, is recorded as unreadable rather than reported as clean