serverless@0.5.6
Vulnerabilities |
3 via 3 paths |
---|---|
Dependencies |
129 |
Source |
npm |
Find, fix and prevent vulnerabilities in your code.
high severity
- Vulnerable module: https-proxy-agent
- Introduced through: https-proxy-agent@1.0.0
Detailed paths
-
Introduced through: serverless@0.5.6 › https-proxy-agent@1.0.0Remediation: Upgrade to serverless@1.28.0.
Overview
https-proxy-agent
provides an http.Agent implementation that connects to a specified HTTP or HTTPS proxy server, and can be used with the built-in https module.
Affected versions of this package are vulnerable to Uninitialized Memory Exposure and Denial of Service (DoS) attacks due to passing unsanitized options to Buffer(arg).
Uninitialized memory Exposre PoC by ChALKer
// listen with: nc -l -p 8080
var url = require('url');
var https = require('https');
var HttpsProxyAgent = require('https-proxy-agent');
var proxy = {
protocol: 'http:',
host: "127.0.0.1",
port: 8080
};
proxy.auth = 500; // a number as 'auth'
var opts = url.parse('https://example.com/');
var agent = new HttpsProxyAgent(proxy);
opts.agent = agent;
https.get(opts);
Details
The Buffer class on Node.js is a mutable array of binary data, and can be initialized with a string, array or number.
const buf1 = new Buffer([1,2,3]);
// creates a buffer containing [01, 02, 03]
const buf2 = new Buffer('test');
// creates a buffer containing ASCII bytes [74, 65, 73, 74]
const buf3 = new Buffer(10);
// creates a buffer of length 10
The first two variants simply create a binary representation of the value it received. The last one, however, pre-allocates a buffer of the specified size, making it a useful buffer, especially when reading data from a stream.
When using the number constructor of Buffer, it will allocate the memory, but will not fill it with zeros. Instead, the allocated buffer will hold whatever was in memory at the time. If the buffer is not zeroed
by using buf.fill(0)
, it may leak sensitive information like keys, source code, and system info.
Remediation
Upgrade https-proxy-agent
to version 2.2.0 or higher.
Note This is vulnerable only for Node <=4
References
medium severity
- Vulnerable module: https-proxy-agent
- Introduced through: https-proxy-agent@1.0.0
Detailed paths
-
Introduced through: serverless@0.5.6 › https-proxy-agent@1.0.0Remediation: Upgrade to serverless@1.28.0.
Overview
https-proxy-agent is a module that provides an http.Agent implementation that connects to a specified HTTP or HTTPS proxy server, and can be used with the built-in https module.
Affected versions of this package are vulnerable to Man-in-the-Middle (MitM). When targeting a HTTP proxy, https-proxy-agent
opens a socket to the proxy, and sends the proxy server a CONNECT
request. If the proxy server responds with something other than a HTTP response 200
, https-proxy-agent
incorrectly returns the socket without any TLS upgrade. This request data may contain basic auth credentials or other secrets, is sent over an unencrypted connection. A suitably positioned attacker could steal these secrets and impersonate the client.
PoC by Kris Adler
var url = require('url');
var https = require('https');
var HttpsProxyAgent = require('https-proxy-agent');
var proxyOpts = url.parse('http://127.0.0.1:80');
var opts = url.parse('https://www.google.com');
var agent = new HttpsProxyAgent(proxyOpts);
opts.agent = agent;
opts.auth = 'username:password';
https.get(opts);
Remediation
Upgrade https-proxy-agent
to version 2.2.3 or higher.
References
low severity
- Vulnerable module: utile
- Introduced through: prompt@0.3.0
Detailed paths
-
Introduced through: serverless@0.5.6 › prompt@0.3.0 › utile@0.2.1
Overview
utile is a drop-in replacement for util with some additional advantageous functions.
Affected versions of this package are vulnerable to Uninitialized Memory Exposure. A malicious user could extract sensitive data from uninitialized memory or to cause a DoS by passing in a large number, in setups where typed user input can be passed.
Note Uninitialized Memory Exposure impacts only Node.js 6.x or lower, Denial of Service impacts any Node.js version.
Details
The Buffer class on Node.js is a mutable array of binary data, and can be initialized with a string, array or number.
const buf1 = new Buffer([1,2,3]);
// creates a buffer containing [01, 02, 03]
const buf2 = new Buffer('test');
// creates a buffer containing ASCII bytes [74, 65, 73, 74]
const buf3 = new Buffer(10);
// creates a buffer of length 10
The first two variants simply create a binary representation of the value it received. The last one, however, pre-allocates a buffer of the specified size, making it a useful buffer, especially when reading data from a stream.
When using the number constructor of Buffer, it will allocate the memory, but will not fill it with zeros. Instead, the allocated buffer will hold whatever was in memory at the time. If the buffer is not zeroed
by using buf.fill(0)
, it may leak sensitive information like keys, source code, and system info.
Remediation
There is no fix version for utile
.