Cloud application hosting platform Northflank has disclosed a security breach in which attackers gained unauthorized access to the platform and abused AI API keys stored by customers. The company is warning all customers to rotate every credential and secret stored on its platform as an immediate precaution. For defenders, this incident is a sharp reminder of the cascading risk created when secrets are centralized in third-party platforms — a single compromise can expose API keys, database credentials, and service tokens across an entire customer base.
The abuse of AI API keys is particularly noteworthy. Keys for services like OpenAI, Anthropic, and other LLM providers carry direct financial value — attackers can run up massive inference bills, resell access, or use stolen keys for data exfiltration and prompt-injection attacks against integrated AI pipelines. If your organization stores secrets on Northflank or any comparable PaaS, you need to act now.
Technical Analysis
What Happened
Northflank, a platform-as-a-service (PaaS) provider that enables teams to build, deploy, and scale applications and databases, confirmed a security incident that resulted in unauthorized access to customer-stored secrets. The breach led to confirmed abuse of AI API keys belonging to Northflank customers.
While Northflank has not publicly detailed the initial access vector at the time of this writing, the impact pattern is consistent with a platform-level compromise where the attacker gained access to the secrets management layer — the component responsible for storing and injecting environment variables, API keys, and service credentials into customer workloads.
Attack Chain — Defender's Perspective
From a defensive standpoint, the attack chain likely follows this pattern:
- Initial Access: The attacker gains entry to Northflank's infrastructure — potentially through compromised credentials, a vulnerable service, or a supply-chain vector. The specific vector has not been disclosed.
- Secrets Access: The attacker accesses the secrets store or secrets-injection mechanism used to provide environment variables to customer containers and services.
- Key Exfiltration: AI API keys (and potentially other credentials) are extracted from the secrets layer.
- External Abuse: Stolen API keys are used from attacker-controlled infrastructure to make unauthorized API calls to AI providers — generating charges, accessing models, or abusing integrated services.
Why AI API Keys Are Targeted
AI API keys have become high-value targets for several reasons:
- Direct financial value: LLM API calls are billed per token. Attackers can generate thousands of dollars in charges within hours.
- Resale market: Stolen API keys are sold on underground forums and Telegram channels.
- Data access: API keys connected to AI pipelines may expose prompts, fine-tuned models, and integrated data sources.
- Low detection friction: API calls using valid keys look legitimate — there is no exploit payload or malware signature to detect. The abuse blends into normal API traffic.
Affected Products and Platforms
- Platform: Northflank cloud application hosting platform
- Affected component: Secrets management and environment variable injection
- At-risk credential types: AI API keys (OpenAI, Anthropic, Google AI, etc.), database connection strings, service account tokens, cloud provider credentials, third-party API keys — any secret stored on the platform
- Exploitation status: Confirmed active abuse of stolen AI API keys. No CVE has been assigned as this is a platform breach, not a software vulnerability.
Broader Implications
This incident fits a growing pattern of attacks targeting secrets stored in cloud platforms and CI/CD pipelines. The 2025 breach at a major CI/CD provider and the ongoing abuse of exposed API keys in public repositories underscore that secrets management is now a primary attack surface. Any platform that centralizes customer credentials becomes a high-value target.
Detection & Response
Detecting Unauthorized AI API Key Usage
The primary detection surface for this threat is not your endpoint — it's the API provider's usage logs and your cloud platform's audit trail. However, there are meaningful host-level and network-level detections that can identify secrets exfiltration and unauthorized API usage patterns.
SIGMA Rules
---
title: Suspicious Access to Environment Variable Files Containing API Keys
id: 8c1f4a72-3b6e-4d9f-a2c5-7e8b9d0f1a2b
status: experimental
description: Detects processes reading environment files, .env files, or secrets configuration that may contain API keys. Focused on non-standard processes accessing these files, which may indicate secrets harvesting after initial compromise.
references:
- https://attack.mitre.org/techniques/T1552/001/
- https://www.bleepingcomputer.com/news/security/northflank-security-breach-leads-to-abuse-of-customers-ai-api-keys/
author: Security Arsenal
date: 2026/04/06
tags:
- attack.credential_access
- attack.t1552.001
logsource:
category: file_event
product: linux
detection:
selection_target:
TargetFilename|contains:
- '.env'
- 'secrets.yaml'
- 'secrets.yml'
- 'credentials.json'
- '.api_keys'
- 'vault-token'
selection_target_2:
TargetFilename|endswith:
- '.env'
- '.env.local'
- '.env.production'
filter_known_processes:
Image|endswith:
- '/node'
- '/python'
- '/python3'
- '/java'
- '/ruby'
- '/nginx'
- '/apache2'
- '/gunicorn'
- '/uwsgi'
- '/supervisord'
condition: (selection_target or selection_target_2) and not filter_known_processes
falsepositives:
- Application runtimes legitimately loading environment configuration
- DevOps tooling reading secrets during deployment
- Container orchestrators injecting environment variables
level: medium
---
title: Outbound Connection to AI API Endpoint from Non-Standard Process
id: 2d5e8f14-6a3b-4c7e-b1d9-3f5a7c9e0b2d
status: experimental
description: Detects network connections to known AI API endpoints (OpenAI, Anthropic, Google AI) from processes that do not typically make such connections. May indicate stolen API key usage or unauthorized AI service access.
references:
- https://attack.mitre.org/techniques/T1071/001/
- https://www.bleepingcomputer.com/news/security/northflank-security-breach-leads-to-abuse-of-customers-ai-api-keys/
author: Security Arsenal
date: 2026/04/06
tags:
- attack.command_and_control
- attack.t1071.001
- attack.exfiltration
logsource:
category: network_connection
product: windows
detection:
selection_destination:
DestinationHostname|contains:
- 'api.openai.com'
- 'api.anthropic.com'
- 'generativelanguage.googleapis.com'
- 'api.cohere.ai'
- 'api.mistral.ai'
filter_known_apps:
Image|endswith:
- '\python.exe'
- '\python3.exe'
- '\node.exe'
- '\Code.exe'
- '\cursor.exe'
condition: selection_destination and not filter_known_apps
falsepositives:
- Custom applications with legitimate AI integrations
- AI-powered development tools and IDEs
- Browser-based AI assistants
level: medium
KQL — Hunting for AI API Key Abuse in Sentinel
This query targets two scenarios: unexpected outbound connections to AI API endpoints, and process execution patterns consistent with secrets harvesting on Linux hosts ingested via Syslog.
// Hunt 1: Outbound connections to AI API endpoints from unexpected processes
// Useful for detecting unauthorized API key usage from compromised hosts
let AIEndpoints = dynamic([
"api.openai.com",
"api.anthropic.com",
"generativelanguage.googleapis.com",
"api.cohere.ai",
"api.mistral.ai"
]);
let KnownAIProcesses = dynamic([
"python", "python3", "node", "java", "ruby",
"code", "cursor", "chrome", "firefox", "msedge"
]);
DeviceNetworkEvents
| where TimeGenerated > ago(7d)
| where RemoteUrl in~ (AIEndpoints)
| extend ProcessName = tolower(split(InitiatingProcessFileName, ".")[0])
| where ProcessName !in~ (KnownAIProcesses)
| project TimeGenerated, DeviceName, InitiatingProcessFileName,
InitiatingProcessCommandLine, RemoteUrl, RemoteIP, RemotePort,
InitiatingProcessAccountName
| sort by TimeGenerated desc;
// Hunt 2: Processes accessing .env or secrets files on Linux (via Syslog)
// Detects potential secrets harvesting activity
Syslog
| where TimeGenerated > ago(7d)
| where SyslogMessage has_any (".env", "secrets.yaml", "credentials.json", "api_key")
| where SyslogMessage has_any ("cat ", "less ", "more ", "head ", "tail ", "grep ", "find ", "curl ", "wget ", "base64")
| where ProcessName !in~ ("node", "python", "python3", "java", "supervisord", "systemd")
| project TimeGenerated, Computer, ProcessName, SyslogMessage
| sort by TimeGenerated desc;
// Hunt 3: Bulk environment variable enumeration (potential secrets discovery)
// Detects commands commonly used to dump environment variables from running processes
DeviceProcessEvents
| where TimeGenerated > ago(7d)
| where ProcessCommandLine has_any (
"cat /proc/*/environ",
"printenv",
"env |",
"set |",
"/proc/self/environ",
"strings /proc"
)
| project TimeGenerated, DeviceName, FileName, ProcessCommandLine,
InitiatingProcessFileName, InitiatingProcessAccountName
| sort by TimeGenerated desc
Velociraptor VQL — Hunting for Secrets Access and Enumeration
This VQL artifact hunts for processes accessing environment files and enumerating running process environments — key indicators of secrets harvesting.
-- Hunt for processes accessing .env files and enumerating process environments
-- Targets secrets harvesting behavior following initial compromise
-- Check for recently accessed or modified .env files
SELECT FullPath, Size, Mtime, Atime
FROM glob(globs=[
'/home/*/**/.env',
'/home/*/**/.env.local',
'/home/*/**/.env.production',
'/var/www/**/.env',
'/opt/*/.env',
'/srv/*/.env',
'/root/.env'
])
WHERE Mtime > now() - 604800
-- Check for processes with environment-related command lines
SELECT Pid, Name, CommandLine, Exe, Username, CreateTime
FROM pslist()
WHERE CommandLine =~ '(?i)(printenv|cat.*env|/proc/.*environ|env\s*\|)'
OR CommandLine =~ '(?i)(api.key|secret|token|credential)'
-- Check for active network connections to known AI API endpoints
SELECT Pid, Name, Path, Address, Port, Status
FROM netstat()
WHERE Address =~ '(?i)(openai|anthropic|googleapis|cohere|mistral)'
OR Port = 443 AND Status = 'ESTABLISHED'
Immediate Credential Rotation Script
The following Bash script helps identify and rotate API keys stored in environment files across Linux systems. This is a verification and audit tool — actual rotation must be performed through each API provider's console.
#!/bin/bash
# Northflank Breach Response — Secrets Audit and Rotation Verification
# Run this on hosts that store secrets to identify exposed credentials
# Date: 2026-04-06
set -euo pipefail
echo "=========================================="
echo " Secrets Audit — Northflank Breach Response"
eecho "=========================================="
echo ""
# --- Step 1: Find all .env and secrets files ---
echo "[*] Scanning for environment and secrets files..."
ENV_FILES=$(find /home /var/www /opt /srv /root /etc \
-maxdepth 6 \
\( -name ".env" -o -name ".env.local" -o -name ".env.production" \
-o -name "secrets.yaml" -o -name "secrets.yml" \
-o -name "credentials.json" -o -name ".api_keys" \) \
2>/dev/null || true)
if [ -z "$ENV_FILES" ]; then
echo "[+] No .env or secrets files found."
else
echo "[!] Found the following secrets files:"
echo "$ENV_FILES" | while read -r f; do
echo " - $f (modified: $(stat -c '%y' "$f" 2>/dev/null || echo 'unknown'))"
done
fi
# --- Step 2: Identify AI API keys in environment files ---
echo ""
echo "[*] Checking for AI API key patterns in found files..."
AI_KEY_PATTERNS=(
"sk-ant" # Anthropic
"sk-proj" # OpenAI project keys
"sk-" # OpenAI legacy keys (broader match)
"AIza" # Google AI / GCP API keys
"sk_live" # Stripe (often co-located)
)
for pattern in "${AI_KEY_PATTERNS[@]}"; do
MATCHES=$(echo "$ENV_FILES" | xargs grep -l "$pattern" 2>/dev/null || true)
if [ -n "$MATCHES" ]; then
echo "[!] POTENTIAL API KEY found (pattern: $pattern) in:"
echo "$MATCHES" | while read -r m; do
echo " - $m"
done
fi
done
# --- Step 3: Check environment variables of running processes ---
echo ""
echo "[*] Checking running processes for exposed AI API keys..."
for pid in $(ls /proc/ | grep -E '^[0-9]+$'); do
if [ -r "/proc/$pid/environ" ]; then
if strings "/proc/$pid/environ" 2>/dev/null | grep -qE '(sk-ant|sk-proj|sk-[a-zA-Z0-9]{20,}|AIza)'; then
PROC_NAME=$(cat "/proc/$pid/comm" 2>/dev/null || echo "unknown")
echo "[!] Process $pid ($PROC_NAME) has AI API keys in environment"
fi
fi
done
# --- Step 4: Check shell history for key exposure ---
echo ""
echo "[*] Checking shell histories for exposed API keys..."
find /home /root -name ".bash_history" -o -name ".zsh_history" 2>/dev/null | while read -r hist; do
if grep -qE '(sk-ant|sk-proj|sk-[a-zA-Z0-9]{20,}|AIza)' "$hist" 2>/dev/null; then
echo "[!] API key pattern found in shell history: $hist"
fi
done
# --- Step 5: Check for recent outbound connections to AI APIs ---
echo ""
echo "[*] Checking recent connections to AI API endpoints..."
AI_DOMAINS="api.openai.com|api.anthropic.com|generativelanguage.googleapis.com|api.cohere.ai|api.mistral.ai"
if command -v ss &>/dev/null; then
ss -tnp 2>/dev/null | grep -E "$AI_DOMAINS" || echo "[+] No active connections to AI API endpoints detected."
fi
echo ""
echo "=========================================="
echo " NEXT STEPS:"
echo " 1. Rotate ALL secrets stored on Northflank immediately"
echo " 2. Revoke and regenerate AI API keys at each provider console"
echo " 3. Review API usage logs at each AI provider for anomalies"
echo " 4. Check billing dashboards for unexpected usage spikes"
echo " 5. Audit database access logs if connection strings were exposed"
echo " 6. Move secrets to a dedicated secrets manager (Vault, AWS SM)"
echo "=========================================="
Remediation
Immediate Actions (Within 24 Hours)
-
Rotate all secrets stored on Northflank. This is Northflank's explicit guidance and it must be treated as mandatory. This includes every API key, database credential, service token, and connection string stored on the platform. Do not attempt to triage which secrets "might" have been accessed — rotate everything.
-
Revoke and regenerate AI API keys at the provider level. Do not just update the key value in Northflank — go to each AI provider's console (OpenAI, Anthropic, Google AI Studio, etc.) and explicitly revoke the old keys, then generate new ones. Revoking at the provider ensures the old key is immediately invalid regardless of any cached copies.
-
Review API usage and billing dashboards. Check each AI provider's usage logs for unexpected spikes in token consumption, unusual geographic access patterns, or API calls made outside your normal operating hours. This is where you'll find evidence of actual abuse.
-
Audit Northflank access logs. Review your Northflank organization's audit log for any unauthorized access, unexpected API tokens created, or configuration changes.
Short-Term Actions (Within 1 Week)
-
Audit all downstream services. If database credentials, cloud provider keys, or third-party service tokens were stored on Northflank, review access logs for those services as well. The AI API key abuse may be the visible tip of a larger iceberg.
-
Enable API usage alerts. Configure spending limits and usage alerts at every AI API provider. Set hard caps that prevent runaway billing if a key is compromised again.
-
Implement IP allowlisting for AI API keys where supported. Restricting API key usage to known IP ranges or VPC egress addresses significantly reduces the value of a stolen key.
Strategic Improvements
-
Move secrets to a dedicated secrets manager. Platform-integrated secrets storage (like Northflank's environment variable injection) is convenient but creates a single point of failure. Consider HashiCorp Vault, AWS Secrets Manager, Azure Key Vault, or Google Secret Manager with workload identity-based access — where secrets are fetched at runtime with short-lived tokens rather than stored as static environment variables.
-
Adopt short-lived credentials. Where possible, replace long-lived API keys with OIDC-based workload identity, IAM roles, or OAuth tokens that expire automatically. This limits the window of abuse when a credential is compromised.
-
Implement secrets scanning in CI/CD. Deploy tools like Gitleaks, TruffleHog, or GitGuardian to detect accidentally committed secrets before they reach a platform where they could be compromised at scale.
-
Review vendor risk. Add secrets management practices to your vendor assessment criteria. Ask PaaS and hosting providers how they store customer secrets, whether they use envelope encryption with HSM-backed keys, and what their breach notification SLAs are.
Lessons for Every Organization
This incident is not just a Northflank problem. Any organization that stores API keys, database credentials, or service tokens in a cloud platform's environment variable system faces the same risk. The pattern is clear: attackers are targeting the secrets layer because it provides the highest return on investment — one breach yields credentials for dozens or hundreds of downstream services.
The defense is architectural: minimize the number of places where static secrets exist, use short-lived credentials wherever possible, monitor API usage for anomalies, and have a pre-built credential rotation runbook that your team can execute in hours, not days. The organizations that respond fastest to secrets exposure are the ones that practiced the rotation process before they needed it.
Related Resources
Security Arsenal Managed SOC Services AlertMonitor Platform Book a SOC Assessment soc-mdr Intel Hub
Is your security operations ready?
Get a free SOC assessment or see how AlertMonitor cuts through alert noise with automated triage.