AI-generated analysisPublished automatically and not human-verified. Validated context appears in community notes below.
← Watch feed
High 78 Monero

Derive the Solana token recipient account locally

Public commit record

What the developer wrote

Authored by slopbot9k

68/100 · Adequate
Derive the Solana token recipient account locally

The destination token account came from getTokenAccountsByOwner and was only checked against the System Program, so a hostile node could answer with any holder's account for the same mint. Always use the recipient's derived ATA and compare owner addresses for self-transfer detection.
✓ Descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context
The short version

What changed, and why it matters

This commit fixes a bug in Stack Wallet's Solana token transfers. Previously, the wallet asked the blockchain node to find the recipient's token account, and only checked that it was a valid token account—not that it actually belonged to the intended recipient. A malicious or compromised node could have returned any other holder's account for the same token, causing the user's payment to be sent to the wrong person. The fix always calculates the recipient's token address locally from their wallet address and the token type, so the destination cannot be manipulated by the node. The self-transfer detection was also corrected to compare recipient wallet addresses rather than token account addresses.

Recommended action

Treat this as a security fix. Ensure the updated version is released promptly and users are encouraged to upgrade before sending Solana token transactions, especially when connected to untrusted or third-party RPC nodes. Review other wallet code paths that rely on RPC-reported accounts for destination selection.

Security signals we found

01

Removal of RPC-reported destination token account selection

02

Local derivation of Associated Token Account (ATA) from recipient owner address

03

Test explicitly models hostile node returning decoy account for same mint

04

Self-transfer detection changed from token account equality to owner address equality

05

Commit message describes security-relevant threat model: hostile node

Risk score

Why this scored 78/100

Our methodology →
Potential impact 24/30
Exploitability 18/25
Stealth signal 12/15
Affected reach 10/15
Confidence 9/10
Evidence quality 5/5
Human-validated context

Community notes

Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.

No validated notes yet.

The AI analysis stands alone for now. Submit a note if you can add evidence or important context.