/

CVE-2026-42233

Severity:

CRITICAL RISK

(9.8)

SQL Injection in n8n Oracle Database Node

CVE-2026-42233

Analyzed

Vulnerability type

Category:

SQL Injection

CWE:

CWE-89

Impact:

Arbitrary SQL Query Execution and Data Exfiltration

Severity:

CRITICAL RISK

(9.8)

CVSS version:

3.1

Catch this CVE while code is being written

Detect vulnerable code directly in pull requests, so CVEs are fixed before merge.

Summary

A SQL injection flaw in n8n's Oracle Database node allowed user-controlled data in the Limit field to be interpolated directly into SELECT queries without sanitization or parameterization.

In workflows that route external input (for example, from webhooks) into this field, an attacker could inject arbitrary SQL and exfiltrate data from the connected Oracle database.

Affected context

This vulnerability occurs in n8n workflows that use the Oracle Database node's select operation and accept dynamic input into the Limit field via expressions.

It becomes relevant when workflow authors bind data from external or semi-trusted sources (such as webhooks, HTTP forms, or other user-controlled channels) into this field.

Environments where the Oracle node has access to sensitive schemas, production databases, or shared database accounts are particularly exposed, but even internal-only deployments can be affected if untrusted or less-controlled data is allowed to flow into the Limit expression.

Exploit preconditions

  • Attack surface: n8n workflows using the Oracle Database node's select operation with expression-driven Limit values.
  • Required access: Ability to supply or influence the data that flows into the Limit field expression (e.g., sending HTTP requests to a webhook or API endpoint that the workflow consumes).
  • Trigger point: Execution of the affected Oracle select node when it constructs and sends the SQL query using the unsanitized Limit expression value.
  • Why exploitation is possible: The Limit field content is concatenated directly into the SQL query string without proper parameterization or validation, allowing crafted input to alter the structure of the query instead of being treated as a simple numeric limit.

Why this happens

The underlying bug is a classic SQL injection pattern mapped to CWE-89: Improper Neutralization of Special Elements used in an SQL Command.

Instead of treating the Limit value as data, the implementation interpolated expressions directly into the SQL query string, assuming numeric content and not applying any parameterization or strict validation.

Because the query builder did not constrain or sanitize the resulting string, any special SQL characters or fragments embedded in the Limit expression could break out of the intended context and modify the query, enabling arbitrary SQL to be executed under the database credentials configured for the Oracle node.

Potential impact

  • An attacker could exfiltrate data from the connected Oracle database, including sensitive tables reachable by the node's credentials.
  • The attacker could read or enumerate additional schemas and metadata, depending on database permissions.
  • Malicious queries could modify or delete data (INSERT/UPDATE/DELETE) if the configured account has write privileges.
  • In some deployments, chained SQL features (e.g., stored procedures, database jobs) could be leveraged for further lateral movement or escalation within the database environment.

General mitigation guidance

Effective mitigation centers on treating all dynamic query components as untrusted and ensuring they cannot alter SQL structure:

  • Prefer parameterized queries or query builder abstractions that strictly separate data from SQL syntax, even for fields like Limit and offset.
  • Constrain dynamic numeric fields by validating input types and ranges before building queries (for example, enforcing integer-only values and safe bounds).
  • Avoid directly concatenating expression outputs into SQL; use whitelisting for allowable patterns if dynamic behavior is required (such as a fixed set of safe numeric limits).
  • Isolate database credentials used by automation workflows to least-privilege accounts, limiting the impact if a query is compromised.
  • Encourage workflow authors to treat any data coming from webhooks or other external integrations as untrusted and subject to validation before use in database nodes.

How teams detect issues like this

Organizations can detect and monitor for similar flaws through multiple approaches:

  • Static analysis and code review: Flag any query-building logic that string-concatenates user-controlled or expression-derived values into SQL clauses (including Limit, ORDER BY, or WHERE) without parameterization or type checks.
  • Configuration and workflow review: Periodically review n8n workflows for database nodes that accept raw external input into advanced fields, especially those controlling query structure.
  • Database-level monitoring: Use SQL logging, database audit trails, and anomaly detection to surface unusual query patterns, such as unexpected concatenated fragments or attempts to access unrelated tables.
  • Policy enforcement: Establish guardrails in CI/CD or deployment pipelines that prevent shipping automation workflows or extensions with ad-hoc SQL string construction from unvalidated inputs.

Sources

SourceLink
github.comgithub.com/n8n-io/n8n/security/advisories/GHSA-r6jc-mpqw-m755

Frequently asked

questions

Exploitability depends on whether an n8n workflow uses the Oracle Database node with a Limit field bound to external input. In such workflows, any party who can influence that input (for example, sending data to a webhook) may attempt SQL injection, but workflows that do not expose this field to untrusted data are less directly affected.

The attacker must be able to supply or manipulate data that flows into the Limit expression, typically via an integration such as a webhook, API trigger, or another node that receives user-controlled input. Direct access to the n8n UI or configuration is not strictly required if the workflow already routes external data into this field.

The most robust fix is to eliminate direct string interpolation of untrusted values into SQL and use parameterized queries or strongly typed query builders. Additionally, enforce strict validation for fields that control query structure (like Limit), ensuring they accept only well-formed, bounded numeric values.

Prevention involves adopting secure-by-default patterns for database access: mandate parameterization, avoid dynamic SQL where possible, validate and constrain all external inputs, and implement security reviews for workflows or components that construct queries. Training developers and workflow authors to recognize injection risks and integrating static checks into development pipelines further reduces the likelihood of similar vulnerabilities.

Find out what's already
exploitable in your codebase.