Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

High severity - Uninitialized Memory Exposure vulnerability in base64url (package.json) #129

Open
github-actions bot opened this issue Apr 4, 2023 · 0 comments

Comments

@github-actions
Copy link

github-actions bot commented Apr 4, 2023

  • Package Manager: npm
  • Vulnerable module: base64url
  • Introduced through: juice-shop@12.3.0, jsonwebtoken@0.4.0 and others

Detailed paths

  • Introduced through: juice-shop@12.3.0 › jsonwebtoken@0.4.0 › jws@0.2.6 › base64url@0.0.6
  • Introduced through: juice-shop@12.3.0 › jsonwebtoken@0.4.0 › jws@0.2.6 › jwa@0.0.1 › base64url@0.0.6
  • Introduced through: juice-shop@12.3.0 › express-jwt@0.1.3 › jsonwebtoken@0.1.0 › jws@0.2.6 › base64url@0.0.6
  • Introduced through: juice-shop@12.3.0 › express-jwt@0.1.3 › jsonwebtoken@0.1.0 › jws@0.2.6 › jwa@0.0.1 › base64url@0.0.6

Overview

base64url Converting to, and from, base64url.

Affected versions of this package are vulnerable to Uninitialized Memory Exposure. An attacker could extract sensitive data from uninitialized memory or may cause a Denial of Service (DoS) by passing in a large number, in setups where typed user input can be passed (e.g. from JSON).

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 base64url to version 3.0.0 or higher.
Note This is vulnerable only for Node <=4

References

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

0 participants