{"answers":{"affected":"22 open source packages ship an affected version, including pg. It affects 1 product.","exploited":"There is no known exploitation of CVE-2017-16082 in the wild and no public exploit code.","fix":"Upgrade pg to a fixed version for your release line: 2.11.2, 3.6.4, 4.5.7 or 5.2.1.","what":"CVE-2017-16082 is a critical code injection vulnerability in HackerOne pg node module, published on 7 Jun 2018. An attacker can exploit it over the internet without logging in, with no action from the victim."},"fix_prompt":"Check this codebase for CVE-2017-16082 and fix it if it is affected.\n\nWhat it is: CVE-2017-16082 is a critical code injection vulnerability in HackerOne pg node module, published on 7 Jun 2018. An attacker can exploit it over the internet without logging in, with no action from the victim.\nExploitation: There is no known exploitation of CVE-2017-16082 in the wild and no public exploit code.\n\nAffected packages and fixed versions:\n- pg (npm): affected all versions; fixed in 2.11.2\n- pg (npm): affected all versions; fixed in 2.11.2\n- pg (npm): affected from 3.0.0; fixed in 3.6.4\n- pg (npm): affected from 3.0.0; fixed in 3.6.4\n- pg (npm): affected from 4.0.0; fixed in 4.5.7\n- pg (npm): affected from 4.0.0; fixed in 4.5.7\n- pg (npm): affected from 5.0.0; fixed in 5.2.1\n- pg (npm): affected from 5.0.0; fixed in 5.2.1\n- pg (npm): affected from 6.0.0; fixed in 6.0.5\n- pg (npm): affected from 6.0.0; fixed in 6.0.5\n- pg (npm): affected from 6.1.0; fixed in 6.1.6\n- pg (npm): affected from 6.1.0; fixed in 6.1.6\n\nTask:\n1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.\n2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.\n3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.\n4. Run the tests and summarise what changed and why.\n5. If nothing in the project is affected, say so and change nothing.\n\nReference: https://insights.sbomify.com/CVE-2017-16082/ (Markdown: https://insights.sbomify.com/CVE-2017-16082/index.md)","id":"CVE-2017-16082","markdown":"https://insights.sbomify.com/CVE-2017-16082/index.md","name":"CVE-2017-16082","record":{"aliases":["DEBIAN-CVE-2017-16082","GHSA-wc9v-mj63-m9g5","UBUNTU-CVE-2017-16082"],"analysis":{"component_type":"library","fix_type":"upgrade","impacts":["code_execution"],"network_reachable":"yes","non_default_config":false,"product_category":"Node.js PostgreSQL client","requires_auth":"none","summary":"Remote code execution in the pg Node.js module via crafted column names from untrusted databases or unsafe SQL queries.","user_interaction":"not_required","vuln_class":"code_injection"},"analysis_generated_by":"qwen3.8-flash-next","assigner":"hackerone","cpe":[{"product":"pg","vendor":"node-postgres"}],"cvss":{"score":9.8,"severity":"critical","source":"nvd","vector":"CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H","version":"3.0"},"cwes":[{"id":"CWE-94","name":"Improper Control of Generation of Code"}],"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.","ecosystems":["npm"],"exploits":{"exploitdb":0,"first_seen":"2018-11-27","github_poc":1,"max_poc_stars":5,"metasploit":0,"nuclei":0,"refs":[{"date":"2018-11-27T18:09:17Z","kind":"github_poc","ref":"https://github.com/nulldreams/CVE-2017-16082","stars":5,"title":"NodeJS + Postgres (Remote Code Execution) 🛰"}],"tier":"poc_unverified"},"has_fix":true,"headline":"Remote Code Execution in pg","id":"CVE-2017-16082","indexable":true,"kev":null,"kind":"cve","links":{"ecosystem":"npm","product":null,"products":[],"type":"code_injection","year":"2017"},"n_packages":22,"n_references":2,"next":{"headline":"Directory Traversal in node-simple-router","id":"CVE-2017-16083"},"packages":[{"ecosystem":"npm","fixed":["2.11.2"],"introduced":["0"],"last_affected":[],"package":"pg","purl":null,"source":"GHSA-wc9v-mj63-m9g5"},{"ecosystem":"npm","fixed":["2.11.2"],"introduced":["0"],"last_affected":[],"package":"pg","purl":"pkg:npm/pg","source":"GHSA-wc9v-mj63-m9g5"},{"ecosystem":"npm","fixed":["3.6.4"],"introduced":["3.0.0"],"last_affected":[],"package":"pg","purl":null,"source":"GHSA-wc9v-mj63-m9g5"},{"ecosystem":"npm","fixed":["3.6.4"],"introduced":["3.0.0"],"last_affected":[],"package":"pg","purl":"pkg:npm/pg","source":"GHSA-wc9v-mj63-m9g5"},{"ecosystem":"npm","fixed":["4.5.7"],"introduced":["4.0.0"],"last_affected":[],"package":"pg","purl":null,"source":"GHSA-wc9v-mj63-m9g5"},{"ecosystem":"npm","fixed":["4.5.7"],"introduced":["4.0.0"],"last_affected":[],"package":"pg","purl":"pkg:npm/pg","source":"GHSA-wc9v-mj63-m9g5"},{"ecosystem":"npm","fixed":["5.2.1"],"introduced":["5.0.0"],"last_affected":[],"package":"pg","purl":null,"source":"GHSA-wc9v-mj63-m9g5"},{"ecosystem":"npm","fixed":["5.2.1"],"introduced":["5.0.0"],"last_affected":[],"package":"pg","purl":"pkg:npm/pg","source":"GHSA-wc9v-mj63-m9g5"},{"ecosystem":"npm","fixed":["6.0.5"],"introduced":["6.0.0"],"last_affected":[],"package":"pg","purl":null,"source":"GHSA-wc9v-mj63-m9g5"},{"ecosystem":"npm","fixed":["6.0.5"],"introduced":["6.0.0"],"last_affected":[],"package":"pg","purl":"pkg:npm/pg","source":"GHSA-wc9v-mj63-m9g5"},{"ecosystem":"npm","fixed":["6.1.6"],"introduced":["6.1.0"],"last_affected":[],"package":"pg","purl":null,"source":"GHSA-wc9v-mj63-m9g5"},{"ecosystem":"npm","fixed":["6.1.6"],"introduced":["6.1.0"],"last_affected":[],"package":"pg","purl":"pkg:npm/pg","source":"GHSA-wc9v-mj63-m9g5"},{"ecosystem":"npm","fixed":["6.2.5"],"introduced":["6.2.0"],"last_affected":[],"package":"pg","purl":null,"source":"GHSA-wc9v-mj63-m9g5"},{"ecosystem":"npm","fixed":["6.2.5"],"introduced":["6.2.0"],"last_affected":[],"package":"pg","purl":"pkg:npm/pg","source":"GHSA-wc9v-mj63-m9g5"},{"ecosystem":"npm","fixed":["6.3.3"],"introduced":["6.3.0"],"last_affected":[],"package":"pg","purl":null,"source":"GHSA-wc9v-mj63-m9g5"},{"ecosystem":"npm","fixed":["6.3.3"],"introduced":["6.3.0"],"last_affected":[],"package":"pg","purl":"pkg:npm/pg","source":"GHSA-wc9v-mj63-m9g5"},{"ecosystem":"npm","fixed":["6.4.2"],"introduced":["6.4.0"],"last_affected":[],"package":"pg","purl":null,"source":"GHSA-wc9v-mj63-m9g5"},{"ecosystem":"npm","fixed":["6.4.2"],"introduced":["6.4.0"],"last_affected":[],"package":"pg","purl":"pkg:npm/pg","source":"GHSA-wc9v-mj63-m9g5"},{"ecosystem":"npm","fixed":["7.0.2"],"introduced":["7.0.0"],"last_affected":[],"package":"pg","purl":null,"source":"GHSA-wc9v-mj63-m9g5"},{"ecosystem":"npm","fixed":["7.0.2"],"introduced":["7.0.0"],"last_affected":[],"package":"pg","purl":"pkg:npm/pg","source":"GHSA-wc9v-mj63-m9g5"},{"ecosystem":"npm","fixed":["7.1.2"],"introduced":["7.1.0"],"last_affected":[],"package":"pg","purl":null,"source":"GHSA-wc9v-mj63-m9g5"},{"ecosystem":"npm","fixed":["7.1.2"],"introduced":["7.1.0"],"last_affected":[],"package":"pg","purl":"pkg:npm/pg","source":"GHSA-wc9v-mj63-m9g5"}],"prev":{"headline":"cross-env.js is malware","id":"CVE-2017-16081"},"products":["pg node module"],"published":"2018-06-07","related":[],"sources":[{"class":"attribution","licence":"CVE Terms of Use (MITRE)","name":"CVE List","prefix":"CVE"},{"class":"attribution","licence":"CC BY 4.0","name":"GitHub Advisory Database","prefix":"GHSA"},{"class":"attribution","licence":"US public information, NVD API terms","name":"NVD"},{"class":"attribution","licence":"CWE Terms of Use","name":"CWE (MITRE)"},{"class":"attribution","licence":"FIRST CVSS licence","name":"CVSS (FIRST)"},{"class":"open","licence":"CC0","name":"PoC-in-GitHub"}],"ssvc":{"automatable":null,"exploitation":null,"technical_impact":null},"state":"PUBLISHED","updated":"2024-09-17","vendors":["HackerOne"]},"summary":"Remote code execution in the pg Node.js module via crafted column names from untrusted databases or unsafe SQL queries.","url":"https://insights.sbomify.com/CVE-2017-16082/"}