CVE-2023-25813 SQL Injection via replacements in sequelize
Attackers can execute arbitrary SQL commands via unescaped replacements in Sequelize queries, potentially reading or modifying database contents.
- Exploited in the wild
- Not known
- Login needed
- Not needed
- Attackable
- Over the internet
- Victim action needed
- Not needed
- Fix
- Available
What is CVE-2023-25813?
CVE-2023-25813 is a critical SQL injection vulnerability in sequelize, published on 22 Feb 2023. An attacker can exploit it over the internet without logging in, with no action from the victim.
Official description
Sequelize is a Node.js ORM tool. In versions prior to 6.19.1 a SQL injection exploit exists related to replacements. Parameters which are passed through replacements are not properly escaped which can lead to arbitrary SQL injection depending on the specific queries in use. The issue has been fixed in Sequelize 6.19.1. Users are advised to upgrade. Users unable to upgrade should not use the `replacements` and the `where` option in the same query.
Weakness: CWE-89
Which versions are affected by CVE-2023-25813?
2 open source packages ship an affected version, including sequelize. It affects 1 product.
| Package | Affected | Fixed in |
|---|---|---|
sequelize npm | All versions | 6.19.1 |
sequelize npm | All versions | 6.19.1 |
Products include Sequelizejs Sequelize.
How do I fix CVE-2023-25813?
Upgrade sequelize to 6.19.1 or later.
Use parameterised queries everywhere and never build SQL by joining strings. Upgrade affected software first; a web application firewall only buys time. More about SQL injection.
Is CVE-2023-25813 being exploited?
It is not confirmed as exploited in the wild, but public exploit code for CVE-2023-25813 exists.
Public exploit code: 6 proofs of concept on GitHub.
Other vulnerabilities in sequelize
Sources
Also known as GHSA-wrh9-cjv3-2hpw.