Lucene search

K
code423n4Code4renaCODE423N4:2022-06-CANTO-FINDINGS-ISSUES-195
HistoryJun 21, 2022 - 12:00 a.m.

In Cnote.sol, anyone can initially become both accountant and admin

2022-06-2100:00:00
Code4rena
github.com
3
cnote.sol
access control
accountant
admin
privilege escalation

Lines of code

Vulnerability details

Impact

Affected code:

The function _setAccountantContract() is supposed to be called after contract initialization, so that the accountant is immediately set. However, this function completely lacks any access control (it’s just public) so an attacker can monitor the mempool and frontrun the transaction in order to become both accountant and admin

Tools Used

Editor

Recommended Mitigation Steps

The function should:

  1. have a guard that regulates access control
  2. not set the admin too, which is dangerous and out of scope

The text was updated successfully, but these errors were encountered:

All reactions