CVE-2017-16082
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 attentionCVE-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).
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.
What to do now
- Check whether your app uses the
pgNode module to talk to PostgreSQL, and identify the installedpgversion (from yourpackage.jsonornode_modules/pg). - If you use
pgversion 2.11.1 or earlier, plan an upgrade. - Upgrade
pgto a fixed version: at minimum2.11.2(or upgrade to a newer branch that is at or above its listed fixed version). - 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.
- After upgrading, test the affected code paths and confirm no remaining instances of vulnerable
pgversions are present in the dependency tree.
npm install pg@^2.11.2CVSS Vector Breakdown
AV:NAttack VectorAC:LAttack ComplexityPR:NPrivileges RequiredUI:NUser InteractionS:UScopeC:HConfidentialityI:HIntegrityA:HAvailabilityWeaknesses
Affected Products
Exploitability
Exploit details including PoC links, Metasploit modules, and scanner templates are available after registration.
View exploit detailsAttack Graph
Click technique nodes for MITRE ATT&CK details · drag to pan · Ctrl/⌘ + scroll to zoom, or go fullscreen.
MITRE ATT&CK
2 techniquesReferences
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