CVE Tools

Description

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.

In plain language

AI Worth attention

CVE-2017-16082 is a serious security flaw in the `pg` Node module that can let an attacker run code on your server if your app uses `pg` and handles untrusted SQL or database query results with attacker-controlled column names; fix it if you’re using `pg` (and especially if any database input/output can be influenced from the network).

Executive summary

CVE-2017-16082 is a remote code execution vulnerability in the `pg` (pg node module) Node package, caused by unsafe handling of database column names (from crafted SQL text or from untrusted query results), allowing attackers to inject a specially crafted column name that leads to execution of unauthorized code on the server.

If affected, business impact
Full server compromiseMalware installed on the hostCustomer data theftBusiness disruption and downtime

What to do now

  1. Check whether your app uses the pg Node module to talk to PostgreSQL, and identify the installed pg version (from your package.json or node_modules/pg).
  2. If you use pg version 2.11.1 or earlier, plan an upgrade.
  3. Upgrade pg to a fixed version: at minimum 2.11.2 (or upgrade to a newer branch that is at or above its listed fixed version).
  4. Review how SQL queries and query results are handled: look for any user-supplied values being concatenated into SQL strings, or any logic that trusts column names coming from database results.
  5. After upgrading, test the affected code paths and confirm no remaining instances of vulnerable pg versions are present in the dependency tree.
npm install pg@^2.11.2
Usually a quick update

CVSS Vector Breakdown

AV:NAC:LPR:NUI:NS:UC:HI:HA:H
Exploitability
AV:NAttack Vector
Network
AC:LAttack Complexity
Low
PR:NPrivileges Required
None
UI:NUser Interaction
None
Scope
S:UScope
Unchanged
Impact
C:HConfidentiality
High
I:HIntegrity
High
A:HAvailability
High

Weaknesses

Affected Products

Exploitability

2 exploit sources identified

Exploit details including PoC links, Metasploit modules, and scanner templates are available after registration.

View exploit details
Official Patch Available

Attack Graph

Products CVE Techniques Tactics

Click technique nodes for MITRE ATT&CK details · drag to pan · Ctrl/ + scroll to zoom, or go fullscreen.

MITRE ATT&CK

2 techniques
Execution
Initial Access
View detailed technique mapping

References

and 2 more references View all →

Unlock Complete Vulnerability Intelligence

Get the full picture for CVE-2017-16082 and every CVE in our database. Create a free account — no credit card required.

Create Free Account
Plain-language analysis
Impact assessment and exploitation scenario in plain English
Attack graph visualization
Interactive attack path and kill chain mapping
Exploit details & PoC links
ExploitDB, Metasploit, GitHub PoCs with direct links
Nuclei scanner templates
Ready-to-use vulnerability scanner templates
Full remediation guide
Patch instructions, workarounds, and compliance impact
Interactive AI chat
Ask questions about this vulnerability in natural language
Related vulnerabilities
Semantically similar CVEs and attack patterns
REST API & MCP access
Integrate vulnerability data into your workflows