fix(stellar): upgrade stellar-sdk v10 → @stellar/stellar-sdk v16#9231
Draft
prajwalu142 wants to merge 1 commit into
Draft
fix(stellar): upgrade stellar-sdk v10 → @stellar/stellar-sdk v16#9231prajwalu142 wants to merge 1 commit into
prajwalu142 wants to merge 1 commit into
Conversation
## Problem stellar-sdk v10 bundles toml@2.3.6 which parses [__proto__] tables by writing directly to Object.prototype (prototype pollution). Chained with the SSRF in the XLM federation lookup endpoint and a Jade RCE sink, an unauthenticated attacker can achieve remote code execution inside wallet-platform pods. INFOSEC-191. ## Goal Remove the prototype pollution sink at the root by upgrading to @stellar/stellar-sdk v16, which replaces toml@2.3.6 with smol-toml — a strict TOML 1.0 parser that never mutates Object.prototype. ## Fix - Replaced stellar-sdk ^10.0.1 with @stellar/stellar-sdk ^16.0.0 in sdk-coin-xlm, sdk-coin-algo, sdk-coin-hbar, and bitgo packages. - Updated all import sites from stellar-sdk to @stellar/stellar-sdk. - Migrated stellar.Server → stellar.Horizon.Server (v11+ API split). - Migrated stellar.FederationServer → stellar.Federation.Server; return type updated to stellar.Federation.Api.Record. - Updated operation parameter types from the removed stellar.Operation instance type to stellar.OperationRecord (v16 discriminated union). - Used @stellar/stellar-sdk/axios subpath for federation requests to preserve nock HTTP interception in tests (v16 defaults to native fetch). - Removed conflicting bignumber.js v4 root resolution pins; added scoped pin for @stellar/stellar-sdk to prevent yarn hoisting v4 (lacks .clone). - Simplified txToString to use tx.toXDR() available directly on TransactionBase in v16, removing the old overload cast workaround. ## Testing Full unit test suites for sdk-coin-xlm (86 tests), sdk-coin-hbar (233), and sdk-coin-algo all pass with zero failures, including the federation lookup tests that exercise the axios subpath. Ticket: INFOSEC-191 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
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.
Problem
stellar-sdk v10 bundles toml@2.3.6 which parses [proto] tables by
writing directly to Object.prototype (prototype pollution). Chained with
the SSRF in the XLM federation lookup endpoint and a Jade RCE sink, an
unauthenticated attacker can achieve remote code execution inside
wallet-platform pods. INFOSEC-191.
Goal
Remove the prototype pollution sink at the root by upgrading to
@stellar/stellar-sdk v16, which replaces toml@2.3.6 with smol-toml — a
strict TOML 1.0 parser that never mutates Object.prototype.
Fix
sdk-coin-xlm, sdk-coin-algo, sdk-coin-hbar, and bitgo packages.
type updated to stellar.Federation.Api.Record.
instance type to stellar.OperationRecord (v16 discriminated union).
preserve nock HTTP interception in tests (v16 defaults to native fetch).
pin for @stellar/stellar-sdk to prevent yarn hoisting v4 (lacks .clone).
TransactionBase in v16, removing the old overload cast workaround.
Testing
Full unit test suites for sdk-coin-xlm (86 tests), sdk-coin-hbar (233),
and sdk-coin-algo all pass with zero failures, including the federation
lookup tests that exercise the axios subpath.
Ticket: INFOSEC-191
🤖 Generated with Claude Code