Full Report
GitGuardian researchers found 321 n8n instances accepting API tokens exposed in public GitHub commits and demonstrated four ways attackers could use them to access sensitive data and downstream credentials without exploiting a software vulnerability. We scanned public GitHub commits for exposed n8n API tokens and identified 4,576 unique credentials associated with 1,255 hostnames. Of the 896
Analysis Summary
# Incident Report: Exposure of n8n Instances via Leaked API Tokens
## Executive Summary
GitGuardian researchers identified a widespread security exposure where 321 live n8n automation instances were accessible via API tokens leaked in public GitHub commits. These tokens grant authenticated access to sensitive workflows and downstream credentials (databases, cloud environments, etc.) without requiring the exploitation of software vulnerabilities. The incident highlights the high "blast radius" of compromising central automation hubs.
## Incident Details
- **Discovery Date:** August 05, 2026 (Report Publication)
- **Incident Date:** Ongoing (Scanning data collected since April 2025)
- **Affected Organization:** 1,255 unique hostnames identified (multiple organizations)
- **Sector:** Cross-sector (Technology, Cloud Services, Business Operations)
- **Geography:** Global
## Timeline of Events
### Initial Access
- **Date/Time:** April 2025 – August 2026
- **Vector:** Credential Leakage / Secret Sprawl
- **Details:** Developers inadvertently included n8n API tokens and Model Context Protocol (MCP) keys in public GitHub repositories.
### Lateral Movement
- **Details:** Using a valid API token, attackers can access the n8n REST API. From there, they can modify workflows to utilize stored credentials for downstream systems (e.g., AWS, GitHub, internal databases), effectively moving from the automation platform into the broader corporate infrastructure.
### Data Exfiltration/Impact
- **Details:** Potential for extraction of workflow definitions, execution logs, and sensitive environment variables. In specific configurations, attackers can extract the underlying plaintext values of stored third-party credentials.
### Detection & Response
- **How it was discovered:** Proactive secret scanning of public GitHub commits by GitGuardian researchers.
- **Response actions taken:** Validation of 4,576 unique credentials; notification/reporting through the published research to alert the n8n community.
## Attack Methodology
- **Initial Access:** Publicly exposed API tokens (JWTs) found in source code.
- **Persistence:** Maintaining access via valid, non-expiring API keys.
- **Privilege Escalation:** Utilizing n8n’s internal "Credential" nodes to execute actions with the permissions of the service accounts stored in the platform.
- **Defense Evasion:** Using standard, documented REST API calls that mimic legitimate administrative traffic.
- **Credential Access:** Extraction of downstream service tokens and passwords stored within the n8n encryption vault.
- **Discovery:** Scanning for `n8n` specific hostnames and public-facing instances (e.g., via Shodan).
- **Lateral Movement:** Pivoting from n8n to integrated third-party SaaS and cloud platforms.
- **Collection:** Gathering sensitive data processed by automated workflows.
- **Impact:** Unauthorized execution of business logic; potential data wipe or modification in connected systems.
## Impact Assessment
- **Financial:** High potential risk due to unauthorized cloud resource consumption or data theft.
- **Data Breach:** Exposure of API keys, database connection strings, and PII processed by workflows.
- **Operational:** Attackers can disrupt business-critical automation and CI/CD pipelines.
- **Reputational:** High; demonstrates lack of "Secret Hygiene" in development workflows.
## Indicators of Compromise
- **Network indicators:** API requests to `/api/v1/` endpoints from unexpected IP addresses.
- **Behavioral indicators:** Creation of new, unauthorized workflows designed to exfiltrate data (e.g., HTTP Request nodes sending data to external webhooks).
- **Token indicators:** Presence of JWTs with `"aud": "public-api"` in public repositories.
## Response Actions
- **Containment:** Revoke all API tokens identified in the GitGuardian report or found in public commits.
- **Eradication:** Rotation of the `N8N_ENCRYPTION_KEY` if the instance host was compromised.
- **Recovery:** Auditing all existing workflows for unauthorized changes or additions.
## Lessons Learned
- **Centralization Risk:** Automation platforms like n8n are "crown jewel" targets because they consolidate access to multiple high-value systems.
- **Token Management:** n8n API tokens are often long-lived and lack sufficient scoping/least-privilege controls by default.
- **Developer Oversight:** Credentials are still frequently committed to version control despite mature scanning tools.
## Recommendations
- **Implement Secret Scanning:** Use tools like GitGuardian or GitHub Secret Scanning in CI/CD pipelines to prevent leaks before they reach public repositories.
- **Enforce Least Privilege:** Limit the permissions of API tokens and the service accounts they utilize.
- **Network Restrict Instances:** Ensure self-hosted n8n instances are behind a VPN/Firewall and not reachable via the open internet where possible.
- **Rotate Regularly:** Implement a policy for the periodic rotation of API keys and encryption secrets.