Skip to main content
Vulnerability Database/CVE-2026-103258

CVE-2026-103258: n8n Workflow Automation SQL Injection Flaw

CVE-2026-103258 is a SQL injection vulnerability in n8n workflow automation affecting SendGrid, Freshservice, and ServiceNow nodes. Attackers can bypass filters to expose bulk data. This article covers technical details, affected versions, impact, and mitigation strategies.

Published:

CVE-2026-103258 Overview

CVE-2026-103258 is a filter bypass vulnerability in the n8n workflow automation platform. The flaw affects the SendGrid, Freshservice, and ServiceNow nodes in n8n versions before 2.39.6 and 2.40.0 before 2.40.1. Unescaped parameter interpolation lets attackers break out of query literals and widen single-record lookups into match-all queries. Successful exploitation exposes bulk data such as contact lists, support tickets, and directory entries. The weakness maps to [CWE-943: Improper Neutralization of Special Elements in Data Query Logic].

Critical Impact

Attackers who control inputs bound to vulnerable node parameters can convert targeted lookups into bulk extraction of records from SendGrid, Freshservice, or ServiceNow backends.

Affected Products

  • n8n versions prior to 2.39.6
  • n8n 2.40.0 prior to 2.40.1
  • SendGrid, Freshservice, and ServiceNow nodes within affected n8n builds

Discovery Timeline

  • 2026-10-01 - CVE-2026-103258 published to NVD
  • 2026-10-06 - Last updated in NVD database

Technical Details for CVE-2026-103258

Vulnerability Analysis

The affected n8n nodes build backend queries by interpolating workflow parameter values directly into query strings. When those values are not escaped, user-controlled characters can terminate a literal and append arbitrary filter logic. The outcome is a classic query-logic injection in the integration layer rather than at the final database.

In practice, a workflow author or an upstream data source can supply input such as a quote character followed by a wildcard predicate. The constructed request to SendGrid, Freshservice, or ServiceNow then matches every record rather than one. The attacker never needs credentials to the downstream SaaS platform because the n8n workflow uses its own stored credentials.

Root Cause

The root cause is missing neutralization of special characters during parameter interpolation inside the SendGrid, Freshservice, and ServiceNow node implementations. The query construction logic trusts parameter values that may originate from untrusted external input, violating the separation between code and data that [CWE-943] describes.

Attack Vector

Exploitation requires that a vulnerable node parameter be bound to untrusted external input, for example a webhook payload field, an inbound email body, or a value fetched from a public API. The attacker submits a crafted string that closes the intended query literal and injects a match-all predicate. The node issues the broadened query under the workflow's stored SaaS credentials and returns the full result set to the next workflow step, where it may be logged, emailed, or written to storage reachable by the attacker.

No verified public proof-of-concept is available. See the GitHub Security Advisory GHSA-5pg9-2vqx-r6jm and the Vulncheck Advisory for n8n for vendor-provided technical details.

Detection Methods for CVE-2026-103258

Indicators of Compromise

  • Outbound SendGrid, Freshservice, or ServiceNow API requests that return unusually large result sets compared to the workflow's historical baseline.
  • Workflow execution logs showing parameter values containing stray quote characters, logical operators, or wildcard tokens.
  • Spikes in data egress from n8n hosts to SaaS integration endpoints following webhook or inbound-trigger events.

Detection Strategies

  • Review n8n execution history for the affected nodes and compare per-execution record counts against expected single-record retrievals.
  • Audit all workflows that bind SendGrid, Freshservice, or ServiceNow node parameters to webhook, HTTP request, or email trigger outputs.
  • Correlate SaaS-side audit logs (SendGrid activity feed, Freshservice admin audit, ServiceNow transaction logs) with n8n workflow runs to identify broadened queries.

Monitoring Recommendations

  • Alert on n8n node executions whose returned payload size exceeds a defined threshold or deviates from historical norms.
  • Monitor the n8n version in use and flag deployments running builds earlier than 2.39.6 or 2.40.0 through 2.40.0.
  • Log and inspect untrusted inputs that feed node parameters, looking for characters used to break out of query literals.

How to Mitigate CVE-2026-103258

Immediate Actions Required

  • Upgrade n8n to version 2.39.6 or 2.40.1, or any later release that includes the fix.
  • Inventory workflows that use the SendGrid, Freshservice, and ServiceNow nodes and identify which parameters receive external input.
  • Rotate API credentials for SendGrid, Freshservice, and ServiceNow if execution logs indicate suspicious broadened queries.

Patch Information

The maintainers released fixed builds in n8n 2.39.6 and 2.40.1. Refer to the GitHub Security Advisory GHSA-5pg9-2vqx-r6jm for the authoritative patch details and release notes.

Workarounds

  • Validate and sanitize any untrusted input before binding it to SendGrid, Freshservice, or ServiceNow node parameters, rejecting quote characters and query operators.
  • Restrict the scope of API credentials used by n8n so that broadened queries return only the minimum data required by the workflow.
  • Disable or gate workflows that pass webhook, email, or external HTTP response data directly into the affected node parameters until the upgrade is applied.
bash
# Upgrade n8n using npm
npm install -g n8n@2.40.1

# Or pull the fixed Docker image
docker pull n8nio/n8n:2.40.1
docker stop n8n && docker rm n8n
docker run -d --name n8n -p 5678:5678 n8nio/n8n:2.40.1

Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

Experience the Most Advanced Cybersecurity Platform

See how the world’s most intelligent, autonomous cybersecurity platform can protect your organization today and into the future.