Skip to content

Bug: Proposal execution hash is deterministic and predictable #4840

@508704820

Description

@508704820

Bug: Proposal execution hash is deterministic and predictable

Severity: Medium (Governance)

File: governance/proposals.py, execute_proposal() (line 389)

Description:
tx_hash = hashlib.sha256(f"{proposal_id}:{now}".encode()).hexdigest() generates the execution transaction hash from only the proposal ID and timestamp. Both values are publicly known, making the hash predictable before execution.

Impact:

  • Attackers can pre-compute expected execution hashes
  • Breaks transaction unpredictability guarantees
  • Could enable front-running of proposal executions

Expected Fix:
Include a cryptographic nonce (e.g., secrets.token_bytes(32)) in the hash input.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions