Remote Code Execution in pg
HackerOne pg node module
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| pg npm |
|
HackerOne pg node module
| Product | Affected | Fixed in |
|---|---|---|
| pg npm |
|
≥ 7.0.0 · < 7.0.2≥ 7.1.0 · < 7.1.2
|
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.
From the CVE record · hackerone
The pg module is vulnerable to remote code execution when a query result has a specially crafted column name. This can occur when an application executes unsafe, user-supplied SQL or queries an untrusted database that returns a malicious column name.
Teams using the npm pg package should check installations in the affected ranges below 2.11.2, 3.6.4, 4.5.7, 5.2.1, 6.0.5, 6.1.6, 6.2.5, 6.3.3, 6.4.2, 7.0.2, or 7.1.2, respectively.