CVE-2023-25813: Sequelize SQL Injection via Replacements

sequelize Updated 02 Oct 2025

Summary

22/02/2023
Yes i
Critical
10.0

CVE-2023-25813: Sequelize vulnerable to SQL Injection via replacements. Affects sequelize versions < 6.19.1. Fixed in 6.19.1. How to fix ↓

Free scan

Check if this vulnerability affects your application

Upload a manifest or SBOM and we'll show whether you're affected, plus every other risky package in the same scan.

Check my app free

No signup required · Results in about 60 seconds

Upload your dependency manifest or SBOM

Drag & drop your file here or

Java Javascript PHP Python Go Rust Ruby Dart C/C++ Elixir CycloneDX SPDX

Upload a supported dependency manifest or SBOM. No installation or source-code access required.

See supported files and SBOM formats
SBOM sbom.json · bom.json · bom.xml · *.spdx.json · *.cdx.json · *.cdx.xml
Java pom.xml · gradle.lockfile · buildscript-gradle.lockfile
Javascript package-lock.json · yarn.lock · pnpm-lock.yaml
PHP composer.lock
Python poetry.lock · requirements.txt · Pipfile.lock
Go go.mod
Rust Cargo.lock
Ruby Gemfile.lock
Dart pubspec.lock
C/C++ conan.lock
Elixir mix.lock
Enter your work email to receive your report link.

Verify your email to view the full report and start 30 days of continuous monitoring. No credit card required.

Sponsored MarkAI Find prospects already talking about the problem you solve AI watches the communities your customers use to find qualified prospects, then alerts you when a conversation is worth joining. See MarkAI

Background

Sequelize is an open-source Node.js ORM (Object-Relational Mapping) library for accessing relational databases. It provides an easy-to-use API for performing database operations and supports various database systems. However, Sequelize versions prior to 6.19.1 are vulnerable to SQL Injection attacks when using replacements in conjunction with the where option. This vulnerability allows an attacker to execute arbitrary SQL queries, potentially leading to unauthorized access, data manipulation, or even data loss.

Vulnerability Detail

The SQL Injection vulnerability in Sequelize arises due to the way it processes queries with replacements and the where option. When constructing a query, Sequelize first builds the query using the where option and then passes it to sequelize.query, which injects the replacements. However, this process can be exploited by an attacker to inject malicious SQL code. By providing specially crafted values for the replacements, an attacker can manipulate the resulting SQL query and execute arbitrary SQL statements. For example, an attacker could pass a value like "OR true; DROP TABLE users;" as a replacement, resulting in the execution of unintended SQL commands.

How To Fix

Latest published version: 6.37.8 as of 23 Oct 2026

npm install sequelize@6.37.8

Upgrading to it may include breaking changes; the version below is the minimum fixed release for this vulnerability.

If you need the minimum change

6.19.1

This is the first release that contains the fix.

npm install sequelize@6.19.1

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Workaround

If you are unable to immediately upgrade to Sequelize 6.19.1, a workaround is to avoid using the replacements and where options together in the same query. By separating the replacements and the where conditions, you can reduce the risk of SQL Injection. Instead of using replacements, consider using parameterized queries or sanitizing user input before constructing the query.

Conclusion

The Sequelize SQL Injection vulnerability allows attackers to execute arbitrary SQL queries, posing a significant risk to the integrity and security of the affected database. It is crucial to upgrade to Sequelize 6.19.1 or later to fix this vulnerability. If immediate upgrade is not possible, follow the provided workaround and ensure proper input sanitization. For further assistance and support in vulnerability remediation, contact DevNack.com.

See every vulnerability recorded for sequelize →

Share this vulnerability

FAQ

Sequelize is an open-source Node.js ORM library that provides an easy-to-use API for interacting with relational databases.

SQL Injection is a type of security vulnerability where an attacker can manipulate SQL queries to execute unintended commands or gain unauthorized access to a database.

The vulnerability occurs when Sequelize processes queries with replacements and the where option. Improper handling of replacements allows an attacker to inject malicious SQL code.

Exploiting this vulnerability can lead to unauthorized access, data manipulation, or even data loss. An attacker could execute arbitrary SQL statements, potentially compromising the integrity and confidentiality of the database.

To mitigate the risk, it is recommended to upgrade to Sequelize version 6.19.1 or later. Additionally, separate the replacements and where conditions in your queries, and consider using parameterized queries or sanitizing user input.

Related vulnerabilities

Recent vulnerabilities recorded for sequelize.

How To Fix

Latest published version: 6.37.8 as of 23 Oct 2026

npm install sequelize@6.37.8

Upgrading to it may include breaking changes; the version below is the minimum fixed release for this vulnerability.

If you need the minimum change

6.19.1

This is the first release that contains the fix.

npm install sequelize@6.19.1

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Subscribe to Vulert on Telegram
Daily digest of new CVEs, critical and high severity, affected packages and fixes — plus a weekly roundup.
Join the channel →
Help improve this record
Report an issue or send feedback