Repository navigation
Conversation
…ency stellar-sdk <=15.1.0 depended on the unmaintained `toml` npm package (GHSA-82x6-q7mm-w9cf, GHSA-v5mp-jgw5-2x6j — uncontrolled recursion and prototype pollution, no upstream fix available). The SDK dropped that dependency entirely at v16.0.0. Jumping 14.2.0 -> 17.1.0 crosses several xdr API changes: the generated xdr wrapper classes (ContractDataDurability, ScSpecFunctionV0.name, Price, Signature, Hash, LedgerEntryData, ScVal, ContractExecutable) switched from getter *methods* to readonly *properties*, and several now return Uint8Array where they used to return Buffer. Updated each call site accordingly, and added explicit type-guard checks where a union type replaced what used to be a single class with an arm-getter method (contractData/instance/executable in loadContractMetada.ts). Verified: typecheck, build, lint, and the full test suite (69 tests) all pass. `npm audit` confirms `toml` and `@stellar/stellar-sdk` are gone from the vulnerability list. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
Member
Author
|
This is failing tests now, and also doesn't work when I tried to test this PR manually in the Registry UI. Closing this PR and opening an issue instead! |
This was referenced Sep 21, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
@stellar/stellar-sdk@^14.2.0->^17.1.0. The old version pulled in the unmaintainedtomlnpm package (GHSA-82x6-q7mm-w9cf: uncontrolled recursion; GHSA-v5mp-jgw5-2x6j: prototype pollution — no patch was ever released fortoml). The SDK droppedtomlentirely at v16.0.0.stellar-registry/ui's Dependabot alerts —uidepends on this package and inherits thetomltransitive dependency through it.Why v17, not a smaller bump
v16.2.0 (the minimum that drops
toml) still required fixing 8 type errors insorobanUtils.tsalone; v17.1.0 adds ~13 more across 4 other files, but they're independent breaking changes, not compounding ones. Since both versions require real code changes, doing the full v17 jump now avoids a second migration+review pass later.What changed
The generated xdr wrapper classes switched from getter methods to readonly properties (e.g.
ContractDataDurability.persistent()->.persistent,ScSpecFunctionV0.name()->.name), and several now returnUint8Arraywhere they returnedBufferbefore (Transaction.hash(),Signature,StrKey.decodeSha256Hash). Where a single class with an arm-getter method became a proper discriminated union (LedgerEntryData,ScVal,ContractExecutable), I added explicit.typenarrowing checks with descriptive errors inloadContractMetada.tsinstead of casting —getLedgerEntriesfor a contract ID should always return acontractDataentry backed by a Wasm executable, so a mismatch there is a real error worth surfacing, not something to paper over.nativeToScVal'stypeoption is now strictly typed (ScValTypeunion) instead of accepting arbitrary strings. This codebase builds those type hints dynamically from a contract's on-chain spec (arbitrary strings from JSON), which is fundamentally incompatible with compile-time literal checking — cast toParameters<typeof nativeToScVal>[1]at each call site rather than widening the SDK's public type.The
tests/fixtures/counter.tstest fixture also needed a change: it built XDR spec entries viaBuffer.from("..."), which throwsXdrString: expected string, Uint8Array, or XdrStringin the vitest/jsdom test environment (a cross-realminstanceof Uint8Arraymismatch between Node'sBufferand jsdom's global). Passing plain strings instead sidesteps it and is simpler regardless.Test plan
npm run typecheckpassesnpm run buildpassesnpm run lintpasses (0 errors; 1 pre-existing unrelated warning)npm test— all 8 suites / 69 tests passnpm auditconfirmstomland@stellar/stellar-sdkno longer appear in the vulnerability listI don't have deep context on this codebase's Soroban/XDR handling beyond what the SDK's own type definitions and doc comments describe, so please review the
loadContractMetada.tsnarrowing logic and thesorobanUtils.tsScVal type-hint casts carefully before merging.🤖 Generated with Claude Code