CVE-2016-20018 · mitre
CVE-2016-20018
Knex Knex.js through 2.3.0 has a limited SQL injection vulnerability that can be exploited to ignore the WHERE clause of a SQL query.
Published 2022-12-19, last changed 2026-06-17. Weakness: CWE-89.
How to fix
Upgrade to a fixed version: knex 2.4.0 (npm). For the version that clears every advisory for your installed version, ask an agent for get_remediation.
Where the flaw is in the code
Fixed in knex/knex by pull request #5417, e145322da9. Functions changed by the fix: whereRaw, isPlainObjectOrArray, output, whereBasic. Regression tests: test/unit/query/builder.js, test/db-less-test-suite.js, test/unit/dialects/mysql.js. Confidence: inferred (code changed near the fix, but no record names this exact commit as the fix).
Timeline
| 2022-12-19 | Published |
| 2022-12-19 | Package advisory GHSA-4jv9-3563-23j3 |
| 2026-06-17 | Record last changed |
| 2026-11-30 | EPSS when our history starts: 1.16% |
| 2026-12-03 | Code-level analysis added |
Affected packages
| Advisory | Package | Fixed in |
|---|---|---|
| GHSA-4jv9-3563-23j3 | knex (npm) | 2.4.0 |
Also known as: GHSA-4jv9-3563-23j3
Related
| CVE | Published | CVSS | Summary |
|---|---|---|---|
| CVE-2019-10757 | 2019-10-08 | 9.8 | same package: knex (npm) |
| CVE-2026-31158 | 2026-10-26 | 9.8 | same weakness (CWE-89) from the same CNA (mitre) |
| CVE-2026-107083 | 2026-10-19 | 9.8 | same weakness (CWE-89) from the same CNA (mitre) |
| CVE-2026-107082 | 2026-10-19 | 8.8 | same weakness (CWE-89) from the same CNA (mitre) |
| CVE-2026-107081 | 2026-10-19 | 9.8 | same weakness (CWE-89) from the same CNA (mitre) |
| CVE-2026-111444 | 2026-10-16 | 9.8 | same weakness (CWE-89) from the same CNA (mitre) |
| CVE-2026-93484 | 2026-10-15 | 8.6 | same weakness (CWE-89) from the same CNA (mitre) |
| CVE-2026-110911 | 2026-10-15 | 9.8 | same weakness (CWE-89) from the same CNA (mitre) |
Add it to your agent
One command for Claude Code; setup for Claude Desktop, Cursor and others. No signup or key.
claude mcp add --transport http keygraph-cve https://cve-mcp.keygraph.io/mcp
Then ask for triage_cve CVE-2016-20018, or call /api/v1/vulnerabilities/CVE-2016-20018. To prove whether it is exploitable in your running app, run Shannon, Keygraph's open-source AI pentester.