CVE-2017-16082: Remote Code Execution in pg
9.8
CVSS Score
3.0
Basic Information
CVE ID
GHSA ID
EPSS Score
0.98638%
CWE
Published
7/24/2018
Updated
9/11/2023
KEV Status
No
Technology
JavaScript
Technical Details
CVSS Vector
CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
Package Name | Ecosystem | Vulnerable Versions | First Patched Version |
---|---|---|---|
pg | npm | < 2.11.2 | 2.11.2 |
pg | npm | >= 3.0.0, < 3.6.4 | 3.6.4 |
pg | npm | >= 4.0.0, < 4.5.7 | 4.5.7 |
pg | npm | >= 5.0.0, < 5.2.1 | 5.2.1 |
pg | npm | >= 6.0.0, < 6.0.5 | 6.0.5 |
pg | npm | >= 6.1.0, < 6.1.6 | 6.1.6 |
pg | npm | >= 6.2.0, < 6.2.5 | 6.2.5 |
pg | npm | >= 6.3.0, < 6.3.3 | 6.3.3 |
pg | npm | >= 6.4.0, < 6.4.2 | 6.4.2 |
pg | npm | >= 7.0.0, < 7.0.2 | 7.0.2 |
pg | npm | >= 7.1.0, < 7.1.2 | 7.1.2 |
Vulnerability Intelligence
Miggo AI
Root Cause Analysis
The security patches modify the inlineParser
function in lib/result.js
to properly escape column names. This function generates row parser code via string concatenation, and the original implementation only replaced the first single quote in column names. Attackers could craft column names with unescaped quotes to inject arbitrary JavaScript code during result parsing. The function would appear in runtime profiles when processing malicious query results, as it's directly responsible for handling column names during result set parsing.