Skip to content

Conversation

@dhl
Copy link

@dhl dhl commented Jan 6, 2026

Replaces the use of @solana/buffer-layout-utils, which depends on the unmaintained bigint-buffer package vulnerable to CVE-2025-3194, with @solana/codecs backed Layout implementation.

While @solana/spl-token isn't directly vulnerable to buffer overflow as none of its code path uses toBigIntLE() from bigint-buffer, removing the dependency on bigint-buffer removes the high severity vulnerability flag on @solana/spl-token.

fixes #453

Copilot AI review requested due to automatic review settings January 6, 2026 09:57
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR removes the transitive dependency on the vulnerable and unmaintained bigint-buffer package (CVE-2025-3194) by replacing @solana/buffer-layout-utils with a custom implementation based on @solana/codecs.

  • Implements codec-based Layout adapters (FixedSizeCodecLayout and OptionCodecLayout) to bridge @solana/codecs with @solana/buffer-layout
  • Replaces all imports of serialization utilities from @solana/buffer-layout-utils with the new local implementation
  • Updates dependencies to use @solana/codecs-* packages (version 5.1.0) in place of @solana/buffer-layout-utils

Reviewed changes

Copilot reviewed 43 out of 44 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
clients/js-legacy/src/serialization.ts Implements new codec-based Layout classes and exports bool, publicKey, and u64 functions to replace @solana/buffer-layout-utils functionality
clients/js-legacy/src/state/multisig.ts Updates imports to use local serialization module instead of @solana/buffer-layout-utils
clients/js-legacy/src/state/mint.ts Updates imports to use local serialization module instead of @solana/buffer-layout-utils
clients/js-legacy/src/state/account.ts Updates imports to use local serialization module instead of @solana/buffer-layout-utils
clients/js-legacy/src/instructions/transferChecked.ts Updates imports to use local serialization module instead of @solana/buffer-layout-utils
clients/js-legacy/src/instructions/transfer.ts Updates imports to use local serialization module instead of @solana/buffer-layout-utils
clients/js-legacy/src/instructions/setAuthority.ts Updates imports to use local serialization module instead of @solana/buffer-layout-utils
clients/js-legacy/src/instructions/mintToChecked.ts Updates imports to use local serialization module instead of @solana/buffer-layout-utils
clients/js-legacy/src/instructions/mintTo.ts Updates imports to use local serialization module instead of @solana/buffer-layout-utils
clients/js-legacy/src/instructions/initializePermanentDelegate.ts Updates imports to use local serialization module instead of @solana/buffer-layout-utils
clients/js-legacy/src/instructions/initializeMint2.ts Updates imports to use local serialization module instead of @solana/buffer-layout-utils
clients/js-legacy/src/instructions/initializeMint.ts Updates imports to use local serialization module instead of @solana/buffer-layout-utils
clients/js-legacy/src/instructions/initializeAccount3.ts Updates imports to use local serialization module instead of @solana/buffer-layout-utils
clients/js-legacy/src/instructions/initializeAccount2.ts Updates imports to use local serialization module instead of @solana/buffer-layout-utils
clients/js-legacy/src/instructions/burnChecked.ts Updates imports to use local serialization module instead of @solana/buffer-layout-utils
clients/js-legacy/src/instructions/burn.ts Updates imports to use local serialization module instead of @solana/buffer-layout-utils
clients/js-legacy/src/instructions/approveChecked.ts Updates imports to use local serialization module instead of @solana/buffer-layout-utils
clients/js-legacy/src/instructions/approve.ts Updates imports to use local serialization module instead of @solana/buffer-layout-utils
clients/js-legacy/src/instructions/amountToUiAmount.ts Updates imports to use local serialization module instead of @solana/buffer-layout-utils
clients/js-legacy/src/extensions/transferHook/state.ts Updates imports to use local serialization module instead of @solana/buffer-layout-utils
clients/js-legacy/src/extensions/transferHook/instructions.ts Updates imports to use local serialization module instead of @solana/buffer-layout-utils
clients/js-legacy/src/extensions/transferFee/state.ts Updates imports to use local serialization module instead of @solana/buffer-layout-utils
clients/js-legacy/src/extensions/transferFee/instructions.ts Updates imports to use local serialization module instead of @solana/buffer-layout-utils
clients/js-legacy/src/extensions/tokenGroup/state.ts Updates imports to use local serialization module instead of @solana/buffer-layout-utils
clients/js-legacy/src/extensions/scaledUiAmount/state.ts Updates imports to use local serialization module instead of @solana/buffer-layout-utils
clients/js-legacy/src/extensions/scaledUiAmount/instructions.ts Updates imports to use local serialization module instead of @solana/buffer-layout-utils
clients/js-legacy/src/extensions/permanentDelegate.ts Updates imports to use local serialization module instead of @solana/buffer-layout-utils
clients/js-legacy/src/extensions/pausable/state.ts Updates imports to use local serialization module instead of @solana/buffer-layout-utils
clients/js-legacy/src/extensions/pausable/instructions.ts Updates imports to use local serialization module instead of @solana/buffer-layout-utils
clients/js-legacy/src/extensions/mintCloseAuthority.ts Updates imports to use local serialization module instead of @solana/buffer-layout-utils
clients/js-legacy/src/extensions/metadataPointer/state.ts Updates imports to use local serialization module instead of @solana/buffer-layout-utils
clients/js-legacy/src/extensions/metadataPointer/instructions.ts Updates imports to use local serialization module instead of @solana/buffer-layout-utils
clients/js-legacy/src/extensions/memoTransfer/state.ts Updates imports to use local serialization module instead of @solana/buffer-layout-utils
clients/js-legacy/src/extensions/interestBearingMint/state.ts Updates imports to use local serialization module instead of @solana/buffer-layout-utils
clients/js-legacy/src/extensions/interestBearingMint/instructions.ts Updates imports to use local serialization module instead of @solana/buffer-layout-utils
clients/js-legacy/src/extensions/groupPointer/state.ts Updates imports to use local serialization module instead of @solana/buffer-layout-utils
clients/js-legacy/src/extensions/groupPointer/instructions.ts Updates imports to use local serialization module instead of @solana/buffer-layout-utils
clients/js-legacy/src/extensions/groupMemberPointer/state.ts Updates imports to use local serialization module instead of @solana/buffer-layout-utils
clients/js-legacy/src/extensions/groupMemberPointer/instructions.ts Updates imports to use local serialization module instead of @solana/buffer-layout-utils
clients/js-legacy/src/extensions/cpiGuard/state.ts Updates imports to use local serialization module instead of @solana/buffer-layout-utils
clients/js-legacy/src/actions/uiAmountToAmount.ts Updates imports to use local serialization module instead of @solana/buffer-layout-utils
clients/js-legacy/pnpm-lock.yaml Removes @solana/buffer-layout-utils and its transitive dependencies (bigint-buffer, bignumber.js, bindings, file-uri-to-path); adds @solana/codecs-* packages at version 5.1.0
clients/js-legacy/package.json Removes @solana/buffer-layout-utils dependency and adds @solana/codecs-core, @solana/codecs-data-structures, and @solana/codecs-numbers at version 5.1.0; updates @solana/codecs-strings to 5.1.0
clients/js-legacy/README.md Clarifies that the local test validator should be started before running tests
Files not reviewed (1)
  • clients/js-legacy/pnpm-lock.yaml: Language not supported

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Replaces the use of @solana/buffer-layout-utils, which depends on the
unmaintained bigint-buffer package vulnerable to CVE-2025-3194, with
@solana/codecs backed Layout implementation.
@dhl dhl force-pushed the fix/remove-bigint-buffer branch from 4acaadd to af536d3 Compare January 6, 2026 10:19
@dhl
Copy link
Author

dhl commented Jan 9, 2026

Closing this in favor of fixing the vulnerability in https://github.com/solana-foundation/buffer-layout-utils

@dhl dhl closed this Jan 9, 2026
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.

Dependency on archived @solana/buffer-layout-utils which uses vulnerable bigint-buffer

1 participant