T08 · Insecure Dependencies
- Location
nodes.md:113- Finding
Unverified Community Node Installation in the Live n8n Container
- Content
View full analysis
Vulnerability Details
File Location:
nodes.md, lines 113–119
Additional Locations:SKILL.md, lines 629 and 678
Vulnerability Type: T08: Insecure Dependencies
Risk Level: HighVulnerable Code
markdown ## Community Nodes Install via `npm install` in n8n container: ```bash docker exec n8n npm install n8n-nodes-PACKAGE_NAME docker restart n8nBrowse available: https://www.npmjs.com/search?q=n8n-nodes
text The same unsafe installation pattern is also presented in `SKILL.md`: ```markdown | Install community nodes | ❌ | `npm install` in container + restart |markdown | Install community node | `docker exec n8n npm install n8n-nodes-NAME && docker restart n8n` |Technical Analysis
The instructions permit an unrestricted package name and do not require an exact version, lockfile, integrity hash, trusted-package allowlist, provenance verification, or package review. Installation occurs directly inside the running n8n application container.
npm packages can execute lifecycle scripts such as
preinstall,install, andpostinstall. Consequently, installing a malicious, typo-squatted, compromised, or unexpectedly updated community package can execute attacker-controlled code with the permissions of the container user. The package could also provide malicious n8n node implementations that execute when workflows load or invoke them.Restarting the live container immediately after installation makes the newly installed component part of the active automation environment without an isolated build, security scan, or staged validation process.
Attack Path
- An attacker publishes a malicious or typo-squatted package using a plausible
n8n-nodes-*name, or compromises an existing community package. - The attacker recommends that package for an integration needed by the user.
- The agent or operator follows the documented command and substitutes the attacker-controlled package name:
bash docker exec n
...[truncated 1387 chars]
- An attacker publishes a malicious or typo-squatted package using a plausible
- Remediation
View remediation
Remediation Suggestions
-
Use an explicit allowlist
- Permit only reviewed package names from verified publishers.
- Reject arbitrary package names supplied through workflow input or untrusted recommendations.
-
Pin and verify dependencies
- Require exact package versions rather than floating versions.
- Use a lockfile and verify registry integrity metadata.
- Review package ownership, release history, source repository, signatures or provenance, and transitive dependencies before approval.
-
Do not modify the live container
- Install approved nodes during an isolated image-build stage.
- Scan the resulting image and dependencies before deployment.
- Promote an immutable, versioned image through development, staging, and production.
- Roll back by redeploying the previous image rather than editing a running container.
-
Control lifecycle scripts
- Use
npm install --ignore-scriptsduring initial inspection where compatible. - Audit any package that requires lifecycle scripts before allowing those scripts to execute.
- Run software composition analysis and malware scanning against the package and resulting image.
- Use
-
Apply runtime least privilege
- Run n8n as a non-root user.
- Remove unnecessary Linux capabilities.
- Use read-only filesystems and narrowly scoped writable volumes where feasible.
- Never mount the Docker socket into the n8n container.
- Restrict outbound network access and isolate sensitive internal services.
-
Require explicit confirmation and staged testing
- Display the exact package, version, publisher, integrity value, and requested change before installation.
- Require operator approval.
- Test community nodes with non-production credentials and data in an isolated environment before production promotion.
-
Replace the documented command
- Remove guidance that runs an unpinned
npm installdirectly in the active container. - Provide a c ...[truncated 82 chars]
- Remove guidance that runs an unpinned
-
