Skip to content

[Audit] Contract's resume_stream doesn't check is_active, allowing a cancelled-while-paused stream to be "resumed" #1223

Description

@K1NGD4VID

Filed from the second-wave repository audit (issue 21/100). See the audit summary for full category context.

  • Location: contracts/stream_contract/src/lib.rs:619-627
  • Problem: resume_stream only checks stream.paused, not is_active (unlike pause_stream, which calls validate_stream_active). cancel_stream sets is_active=false/status=Cancelled but never clears paused. A paused-then-cancelled stream can still be "resumed," setting status = Active while is_active stays false — a permanently corrupted, self-contradictory on-chain record.
  • Evidence: resume_stream body has no validate_stream_active/is_active check.
  • Suggested implementation: Add an is_active check (return StreamError::StreamNotActive if false) at the top of resume_stream, and/or have cancel_stream clear paused as part of cancellation.
  • Acceptance criteria: A new contract test for the pause → cancel → resume sequence asserts resume_stream returns an error and stream state is unchanged.
  • Difficulty: S
  • Expected impact: Eliminates a reachable on-chain state-corruption path with no recovery mechanism (contract state is immutable once corrupted).

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Stellar WaveIssues in the Stellar wave programbugSomething isn't workingcontractsSmart contract related taskssecond-wave-auditFiled from the second-wave repo audit (100 issues)

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions