CVE-2026-21858
CVE-2026-21858
Weakness (CWE)
CVSS Vector
v3.1- Attack Vector
- Network
- Attack Complexity
- Low
- Privileges Required
- None
- User Interaction
- None
- Scope
- Changed
- Confidentiality
- High
- Integrity
- High
- Availability
- None
Description
n8n is an open source workflow automation platform. Versions starting with 1.65.0 and below 1.121.0 enable an attacker to access files on the underlying server through execution of certain form-based workflows. A vulnerable workflow could grant access to an unauthenticated remote attacker, resulting in exposure of sensitive information stored on the system and may enable further compromise depending on deployment configuration and workflow usage. This issue is fixed in version 1.121.0.
Comprehensive Technical Analysis of CVE-2026-21858
CVE ID: CVE-2026-21858 CVSS Score: 10.0 (Critical) Affected Software: n8n (versions < 1.121.0) Vulnerability Type: Unauthenticated Arbitrary File Read (Information Disclosure)
1. Vulnerability Assessment & Severity Evaluation
Vulnerability Overview
CVE-2026-21858 is a critical-severity vulnerability in n8n, an open-source workflow automation platform. The flaw allows unauthenticated remote attackers to read arbitrary files on the underlying server by exploiting improperly secured form-based workflows. This constitutes a high-impact information disclosure vulnerability, potentially leading to further compromise depending on deployment configurations.
CVSS v3.1 Vector & Scoring
| Metric | Value | Explanation |
|---|---|---|
| AV | Network (N) | Exploitable remotely over the network. |
| AC | Low (L) | No user interaction or complex conditions required. |
| PR | None (N) | No privileges required; unauthenticated access. |
| UI | None (N) | No user interaction needed. |
| S | Unchanged (U) | Does not affect other components beyond the vulnerable system. |
| C | High (H) | Complete confidentiality impact; sensitive data exposure. |
| I | None (N) | No integrity impact (read-only access). |
| A | None (N) | No availability impact. |
| Score | 10.0 (Critical) | Maximum severity due to unauthenticated remote exploitation. |
Severity Justification
- Unauthenticated Access: Attackers do not require credentials, making exploitation trivial.
- Arbitrary File Read: Enables access to sensitive files (e.g.,
/etc/passwd, configuration files, API keys, database credentials). - Potential for Lateral Movement: If workflows interact with internal systems, this could lead to further compromise (e.g., RCE via exposed secrets).
- Low Attack Complexity: Exploitation does not require specialized knowledge or tools.
2. Potential Attack Vectors & Exploitation Methods
Attack Surface
The vulnerability stems from improper input validation and access control in n8n’s form-based workflow execution. Attackers can exploit this by:
-
Crafting Malicious Form Submissions:
- If a workflow processes form data (e.g., file uploads, user inputs) without proper sanitization, an attacker can manipulate input to traverse directories.
- Example: A workflow expecting a filename (e.g.,
user_uploads/report.pdf) could be tricked into reading/etc/shadowvia path traversal (e.g.,../../../../etc/shadow).
-
Exploiting Misconfigured Workflows:
- Workflows that blindly trust user-supplied paths (e.g., for file operations) are vulnerable.
- If a workflow exposes an endpoint (e.g.,
/webhook/form-submit) that processes file paths, an attacker can submit malicious payloads.
-
Unauthenticated Webhook Abuse:
- If n8n is configured with publicly accessible webhooks, attackers can send crafted HTTP requests to trigger vulnerable workflows.
Exploitation Steps
-
Reconnaissance:
- Identify exposed n8n instances (e.g., via Shodan, Censys, or manual discovery).
- Enumerate workflows that accept form inputs (e.g., via
/rest/workflowsor exposed API endpoints).
-
Payload Crafting:
- Use path traversal sequences (e.g.,
../,%2e%2e%2f) to escape the intended directory. - Example payload:
POST /webhook/form-submit HTTP/1.1 Host: vulnerable-n8n-instance.com Content-Type: application/json { "file_path": "../../../../etc/passwd" }
- Use path traversal sequences (e.g.,
-
Exfiltration:
- If the workflow returns file contents (e.g., in a response or logs), the attacker retrieves sensitive data.
- If the workflow processes files (e.g., sends them via email), the attacker may intercept them.
-
Post-Exploitation:
- Credential Theft: Extract database credentials, API keys, or SSH keys.
- Lateral Movement: Use stolen credentials to pivot into other systems.
- Persistence: Modify workflows to maintain access (if write permissions are misconfigured).
Proof-of-Concept (PoC) Considerations
- A PoC would involve:
- Identifying a vulnerable workflow (e.g., one that processes file paths from user input).
- Sending a request with a malicious path traversal payload.
- Observing the response for file contents.
- Mitigation Bypass Attempts:
- Test URL-encoded traversal sequences (
%2e%2e%2f). - Check for workflows that process file paths in base64-encoded or obfuscated formats.
- Test URL-encoded traversal sequences (
3. Affected Systems & Software Versions
Vulnerable Versions
- All n8n versions prior to 1.121.0 are affected.
- Fixed Version: 1.121.0 (released to address this vulnerability).
Deployment Scenarios at Risk
-
Self-Hosted n8n Instances:
- Deployments with publicly exposed webhooks or misconfigured authentication.
- Workflows that process user-supplied file paths without validation.
-
Cloud-Hosted n8n (if misconfigured):
- If authentication is disabled or workflows are exposed to the internet.
-
Integrations with Sensitive Systems:
- Workflows that interact with databases, cloud storage, or internal APIs are at higher risk if credentials are exposed.
4. Recommended Mitigation Strategies
Immediate Actions
-
Upgrade to n8n 1.121.0 or Later:
- Apply the patch immediately to eliminate the vulnerability.
- Verify the fix by testing workflows with path traversal payloads.
-
Restrict Network Access:
- Firewall Rules: Block external access to n8n’s webhook endpoints unless absolutely necessary.
- Reverse Proxy: Use a reverse proxy (e.g., Nginx, Cloudflare) to enforce authentication and rate limiting.
-
Disable Unused Workflows:
- Audit and disable workflows that are not actively in use.
- Remove or secure workflows that process file paths from untrusted sources.
-
Enable Authentication:
- Ensure basic authentication or OAuth is enabled for all workflow endpoints.
- Avoid using public webhooks unless strictly required.
Long-Term Hardening
-
Input Validation & Sanitization:
- Implement strict input validation for all user-supplied file paths.
- Use allowlists for permitted directories and filenames.
- Reject requests containing path traversal sequences (
../,..\,%2e%2e%2f).
-
Least Privilege Principle:
- Run n8n with minimal filesystem permissions (e.g., a dedicated user with restricted access).
- Avoid running n8n as
rootor with excessive privileges.
-
Logging & Monitoring:
- Enable detailed logging for workflow executions, especially those handling file operations.
- Set up alerts for suspicious activity (e.g., repeated path traversal attempts).
-
Regular Security Audits:
- Conduct penetration testing to identify misconfigured workflows.
- Use static and dynamic analysis tools (e.g., OWASP ZAP, Burp Suite) to test for vulnerabilities.
-
Network Segmentation:
- Isolate n8n in a dedicated VLAN or DMZ to limit lateral movement.
- Restrict outbound connections from n8n to only necessary services.
5. Impact on the Cybersecurity Landscape
Broader Implications
-
Increased Attack Surface for Automation Tools:
- As low-code/no-code platforms (e.g., n8n, Zapier, Make) gain popularity, they become lucrative targets for attackers.
- Similar vulnerabilities in other automation tools could lead to widespread exploitation.
-
Supply Chain Risks:
- n8n is often integrated with third-party services (e.g., Slack, AWS, GitHub). A compromise could propagate to connected systems.
- Attackers may use stolen credentials from n8n to pivot into cloud environments.
-
Regulatory & Compliance Concerns:
- Organizations handling sensitive data (e.g., healthcare, finance) may face GDPR, HIPAA, or PCI DSS violations if this vulnerability leads to a breach.
- Incident response teams must prioritize patching and forensic analysis.
-
Exploitation in the Wild:
- Given the CVSS 10.0 score, this vulnerability is likely to be actively exploited by:
- Opportunistic attackers (e.g., automated scanners).
- Advanced Persistent Threats (APTs) targeting specific organizations.
- Ransomware groups may use this to steal credentials before encrypting systems.
- Given the CVSS 10.0 score, this vulnerability is likely to be actively exploited by:
Historical Context
- This vulnerability resembles CVE-2021-44228 (Log4Shell) in terms of unauthenticated remote exploitation but is more limited in scope (file read vs. RCE).
- Similar path traversal vulnerabilities (e.g., CVE-2021-41773 in Apache) have been exploited in the wild, underscoring the need for proactive patching.
6. Technical Details for Security Professionals
Root Cause Analysis
The vulnerability arises from insufficient input validation in n8n’s workflow execution engine. Specifically:
- Form-based workflows that accept user-supplied file paths do not properly sanitize input.
- The application trusts user input when constructing file operations (e.g.,
fs.readFile()in Node.js). - No path normalization is performed, allowing traversal sequences to bypass intended directory restrictions.
Code-Level Vulnerability (Hypothetical Example)
// Vulnerable code snippet (simplified)
app.post('/webhook/process-file', (req, res) => {
const userSuppliedPath = req.body.file_path; // Unsanitized input
const fileContent = fs.readFileSync(userSuppliedPath, 'utf8'); // Arbitrary file read
res.send(fileContent);
});
Fix in n8n 1.121.0:
- Added input validation to reject path traversal sequences.
- Implemented path normalization to resolve relative paths safely.
- Enforced allowlisting for permitted directories.
Exploitation Detection
-
Log Analysis:
- Look for HTTP 200 responses containing file contents (e.g.,
/etc/passwd). - Monitor for unusual file access patterns (e.g., repeated requests for sensitive files).
- Look for HTTP 200 responses containing file contents (e.g.,
-
Network Traffic Analysis:
- Detect path traversal payloads in webhook requests (e.g.,
../,%2e%2e%2f). - Use IDS/IPS rules (e.g., Snort, Suricata) to flag suspicious activity.
- Detect path traversal payloads in webhook requests (e.g.,
-
Endpoint Detection & Response (EDR):
- Monitor for unexpected file reads by the n8n process.
- Alert on process execution involving sensitive files.
Forensic Investigation Steps
-
Check for Indicators of Compromise (IOCs):
- Review web server logs for exploitation attempts.
- Search for unauthorized file access in n8n logs.
-
Determine Scope of Exposure:
- Identify which files were accessed (e.g.,
/etc/passwd,.env,config.yml). - Check if credentials or API keys were exposed.
- Identify which files were accessed (e.g.,
-
Remediation Verification:
- Confirm that all instances have been patched to 1.121.0.
- Validate that workflows no longer accept unsanitized paths.
Conclusion
CVE-2026-21858 represents a critical risk to organizations using n8n, particularly those with misconfigured or publicly exposed workflows. The unauthenticated arbitrary file read capability enables attackers to steal sensitive data, potentially leading to further compromise.
Key Takeaways for Security Teams: ✅ Patch immediately to n8n 1.121.0. ✅ Restrict network access to n8n instances. ✅ Audit workflows for path traversal vulnerabilities. ✅ Monitor for exploitation attempts via logs and EDR. ✅ Assume breach if exploitation is detected and conduct a forensic investigation.
Given the CVSS 10.0 severity, this vulnerability should be treated as a top priority for remediation. Organizations should also review their automation tooling for similar risks, as low-code platforms are increasingly targeted by threat actors.