CVE-2019-10757 SQL Injection in knex

Critical 9.8 Published Updated

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.

PackageAffectedFixed in
knex npmAll versions0.19.5
knex npmAll versions0.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.

Sources

Also known as GHSA-58v4-qwx5-7f59, SNYK-JS-KNEX-471962.

Is CVE-2019-10757 in your software?

Upload an SBOM and sbomify checks it against every vulnerability here, every day.

Check your SBOMs for free