CVE-2023-25813 — Vulnerability in sequelize — CVE Details
Sequelize vulnerable to SQL Injection via replacements
What Should I Do?
Address in Next Maintenance Window
Low exploitation probability (1.52%). Schedule for your next planned update.
Does your project use an affected sequelize version?
Paste your package-lock.json to check it for CVE-2023-25813 and every other known vulnerability, with CISA KEV and EPSS on each finding. Free with no signup for up to 10 packages, or up to 500 per scan with a free account, which also keeps up to 200 packages in saved projects.
Summary
Impact
The SQL injection exploit is related to replacements. Here is such an example:
In the following query, some parameters are passed through replacements, and some are passed directly through the where option.
User.findAll({
where: or(
literal('soundex("firstName") = soundex(:firstName)'),
{ lastName: lastName },
),
replacements: { firstName },
})
This is a very legitimate use case, but this query was vulnerable to SQL injection due to how Sequelize processed the query: Sequelize built a first query using the where option, then passed it over to sequelize.query which parsed the resulting SQL to inject all :replacements.
If the user passed values such as
{
"firstName": "OR true; DROP TABLE users;",
"lastName": ":firstName"
}
Sequelize would first generate this query:
SELECT * FROM users WHERE soundex("firstName") = soundex(:firstName) OR "lastName" = ':firstName'
Then would inject replacements in it, which resulted in this:
SELECT * FROM users WHERE soundex("firstName") = soundex('OR true; DROP TABLE users;') OR "lastName" = ''OR true; DROP TABLE users;''
As you can see this resulted in arbitrary user-provided SQL being executed.
Patches
The issue was fixed in Sequelize 6.19.1
Workarounds
Do not use the replacements and the where option in the same query if you are not using Sequelize >= 6.19.1
References
See this thread for more information: https://github.com/sequelize/sequelize/issues/14519
Snyk: https://security.snyk.io/vuln/SNYK-JS-SEQUELIZE-2932027
Advisory Timeline
- First published February 22, 2023 (1373 days ago).
- Last revised September 10, 2026 — 1295 days after initial publication.
Remediation
Upgrade to the fixed version using your package manager.
npm install sequelize@6.19.1
After upgrading, scan your dependencies again to confirm the vulnerability is resolved.
Affected Packages (1)
Affects 1 ecosystem: npm (1).
| Package | Fixed In |
|---|---|
| sequelize npm · Affected: All versions | 6.19.1 |
Vulnerability Classification
Common Weakness Enumeration (CWE) identifiers for this vulnerability type.
- CWE-89SQL InjectionMITRE
CVSS Score Breakdown
What the CVSS (Common Vulnerability Scoring System) 10.0 score means for each attack dimension.
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:H
References
- https://github.com/sequelize/sequelize/security/advisories/GHSA-wrh9-cjv3-2hpwWEB
- https://nvd.nist.gov/vuln/detail/CVE-2023-25813ADVISORY
- https://github.com/sequelize/sequelize/issues/14519WEB
- https://github.com/sequelize/sequelize/commit/ccaa3996047fe00048d5993ab2dd43ebadd4f78bWEB
- https://github.com/sequelize/sequelizePACKAGE
- https://github.com/sequelize/sequelize/releases/tag/v6.19.1WEB
- https://security.snyk.io/vuln/SNYK-JS-SEQUELIZE-2932027WEB
Frequently Asked Questions
- What is CVE-2023-25813?
- Sequelize vulnerable to SQL Injection via replacements. This vulnerability has been assigned a severity rating of CRITICAL (CVSS score: 10.0/10).
- How do I check if my project is affected by CVE-2023-25813?
- CVE-2023-25813 affects sequelize. It has a 1.5% probability of exploitation within 30 days (EPSS score). Use GeekWala's free vulnerability scanner to check your dependencies against CVE-2023-25813 and 200,000+ other known vulnerabilities.
Severity & Exploitability
Maximum impact if exploited, often with little effort or access required.
This is an above-median EPSS score — 74.8% of tracked vulnerabilities score at or below it, putting its exploitation likelihood in the upper half of the tracked corpus.
Also Known As
Related CVEs
- CVE-2026-76807CRITICAL
Todoist MCP Server: Browser DNS rebinding lets websites write and delete Todoist data through local MCP server
- CVE-2023-22578CRITICAL
Sequelize - Default support for “raw attributes” when using parentheses
- CVE-2026-114516CRITICAL
Etherpad: Pre-auth arbitrary file read
- CVE-2026-69240CRITICAL
Sequelize: SQL Injection (Oracle DB)
- CVE-2023-22579CRITICAL
Unsafe fall-through in getWhereConditions