hats-finance / Most--Aleph-Zero-Bridge-0xab7c1d45ae21e7133574746b2985c58e0ae2e61d

Aleph Zero bridge to Ethereum
Apache License 2.0
0 stars 1 forks source link

Incorrect modifier #69

Open hats-bug-reporter[bot] opened 4 months ago

hats-bug-reporter[bot] commented 4 months ago

Github username: -- Twitter username: -- Submission hash (on-chain): 0x39d905efff0da6bb9c368e184021e47895aea467c23234cc7f7aa909def97efe Severity: low

Description: Description\ If a modifier does not execute _ or revert, the execution of the function will return the default value, which can be misleading for the caller.

Attack Scenario\

File: contracts/Migrations.sol

/// @audit ******************* Issue Detail *******************
Modifier Migrations.restricted() (contracts/Migrations.sol#9-11) does not always execute _; or revert

/// @audit ****************** Affected Code *******************
   9:     modifier restricted() {
  10:         if (msg.sender == owner) _;
  11:     }

Attachments

  1. Proof of Concept (PoC) File
    • deploy contract and call setCompleted function. then call it again from another non-owner address and transaction goes through as valid, whereas it should revert.
    • correct the restricted modifier logic to make it revert.

Files:

krzysztofziobro commented 4 months ago

duplicate of https://github.com/hats-finance/Most--Aleph-Zero-Bridge-0xab7c1d45ae21e7133574746b2985c58e0ae2e61d/issues/18