/

CVE-2026-69240

Severity:

CRITICAL RISK

(9.8)

SQL Injection (CWE-89) in Sequelize Oracle Dialect

CVE-2026-69240

Received

Vulnerability type

Category:

SQL Injection

CWE:

CWE-89

Impact:

Arbitrary SQL Execution / Database Compromise

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 vulnerability in Sequelize's Oracle dialect allows crafted string values beginning with TO_TIMESTAMP or TO_DATE to bypass quote escaping.

When application input reaches this escape path, an attacker can inject arbitrary SQL expressions, leading to full database compromise under affected configurations.

Affected context

This vulnerability appears in Node.js applications that use Sequelize with the Oracle dialect, specifically when application values are passed through the SQL string escape helper.

It is most relevant where user-controlled or otherwise untrusted data can be formatted as strings starting with TO_TIMESTAMP or TO_DATE, and then embedded into queries without additional validation or parameterization.

The risk grows in applications that rely heavily on dynamic query construction or custom query helpers that call Sequelize's escape function directly.

Exploit preconditions

  • Attack surface: Application endpoints or interfaces that accept text inputs and pass them into Sequelize queries using the Oracle dialect.
  • Required access: Ability to supply or influence string values that are ultimately escaped via sql-string.js (e.g., web form fields, API parameters, query builders).
  • Trigger point: The escape function returns the raw string when it begins with TO_TIMESTAMP or TO_DATE, leaving quotes and SQL syntax unescaped before being concatenated into a query.
  • Why exploitation is possible: Instead of treating the input strictly as data and safely escaping quotes, the Oracle-specific logic trusts the string pattern and returns it directly, allowing attackers to craft values that alter the structure of the resulting SQL statement.

Why this happens

The underlying bug is an injection-prone escaping strategy in the Oracle dialect, mapping directly to CWE-89: Improper Neutralization of Special Elements used in an SQL Command.

The escape routine in sql-string.js implements special handling for strings beginning with TO_TIMESTAMP or TO_DATE, assuming they are safe date/time expressions and returning them without escaping single quotes.

This design turns what should be inert data into potentially executable SQL syntax, creating a classic injection channel whenever those strings originate from untrusted input.

Potential impact

  • Attackers may execute arbitrary SQL queries against the backing Oracle database.
  • They could read sensitive tables, including user records, credentials, or business data.
  • They may modify or delete application data, causing corruption or loss of integrity.
  • They can potentially escalate to database-level privileges, affecting other schemas or services that share the same database instance.
  • In some environments, they could chain database access to broader system compromise through stored procedures or external integrations.

General mitigation guidance

Effective mitigation focuses on eliminating string-based query concatenation and special-case escaping in favor of robust parameterization.

Common defensive patterns include:

  • Using prepared statements or bound parameters for all dynamic values, avoiding manual construction of SQL fragments wherever possible.
  • Treating all user-controlled or variable data as parameters, not as inline SQL expressions, especially for date/time conversion functions.
  • Applying strict validation and normalization to inputs that represent dates or timestamps, rejecting values that attempt to embed SQL syntax.
  • Centralizing query construction logic and discouraging application code from bypassing ORM parameterization APIs.
  • Configuring database accounts with least privilege so that, if injection occurs, the scope of damage is limited.

How teams detect issues like this

High-level detection approaches often combine code-centric and policy-based techniques:

  • Static analysis rules that flag use of raw SQL strings, concatenation of variables into queries, or calls to escape helpers with untrusted input.
  • Code review checklists that require reviewers to confirm the use of parameterized queries for all user-influenced values, especially in Oracle-specific code paths.
  • Organizational policies that prohibit direct use of SQL escape utilities in application logic and mandate the ORM's parameter binding features.
  • Periodic scanning for patterns like TO_TIMESTAMP or TO_DATE embedded directly in SQL templates where placeholders should be used.
  • Integration of automated secure coding tools into CI pipelines to highlight risky injection patterns before deployment.

Sources

SourceLink
github.comgithub.com/sequelize/sequelize/commit/5deadd2410ae9136a21fb652db206d27bb715f26
github.comgithub.com/sequelize/sequelize/releases/tag/v6.37.4
github.comgithub.com/sequelize/sequelize/security/advisories/GHSA-v8fg-2rw7-q452

Frequently asked

questions

Exploitability depends on whether an application uses Sequelize with the Oracle dialect and allows untrusted input to be incorporated into values that pass through the escape function. If those conditions are met and inputs can be shaped to start with TO_TIMESTAMP or TO_DATE, exploitation can be straightforward.

An attacker typically needs the ability to submit or influence application data that is mapped into query values, such as HTTP request parameters, form fields, or API payloads. Direct database access is not required; the attack leverages the application's own query execution.

The safest general fix is to rely exclusively on parameterized queries and bound variables provided by the ORM, avoiding manual string concatenation and custom escaping logic. Any special handling for date/time or other functions should be implemented using parameters and explicit schema constraints rather than inline string manipulation.

Teams can enforce a secure-by-default query pattern, mandating parameterization for all dynamic values, combined with strict input validation and least-privilege database accounts. Adding automated checks for raw SQL usage in code, along with security-focused code review practices, helps catch injection-prone patterns early in the development lifecycle.

Find out what's already
exploitable in your codebase.