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.
Affected products
| Vendor | Product | Affected | Fixed |
|---|---|---|---|
| HackerOne | pg node module | < 2.11.2 || >= 3.0.0 < 3.6.4 || >= 4.0.0 < 4.5.7 || >= 5.0.0 < 5.2.1 || >= 6.0.0 < 6.0.5 || >= 6.1.0 < 6.1.6 || >= 6.2.0 < 6.2.5 || >= 6.3.0 < 6.3.3 || >= 6.4.0 < 6.4.2 || >= 7.0.0 < 7.0.2 || >= 7.1.0 < 7.1.2 | — |
Fixed in Linux distributions
Distributions backport fixes, so the version that fixes this vulnerability differs per release — upgrade to at least the version shown. From the distributions' security trackers and advisories.
Debian
Security tracker ↗| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| Debian 14 | node-postgres | 7.7.1-1 | — |
| Debian 13 | node-postgres | 7.7.1-1 | — |
| Debian 12 | node-postgres | 7.7.1-1 | — |
Ubuntu
Security tracker ↗| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| Ubuntu 16.04 LTS | node-postgres | No fix yet | — |
Public exploits
Exploit or proof-of-concept code for this vulnerability is publicly available, which lowers the bar for attackers. Treat it as a reason to patch sooner.
GitHub 1 repository
-
nulldreams/CVE-2017-16082 ★ 5 · Nov 27, 2018
NodeJS + Postgres (Remote Code Execution) 🛰
Sources: PoC-in-GitHub, Metasploit Framework, Exploit-DB — updated daily. Only links are listed; no exploit code is hosted here.
Affected packages
| Ecosystem | Package | Affected | Fixed | Record |
|---|---|---|---|---|
| npm | pg | < 2.11.2 | 2.11.2 | GHSA-wc9v-mj63-m9g5 |
| npm | pg | >= 3.0.0, < 3.6.4 | 3.6.4 | GHSA-wc9v-mj63-m9g5 |
| npm | pg | >= 4.0.0, < 4.5.7 | 4.5.7 | GHSA-wc9v-mj63-m9g5 |
| npm | pg | >= 5.0.0, < 5.2.1 | 5.2.1 | GHSA-wc9v-mj63-m9g5 |
| npm | pg | >= 6.0.0, < 6.0.5 | 6.0.5 | GHSA-wc9v-mj63-m9g5 |
| npm | pg | >= 6.1.0, < 6.1.6 | 6.1.6 | GHSA-wc9v-mj63-m9g5 |
| npm | pg | >= 6.2.0, < 6.2.5 | 6.2.5 | GHSA-wc9v-mj63-m9g5 |
| npm | pg | >= 6.3.0, < 6.3.3 | 6.3.3 | GHSA-wc9v-mj63-m9g5 |
| npm | pg | >= 6.4.0, < 6.4.2 | 6.4.2 | GHSA-wc9v-mj63-m9g5 |
| npm | pg | >= 7.0.0, < 7.0.2 | 7.0.2 | GHSA-wc9v-mj63-m9g5 |
| npm | pg | >= 7.1.0, < 7.1.2 | 7.1.2 | GHSA-wc9v-mj63-m9g5 |