Skip to content

chore(deps): update dependency fast-jwt to v6 [security]#580

Open
renovate[bot] wants to merge 1 commit intomainfrom
renovate/npm-fast-jwt-vulnerability
Open

chore(deps): update dependency fast-jwt to v6 [security]#580
renovate[bot] wants to merge 1 commit intomainfrom
renovate/npm-fast-jwt-vulnerability

Conversation

@renovate
Copy link
Copy Markdown
Contributor

@renovate renovate bot commented Apr 3, 2026

This PR contains the following updates:

Package Change Age Confidence
fast-jwt ^5.0.0^6.0.0 age confidence

GitHub Vulnerability Alerts

CVE-2026-35039

Impact

Setting up a custom cacheKeyBuilder method which does not properly create unique keys for different tokens can lead to cache collisions. This could cause tokens to be mis-identified during the verification process leading to:

  • Valid tokens returning claims from different valid tokens
  • Users being mis-identified as other users based on the wrong token

This could result in:

  • User impersonation - UserB receives UserA's identity and permissions
  • Privilege escalation - Low-privilege users inherit admin-level access
  • Cross-tenant data access - Users gain access to other tenants' resources
  • Authorization bypass - Security decisions made on wrong user identity

Affected Configurations

This vulnerability ONLY affects applications that BOTH:

  1. Enable caching using the cache option
  2. Use custom cacheKeyBuilder functions that can produce collisions

VULNERABLE examples:

// Collision-prone: same audience = same cache key
cacheKeyBuilder: (token) => {
  const { aud } = parseToken(token)
  return `aud=${aud}`
}

// Collision-prone: grouping by user type
cacheKeyBuilder: (token) => {
  const { aud } = parseToken(token)
  return aud.includes('admin') ? 'admin-users' : 'regular-users'
}

// Collision-prone: tenant + service grouping
cacheKeyBuilder: (token) => {
  const { iss, aud } = parseToken(token)
  return `${iss}-${aud}`
}

SAFE examples:

// Default hash-based (recommended)
createVerifier({ cache: true })  // Uses secure default

// Include unique user identifier
cacheKeyBuilder: (token) => {
  const { sub, aud, iat } = parseToken(token)
  return `${sub}-${aud}-${iat}`
}

// No caching (always safe)
createVerifier({ cache: false })

Not Affected

  • Applications using default caching
  • Applications with caching disabled

Assessment Guide

To determine if a consumer application is affected:

  1. Check if caching is enabled: Look for cache: true or cache: in verifier configuration
  2. Check for custom cache key builders: Look for cacheKeyBuilder function in configuration
  3. Analyze collision potential: Review if the application's cacheKeyBuilder can produce identical keys for different users/tokens
  4. If no custom cacheKeyBuilder: The project is NOT affected (default is safe)

Mitigations

While fast-jwt will look to include a fix for this in the next version, immediate mitigations include:

  • Ensure uniqueness of keys produced in cacheKeyBuilder
  • Remove custom cacheKeyBuilder method
  • Disable caching

Release Notes

nearform/fast-jwt (fast-jwt)

v6.1.0

Compare Source

What's Changed

New Contributors

Full Changelog: nearform/fast-jwt@v6.0.2...v6.1.0

v6.0.2

Compare Source

What's Changed

New Contributors

Full Changelog: nearform/fast-jwt@v6.0.1...v6.0.2

v6.0.1

Compare Source

What's Changed

Full Changelog: nearform/fast-jwt@v6.0.0...v6.0.1

v6.0.0

Compare Source

BREAKING CHANGES

This is a semver major release containing breaking changes to address more thoroughly the security vulnerability fixed in v5.0.6, which only fixed the vulnerability without introducing breaking changes.

This release takes it one step further by adhering more closely to the JWT specification.

More specifically, verification now expects all claims except for the aud claim to be single values, instead of supporting arrays of values.

This is a breaking change because JWTs containing claims in array format (with the exception of aud), now cause verification errors, while they were previously allowed.

What's Changed

New Contributors

Full Changelog: nearform/fast-jwt@v5.0.6...v6.0.0


Configuration

📅 Schedule: Branch creation - "" (UTC), Automerge - At any time (no schedule defined).

🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 Ignore: Close this PR and you won't be reminded about this update again.


  • If you want to rebase/retry this PR, check this box

This PR was generated by Mend Renovate. View the repository job log.

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

Successfully merging this pull request may close these issues.

0 participants