Skip to content

Mitigate fast-jwt whitespace-prefixed key algorithm confusion#82

Merged
cvsz merged 1 commit into
mainfrom
codex/fix-incomplete-cve-2023-48223-patch
Apr 3, 2026
Merged

Mitigate fast-jwt whitespace-prefixed key algorithm confusion#82
cvsz merged 1 commit into
mainfrom
codex/fix-incomplete-cve-2023-48223-patch

Conversation

@cvsz
Copy link
Copy Markdown
Owner

@cvsz cvsz commented Apr 3, 2026

Motivation

  • The existing fix for CVE-2023-48223 can be bypassed when a PEM public key has leading whitespace because the public key regex uses a ^ anchor and the public key path does not normalize input.
  • A whitespace-prefixed RSA public key may be misclassified as an HMAC secret, re-enabling algorithm-confusion attacks that were previously patched.

Description

  • Add a workspace patchedDependencies entry in pnpm-workspace.yaml so installs apply a local patch to fast-jwt@6.1.0.
  • Patch performDetectPublicKeyAlgorithms in fast-jwt to call key.trimStart() (stored as normalizedKey) and use normalizedKey for PEM/X509/private-key detection and matching instead of the raw key.
  • Add the patch file at patches/fast-jwt@6.1.0.patch and update pnpm-lock.yaml to register the patch hash/path so installs are deterministic and include the mitigation.

Testing

  • Ran the repository test suite with pnpm test and all tests passed.
  • The patched package was applied and committed using the pnpm patch workflow and the lockfile was updated to reference the patched artifact.

Codex Task

@gemini-code-assist
Copy link
Copy Markdown
Contributor

Warning

You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again!

@chatgpt-codex-connector
Copy link
Copy Markdown

Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits.
Credits must be used to enable repository wide code reviews.

@cvsz cvsz merged commit 10f08a3 into main Apr 3, 2026
4 of 5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant