Uninitialized Memory Exposure Affecting openwhisk Open this link in a new tab package, versions <3.3.1

  • Exploit Maturity


  • Attack Complexity


  • Confidentiality


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


  • published

    18 Jul 2017

  • disclosed

    18 Jul 2017

  • credit


Introduced: 18 Jul 2017

CWE-201 Open this link in a new tab


openwhisk JavaScript client library for the Apache OpenWhisk platform.

Affected versions of the package are vulnerable to Uninitialized Memory Exposure. If an openwhisk action uses a api_key option with a numeric value, then uninitialized memory might be exposed by the client.


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

Initializing a options.api_key option in such manner will cause uninitialized memory to be exposed.

Proof of concept by ChALkeR

var openwhisk = require('openwhisk');
var options = {apihost: '', api_key: 50};
var ow = openwhisk(options);
ow.actions.invoke({actionName: 'sample'}).then(result => console.log(result))

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.

You can read more about the insecure Buffer behavior on our blog.


Upgrade openwhisk to version 3.3.1 or higher. Note This is vulnerable only for Node <=4