alan@0.0.2

Vulnerabilities 2 via 2 paths
Dependencies 504
Source npm
Package alan

Find, fix and prevent vulnerabilities in your code.

Severity
  • 2
Status
  • 2
  • 0
  • 0
medium severity

Regular Expression Denial of Service (ReDoS)

  • Vulnerable module: semver
  • Introduced through: rollup-plugin-node-builtins@2.1.2

Detailed paths

  • Introduced through: alan@0.0.2 rollup-plugin-node-builtins@2.1.2 browserify-fs@1.0.0 levelup@0.18.6 semver@2.3.2
    Remediation: Open PR to patch semver@2.3.2.

Overview

semver is a semantic version parser used by npm.

Affected versions of this package are vulnerable to Regular Expression Denial of Service (ReDoS).

Overview

npm is a package manager for javascript.

Affected versions of this package are vulnerable to Regular Expression Denial of Service (ReDoS). The semver module uses regular expressions when parsing a version string. For a carefully crafted input, the time it takes to process these regular expressions is not linear to the length of the input. Since the semver module did not enforce a limit on the version string length, an attacker could provide a long string that would take up a large amount of resources, potentially taking a server down. This issue therefore enables a potential Denial of Service attack. This is a slightly differnt variant of a typical Regular Expression Denial of Service (ReDoS) vulnerability.

Details

<<ReDoS>>

Remediation

Update to a version 4.3.2 or greater. From the issue description [2]: "Package version can no longer be more than 256 characters long. This prevents a situation in which parsing the version number can use exponentially more time and memory to parse, leading to a potential denial of service."

References

Remediation

Upgrade semver to version 4.3.2 or higher.

References

medium severity

Uninitialized Memory Exposure

  • Vulnerable module: bl
  • Introduced through: rollup-plugin-node-builtins@2.1.2

Detailed paths

  • Introduced through: alan@0.0.2 rollup-plugin-node-builtins@2.1.2 browserify-fs@1.0.0 levelup@0.18.6 bl@0.8.2

Overview

bl is a storage object for collections of Node Buffers.

A possible memory disclosure vulnerability exists when a value of type number is provided to the append() method and results in concatenation of uninitialized memory to the buffer collection.

This is a result of unobstructed use of the Buffer constructor, whose insecure default constructor increases the odds of memory leakage.

Details

Constructing a Buffer class with integer N creates a Buffer of length N with raw (not "zero-ed") memory.

In the following example, the first call would allocate 100 bytes of memory, while the second example will allocate the memory needed for the string "100":

// uninitialized Buffer of length 100
x = new Buffer(100);
// initialized Buffer with value of '100'
x = new Buffer('100');

bl's append function uses the default Buffer constructor as-is, making it easy to append uninitialized memory to an existing list. If the value of the buffer list is exposed to users, it may expose raw server side memory, potentially holding secrets, private data and code. This is a similar vulnerability to the infamous Heartbleed flaw in OpenSSL.

const BufferList = require('bl')

var bl = new BufferList()
bl.append(new Buffer('abcd'))
bl.append(new Buffer('efg'))
bl.append('100')
// appends a Buffer holding 100 bytes of uninitialized memory
bl.append(100)                     
bl.append(new Buffer('j'))

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

Similar vulnerabilities were discovered in request, mongoose, ws and sequelize.

Note This is vulnerable only for Node <=4

References