Skip to content

set_pool_wasm_hash does not validate the hash is valid WASM #186

Description

@ritaifeoluwa

Description

The Factory contract's set_pool_wasm_hash function does not validate that the new hash is a valid WASM module. It accepts any 32-byte hash.

Current behavior

pub fn set_pool_wasm_hash(env: Env, new_hash: BytesN<32>) -> Result<(), FactoryError> {
    // No validation on new_hash
}

Expected behavior

Consider:

  • Uploading and validating the WASM before setting the hash
  • Or documenting that callers must verify the hash separately
  • Or storing the WASM bytes alongside the hash for verification

Why this matters

Setting an invalid hash would cause all future pool deployments to fail.

Labels

security, factory, hard

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 programfactoryFactory contracthardRequires deep domain knowledge and careful design — not a quick fixsecuritySecurity vulnerability or hardening

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions