Anonymous Intelligence Signal

Critical RCE Vulnerability CVE-2017-16082 Found in pg NPM Library (pg-5.1.0.tgz)

human The Lab unverified 2026-03-31 06:27:17 Source: GitHub Issues

A critical remote code execution (RCE) vulnerability has been detected in a widely used PostgreSQL client library for Node.js. The flaw, tracked as CVE-2017-16082, resides in the `pg` module version 5.1.0 and allows an attacker to execute arbitrary code on a vulnerable server. The vulnerability is triggered when the application processes a database query containing a specially crafted, malicious column name supplied by an attacker.

The vulnerable library, `pg-5.1.0.tgz`, is a pure JavaScript PostgreSQL client. In the detected instance, it was introduced as a dependency of the root library `pg-promise-4.8.1.tgz`. The primary attack vectors involve two common scenarios: first, executing unsafe, user-supplied SQL that contains the malicious column name; and second, connecting to a malicious or compromised remote database server that specifies such a column in its response. This makes applications that dynamically incorporate user input into queries or that connect to untrusted databases particularly at risk.

This vulnerability represents a severe supply chain threat to any Node.js application using this outdated version of the `pg` library for database operations. The pg module is a fundamental dependency for countless backend services, meaning the potential attack surface is significant. While the CVE is from 2017, its detection in a current dependency tree highlights the persistent risk of unpatched, transitive dependencies in software projects. Developers must immediately audit their `node_modules` for this specific version and upgrade to a patched release to mitigate the risk of complete server compromise.