Skip to content

[security] vesting-wallet: initialize doesn't prevent re-initialization #415

Description

@ritaifeoluwa

Problem

The initialize function may not prevent re-initialization, allowing the vesting schedule to be overwritten.

Impact

  • Vesting schedule could be changed after initialization
  • Beneficiary could be changed
  • Total amount could be modified

Fix

Add re-initialization guard:

if env.storage().instance().has(&DataKey::Beneficiary) {
    return Err(VestingError::AlreadyInitialized);
}

Location

contracts/vesting-wallet/src/lib.rs, initialize function.

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 programsecuritySecurity vulnerability or hardening

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions