Technical assessment
A Python script (poc.py) that exploits CVE-2026-21858 in n8n 1.120.4. It first extracts sensitive assets (encryption key, admin credentials) via an unauthenticated form-based file read, then uses those credentials to authenticate and achieve remote code execution by creating and running a workflow containing an Execute Command node.
Backdoor review
No backdoor observed in reviewed code
The PoC demonstrates the CVE-2026-21858 vulnerability by extracting n8n configuration and database files, then using recovered credentials to execute arbitrary commands via the n8n REST API. All observed behavior is consistent with a legitimate proof-of-concept exploit for the stated CVE. No concealed payload, persistence mechanism, credential exfiltration to an external party, or unrelated backdoor functionality was found.
Model confidence100%
AuthenticationNot required
LanguagesPythonDockerfileBatchfile
Target softwaren8n
Attack typesRemote Code ExecutionInformation DisclosureAuthentication Bypass
Evidence & reasoningClassification basis · observed behavior · safety review
Technical evidenceClassification basis and observed behavior
Classification basis
The artifact contains a complete, functional exploit script (poc.py) that actively exercises the vulnerability to achieve remote code execution, not merely detect or report it. The README explicitly describes it as a 'PoC script' and 'exploit script' that provides an interactive shell.
README.md:3README.md:13README.md:50-53poc.py:127-170Requirements
- A vulnerable n8n instance (version 1.120.4) with a Form Trigger workflow activated and its URL known.
README.md:3README.md:29-34 - Python 3.x with dependencies (requests, PyJWT) installed on the attacker's machine.
README.md:7README.md:39-41
Observed behavior
- Reads arbitrary files from the n8n server by sending a crafted POST request to the Form Trigger URL with a 'files' payload containing a target filepath.
poc.py:34-66 - Extracts the encryption key from /home/n8n/.n8n/config and derives the FINAL_SECRET_KEY.
poc.py:75-80 - Extracts admin credentials (email, bcrypt hash, UUID) from /home/n8n/.n8n/database.sqlite.
poc.py:82-98 - Generates a forged JWT authentication token using the extracted secret and admin credentials, then sets session headers and cookies.
poc.py:112-124 - Creates a new n8n workflow containing an 'Execute Command' node with an attacker-supplied command, runs it, and retrieves the command output, achieving remote code execution.
poc.py:127-170 - Provides an interactive shell prompt ('n8n-shell>') for repeated command execution.
poc.py:178-183
Safety-review evidenceBehaviors behind the backdoor verdict
Observables
- Credential Extraction
- encryptionKey from /home/n8n/.n8n/config and admin credentials from /home/n8n/.n8n/database.sqliteThe PoC reads sensitive n8n configuration files to derive a JWT secret and admin credentials, which are then used to authenticate to the n8n API for command execution. This is the core of the CVE-2026-21858 exploit.
poc.py:75-110 - Command Execution
- Arbitrary command execution via n8n REST API using stolen admin sessionAfter extracting credentials, the script creates a new workflow containing an Execute Command node and runs it, retrieving the output. This demonstrates the RCE impact of the vulnerability.
poc.py:127-170
Review boundariesWhat the analysis did not establish
- Two files (requirements.txt, workflow.txt) are reported in the inventory but their content is not included in the evidence packet.
- The evidence packet reports complete_artifact_coverage as false, indicating not all files from the repository snapshot are present.
- Two files (workflow.txt and requirements.txt) were omitted from the text evidence; their content is not reviewed. The workflow.txt file is referenced in the README for setting up the vulnerable environment, and requirements.txt lists Python dependencies. Neither is expected to contain executable backdoor logic, but their absence is a minor evidence gap.
- The review is limited to static analysis of the provided text; no dynamic execution was performed.
Model interpretationThis review is limited to the supplied PoC code and context. It does not assert that the code works or is safe to execute.