Remote code executionin the pg package.
Proof of concept public (GitHub).
A remote code execution vulnerability was found within the pg module when the remote database or query specifies a specially crafted column name. There are 2 likely scenarios in which one would likely be vulnerable. 1) Executing unsafe, user-supplied sql which contains a malicious column name. 2) Connecting to an untrusted database and executing a query which returns results where any of the column names are malicious.
- Upgrade pg (npm) to 2.11.2, 3.6.4, 4.5.7, 5.2.1, 6.0.5 or later, whichever matches your release line.
Affected and fixed versions
From the CVE record, NVD and package advisories. When no source has versions yet, this table says "not confirmed" instead of guessing.
From first report to first attacks
- 29 Oct 2017CVE ID reserved by hackerone.
- 7 Jun 2018Published in the CVE List.
- 27 Nov 2018First public proof of concept on GitHub.
- 17 Sep 2024CVE record last updated.
Attack code anyone can find
Exploit maturity: Proof of concept (GitHub).
Listed so defenders can judge how urgent this is and test systems they are authorised to test. Patchminder does not host exploit code; links open the source page. Labels for GitHub repositories come from their public details and are never a promise about the code. Run anything only in an isolated lab.
Report a link
Same weakness: Code injection
- node-postgres.com x_refsource_MISC
- nodesecurity.io x_refsource_MISC
Patchminder. CVE-2017-16082: Remote code execution in the pg package. https://patchminder.com/cve/cve-2017-16082/ (accessed 5 December 2026).