Miggo Logo

CVE-2017-16082: Remote Code Execution in pg

9.8

CVSS Score
3.0

Basic Information

EPSS Score
0.98638%
Published
7/24/2018
Updated
9/11/2023
KEV Status
No
Technology
TechnologyJavaScript

Technical Details

CVSS Vector
CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
Package NameEcosystemVulnerable VersionsFirst Patched Version
pgnpm< 2.11.22.11.2
pgnpm>= 3.0.0, < 3.6.43.6.4
pgnpm>= 4.0.0, < 4.5.74.5.7
pgnpm>= 5.0.0, < 5.2.15.2.1
pgnpm>= 6.0.0, < 6.0.56.0.5
pgnpm>= 6.1.0, < 6.1.66.1.6
pgnpm>= 6.2.0, < 6.2.56.2.5
pgnpm>= 6.3.0, < 6.3.36.3.3
pgnpm>= 6.4.0, < 6.4.26.4.2
pgnpm>= 7.0.0, < 7.0.27.0.2
pgnpm>= 7.1.0, < 7.1.27.1.2

Vulnerability Intelligence
Miggo AIMiggo AI

Miggo AIRoot 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.

Vulnerable functions

Only Mi**o us*rs **n s** t*is s**tion

WAF Protection Rules

WAF Rule

*****t** v*rsions o* `p*` *ont*in * r*mot* *o** *x**ution vuln*r**ility t**t o**urs w**n t** r*mot* **t***s* or qu*ry sp**i*i*s * *r**t** *olumn n*m*. T**r* *r* two sp**i*i* s**n*rios in w*i** it is lik*ly *or *n *ppli**tion to ** vuln*r**l*: *. T*

Reasoning

T** s**urity p*t***s mo*i*y t** `inlin*P*rs*r` *un*tion in `li*/r*sult.js` to prop*rly *s**p* *olumn n*m*s. T*is *un*tion **n*r*t*s row p*rs*r *o** vi* strin* *on**t*n*tion, *n* t** ori*in*l impl*m*nt*tion only r*pl**** t** *irst sin*l* quot* in *olu