[Security] SQL Injection in Oracle Dialect JSON Path Handling (_jsonPathWrap())
Security Vulnerability Report
I've discovered a SQL injection vulnerability in knex's Oracle dialect, in _jsonPathWrap() (lib/dialects/oracledb/query/oracledb-querycompiler.js). This method builds a JSON-path SQL fragment by directly string-interpolating a user-supplied path argument into a quoted SQL literal, instead of going through knex's parameter/binding system the way the base compiler and every other dialect (mysql, postgres, sqlite3, mssql) do. Reachable via the public whereJsonPath() / jsonExtract() API.
CWE-89 | Affects: Oracle dialect (oracledb) only — other dialects correctly parameterize the same call.
I have a complete PoC demonstrating both a structure-breaking benign value and a full injection payload, verified against a real Oracle Database instance.
Since this repo has no SECURITY.md or private vulnerability reporting enabled, I'm creating this limited-disclosure issue.
The vulnerability is in the JSON-path query-building code path (whereJsonPath()/jsonExtract()), not general query parameter binding. Other query APIs are unaffected.
I'm happy to provide the full report, PoC code, and suggested fix privately.
Source: knex/knex