Skip to content

Security audit of stealth-sender Soroban contract #3

@truthixify

Description

@truthixify

Labels: Stellar Wave, stellar, audit, security, drips, help-wanted
Tier: L (1–2 weeks)
Type: audit

Context

contracts/stellar/stealth-sender/ performs the atomic "transfer asset + emit announcement" operation. It is the contract that handles user funds in flight during a stealth payment, and it interoperates with arbitrary Stellar Asset Contracts (SAC). The blast radius of an issue here is direct loss of funds.

Scope

Independent security review with the standard severity matrix. Specific concerns:

  • Token contract trustsend() calls token::Client::new(env, &token).transfer(...). Confirm we cannot be re-entered by a malicious SAC during the call, and that we never accept a token contract address that hasn't been validated by the caller.
  • Native asset vs. issued asset divergence — verify XLM and arbitrary issued assets behave identically across success and failure paths.
  • Batch send atomicitybatch_send() should be all-or-nothing. Verify by injecting a failing transfer mid-batch.
  • Announcer call coupling — the sender invokes the announcer atomically. What happens if the announcer panics? Funds should not be moved without an announcement.
  • Fee/refund flows — Soroban allows partial-failure semantics in some paths. Confirm there's no asymmetry where the caller pays fees but funds don't reach the stealth address.
  • Auth caching / require_auth_for_args — verify that auth contexts cover both the source account and the asset's spender contract correctly.
  • Reentrancy via CPI / nested contract callsstealth-sender calls into the announcer; the announcer could in turn call back via a malicious extension. Confirm reentrancy is impossible or guarded.
  • Init / upgrade story — review init() for one-shot semantics. Can it be re-initialized?

Acceptance criteria

  • Audit report at contracts/stellar/stealth-sender/audits/2026-XX-author.md.
  • Adversarial test suite at tests/audit.rs including:
    • A malicious-token mock that attempts reentry into send().
    • A failing-transfer middle-of-batch test for batch_send.
    • An announcer-panic test verifying funds are not lost.
  • Findings disclosed privately for anything Critical/High.

Suggested approach

Build a small mock-token Soroban contract under tests/mocks/ that mimics SAC behavior but also implements re-entrancy callbacks. Use it as the harness for all adversarial cases.

Files to start with

  • contracts/stellar/stealth-sender/src/lib.rs
  • contracts/stellar/stealth-announcer/src/lib.rs (called atomically)
  • EVM reference: contracts/evm/contracts/WraithSender.sol

Metadata

Metadata

Assignees

Labels

Stellar WaveIssues in the Stellar wave programauditProduces a written report as primary deliverabledripsFunded via Drips Networkhelp wantedExtra attention is neededsecuritySecurity-sensitive workstellarTouches Stellar / Soroban code

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions