knex@0.6.5 vulnerabilities

A batteries-included SQL query & schema builder for PostgresSQL, MySQL, CockroachDB, MSSQL and SQLite3

  • latest version

    3.1.0

  • latest non vulnerable version

  • first published

    11 years ago

  • latest version published

    1 years ago

  • licenses detected

  • Direct Vulnerabilities

    Known vulnerabilities in the knex package. This does not include vulnerabilities belonging to this package’s dependencies.

    How to fix?

    Automatically find and fix vulnerabilities affecting your projects. Snyk scans for vulnerabilities and provides fixes for free.

    Fix for free
    VulnerabilityVulnerable Version
    • H
    SQL Injection

    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.

    How to fix SQL Injection?

    Upgrade knex to version 2.4.0 or higher.

    <2.4.0
    • C
    SQL Injection

    knex is a query builder for PostgreSQL, MySQL and SQLite3

    Affected versions of this package are vulnerable to SQL Injection. None

    How to fix SQL Injection?

    Upgrade knex to version 0.19.5 or higher.

    <0.19.5
    • M
    SQL Injection

    knex is a batteries-included SQL query & schema builder for Postgres, MySQL and SQLite3 and the Browser.

    Column names are not properly escaped in the postgreSQL dialect. This may allow attackers to craft a query to the host DB and access private information. Writing the following code:

    var query = knex.select('id","name').from('test')
    console.log(query.toSQL())
    

    Has the following result:

    { method: 'select',
      options: undefined,
      bindings: [],
      sql: 'select "id","name" from "test"' }
    

    How to fix SQL Injection?

    Upgrade knex to versions 0.6.23, 0.7.6 or higher.

    <0.6.23>=0.7.0 <0.7.6