CVE-2019-10757 SQL Injection in knex
Attackers can execute arbitrary SQL commands via crafted identifiers in MSSQL 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-2019-10757?
CVE-2019-10757 is a critical SQL injection vulnerability in knex.js, published on 8 Oct 2019. An attacker can exploit it over the internet without logging in, with no action from the victim.
Official description
knex.js versions before 0.19.5 are vulnerable to SQL Injection attack. Identifiers are escaped incorrectly as part of the MSSQL dialect, allowing attackers to craft a malicious query to the host DB.
Weakness: CWE-89
Which versions are affected by CVE-2019-10757?
2 open source packages ship an affected version, including knex. It affects 1 product.
| Package | Affected | Fixed in |
|---|---|---|
knex npm | All versions | 0.19.5 |
knex npm | All versions | 0.19.5 |
Products include Knexjs Knex.
How do I fix CVE-2019-10757?
Upgrade knex to 0.19.5 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-2019-10757 being exploited?
There is no known exploitation of CVE-2019-10757 in the wild and no public exploit code.
Other vulnerabilities in knex.js
Sources
Also known as GHSA-58v4-qwx5-7f59, SNYK-JS-KNEX-471962.