Skip to content

Commit 4acaadd

Browse files
committed
fix(js-legacy): Removes transitive dependency on bigint-buffer
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.
1 parent de38c63 commit 4acaadd

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+160
-163
lines changed

clients/js-legacy/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,9 +72,9 @@ cd clients/js-legacy
7272
pnpm install
7373
pnpm run build
7474
```
75-
76-
6. Run the tests:
75+
6. Run the tests (start the local test validator first):
7776
```shell
77+
../../scripts/restart-test-validator.sh
7878
pnpm run test
7979
```
8080

clients/js-legacy/package.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,13 +54,15 @@
5454
},
5555
"dependencies": {
5656
"@solana/buffer-layout": "^4.0.0",
57-
"@solana/buffer-layout-utils": "^0.3.0",
57+
"@solana/codecs-core": "5.1.0",
58+
"@solana/codecs-data-structures": "5.1.0",
59+
"@solana/codecs-numbers": "5.1.0",
5860
"@solana/spl-token-group": "^0.0.7",
5961
"@solana/spl-token-metadata": "^0.1.6",
6062
"buffer": "^6.0.3"
6163
},
6264
"devDependencies": {
63-
"@solana/codecs-strings": "5.0.0",
65+
"@solana/codecs-strings": "5.1.0",
6466
"@solana/prettier-config-solana": "0.0.5",
6567
"@solana/spl-memo": "0.2.5",
6668
"@solana/web3.js": "^1.95.5",

clients/js-legacy/pnpm-lock.yaml

Lines changed: 48 additions & 72 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

clients/js-legacy/src/actions/uiAmountToAmount.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { u64 } from '@solana/buffer-layout-utils';
1+
import { u64 } from '../serialization.js';
22
import type { Connection, PublicKey, Signer, TransactionError } from '@solana/web3.js';
33
import { Transaction } from '@solana/web3.js';
44
import { TOKEN_PROGRAM_ID } from '../constants.js';

clients/js-legacy/src/extensions/cpiGuard/state.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { struct } from '@solana/buffer-layout';
2-
import { bool } from '@solana/buffer-layout-utils';
2+
import { bool } from '../../serialization.js';
33
import type { Account } from '../../state/account.js';
44
import { ExtensionType, getExtensionData } from '../extensionType.js';
55

clients/js-legacy/src/extensions/groupMemberPointer/instructions.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { struct, u8 } from '@solana/buffer-layout';
2-
import { publicKey } from '@solana/buffer-layout-utils';
2+
import { publicKey } from '../../serialization.js';
33
import type { Signer } from '@solana/web3.js';
44
import { PublicKey, TransactionInstruction } from '@solana/web3.js';
55
import { TOKEN_2022_PROGRAM_ID, programSupportsExtensions } from '../../constants.js';

clients/js-legacy/src/extensions/groupMemberPointer/state.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { struct } from '@solana/buffer-layout';
2-
import { publicKey } from '@solana/buffer-layout-utils';
2+
import { publicKey } from '../../serialization.js';
33
import { PublicKey } from '@solana/web3.js';
44
import type { Mint } from '../../state/mint.js';
55
import { ExtensionType, getExtensionData } from '../extensionType.js';

clients/js-legacy/src/extensions/groupPointer/instructions.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { struct, u8 } from '@solana/buffer-layout';
2-
import { publicKey } from '@solana/buffer-layout-utils';
2+
import { publicKey } from '../../serialization.js';
33
import type { Signer } from '@solana/web3.js';
44
import { PublicKey, TransactionInstruction } from '@solana/web3.js';
55
import { TOKEN_2022_PROGRAM_ID, programSupportsExtensions } from '../../constants.js';

clients/js-legacy/src/extensions/groupPointer/state.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { struct } from '@solana/buffer-layout';
2-
import { publicKey } from '@solana/buffer-layout-utils';
2+
import { publicKey } from '../../serialization.js';
33
import { PublicKey } from '@solana/web3.js';
44
import type { Mint } from '../../state/mint.js';
55
import { ExtensionType, getExtensionData } from '../extensionType.js';

clients/js-legacy/src/extensions/interestBearingMint/instructions.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { s16, struct, u8 } from '@solana/buffer-layout';
2-
import { publicKey } from '@solana/buffer-layout-utils';
2+
import { publicKey } from '../../serialization.js';
33
import type { PublicKey, Signer } from '@solana/web3.js';
44
import { TransactionInstruction } from '@solana/web3.js';
55
import { TOKEN_2022_PROGRAM_ID } from '../../constants.js';

0 commit comments

Comments
 (0)