Vulnerabilities in pkg:npm/base64url

PACKAGE
Advisory Summary

GHSA-rvg8-pwq2-xj7q is a MODERATE out-of-bounds read vulnerability (CWE-125: Out-of-bounds Read) affecting Base64url libraries in the npm ecosystem. The issue involves out-of-bounds read in base64url. Remediation is available by upgrading affected packages to version 3.0.0.

1 Known Advisory Record(s)
Package Vulnerability Intelligence

pkg:npm/base64url

1 Known Advisory Record(s)

Vulnerability advisories affecting package pkg:npm/base64url. Select an advisory below to view technical details or fixes.

Advisory ID CVE / NVD Severity Summary
GHSA-rvg8-pwq2-xj7q - MODERATE Out-of-bounds Read in base64url

GHSA-rvg8-pwq2-xj7q at a Glance

CVE Identifier N/A
GHSA Identifier GHSA-rvg8-pwq2-xj7q
Severity MODERATE
CVSS v3.1 Base Score N/A
CWE Classification CWE-125: Out-of-bounds Read
Affected Product Base64url
Package Ecosystem npm
Published Date
Last Updated

How to Fix GHSA-rvg8-pwq2-xj7q

To remediate this vulnerability, upgrade all affected Base64url dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

base64url fixed: 3.0.0
npm install base64url@3.0.0
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

npm ls base64url

How to Check if You Are Affected

To determine whether your Node.js application is affected by GHSA-rvg8-pwq2-xj7q, inspect your project dependencies using npm:

npm ls base64url

Analyze the terminal output to locate any version of Base64url in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 3.0.0), your application is affected.

Note: The npm ls base64url command inspects dependencies declared in your package.json and lockfile; it does not perform automated runtime dynamic scanning.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-125: Out-of-bounds Read, where the product reads data past the end, or before the beginning, of the intended buffer. In Base64url, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

Versions of `base64url` before 3.0.0 are vulnerable to to out-of-bounds reads as it allocates uninitialized Buffers when number is passed in input on Node.js 4.x and below. ## Recommendation Update to version 3.0.0 or later.

GHSA-rvg8-pwq2-xj7q Affected Base64url Versions

1 component(s)
Fixed Versions:
3.0.0
Product / Package Ecosystem Affected Versions Fixed Version
base64url
npm
< 3.0.0
3.0.0

References

Frequently Asked Questions

What is GHSA-rvg8-pwq2-xj7q?
GHSA-rvg8-pwq2-xj7q is a security vulnerability in Base64url involving Out-of-bounds Read in base64url under CWE-125: Out-of-bounds Read.
Which Base64url versions are affected?
Affected versions include releases prior to 3.0.0 across affected packages: base64url.
What version fixes GHSA-rvg8-pwq2-xj7q?
Upgrading to 3.0.0 (or the latest patched release for your respective branch) resolves the vulnerability.
Is base64url affected?
Yes, base64url is affected in releases prior to 3.0.0. Upgrade your dependency to 3.0.0 or later.
What CWE is associated with GHSA-rvg8-pwq2-xj7q?
GHSA-rvg8-pwq2-xj7q is classified under CWE-125: Out-of-bounds Read (The product reads data past the end, or before the beginning, of the intended buffer.).
How can I check npm dependencies for GHSA-rvg8-pwq2-xj7q?
Run the dependency tree command: 'npm ls base64url'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-rvg8-pwq2-xj7q",
  "modified" : "2021-09-24T20:34:56Z",
  "published" : "2020-09-01T20:42:44Z",
  "aliases" : [ ],
  "summary" : "Out-of-bounds Read in base64url",
  "details" : "Versions of `base64url` before 3.0.0 are vulnerable to to out-of-bounds reads as it allocates uninitialized Buffers when number is passed in input on Node.js 4.x and below.\n\n\n## Recommendation\n\nUpdate to version 3.0.0 or later.",
  "severity" : [ ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "npm",
      "name" : "base64url"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "3.0.0"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/brianloveswords/base64url/pull/25"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/brianloveswords/base64url/commit/4fbd954a0a69e9d898de2146557cc6e893e79542"
  }, {
    "type" : "WEB",
    "url" : "https://hackerone.com/reports/321687"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/brianloveswords/base64url"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-125" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2020-08-31T18:31:38Z",
    "nvd_published_at" : null
  }
}