Skip to content

Add protection to prevent drain of funds after malicious contract upgrade #43

@romanzac

Description

@romanzac

The test_MaliciousUpgradeDrainsFunds is currently failing - when the contract is upgraded with malicious version, all funds may be drained. This situation could happen when the contract owner for example: went rogue, got bribed or CI script for deployment was altered by a hacker.

Impact

Low occurrence, high impact.

To reproduce

  1. Please checkout f7a328d
  2. cd waku-rlnv2-contract
  3. forge test --match-test test_MaliciousUpgradeDrainsFunds -vvvv

Expected behavior

RLN contract should ideally provide guarantee which lowers the risk of a single event leading to drain of funds. Mitigation could be a time lock, multisig, or layered smart contract design which would allow to decouple upgrade with funds manipulation.

Screenshots/logs

test__MaliciousUpgradeDrainsFunds.log

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions