Platform: Code4rena
Start Date: 12/04/2023
Pot Size: $60,500 USDC
Total HM: 21
Participants: 199
Period: 7 days
Judge: hansfriese
Total Solo HM: 5
Id: 231
League: ETH
Rank: 94/199
Findings: 1
Award: $33.83
🌟 Selected for report: 0
🚀 Solo Findings: 0
33.835 USDC - $33.83
https://github.com/code-423n4/2023-04-frankencoin/blob/1022cb106919fba963a89205d3b90bf62543f68f/contracts/Frankencoin.sol#L125 https://github.com/code-423n4/2023-04-frankencoin/blob/1022cb106919fba963a89205d3b90bf62543f68f/contracts/Frankencoin.sol#L83 https://github.com/code-423n4/2023-04-frankencoin/blob/1022cb106919fba963a89205d3b90bf62543f68f/contracts/Frankencoin.sol#L266
If a minter or position account is compromised, the contract will be attacked without any rescue measures.
Any Frankencoin minter or position account set by a minter can call mint and burn operations at will.
For example, the following functions can be called by minterOnly
:
function mint(address _target, uint256 _amount, uint32 _reservePPM, uint32 _feesPPM) override external minterOnly {` function mint(address _target, uint256 _amount) override external minterOnly {` function burn(uint256 amount, uint32 reservePPM) external override minterOnly {` function burnFrom(address payer, uint256 targetTotalBurnAmount, uint32 _reservePPM) external override minterOnly returns (uint256) {` function burnWithReserve(uint256 _amountExcludingReserve, uint32 _reservePPM) external override minterOnly returns (uint256) {` function burn(address _owner, uint256 _amount) override external minterOnly {`
The definition of minterOnly() is as follows:
modifier minterOnly() { if (!isMinter(msg.sender) && !isMinter(positions[msg.sender])) revert NotMinter(); _; }
This means that every minter and position account has permissions. And there is no place in the code to log out or delete a minter or position.
So if a valid minter or position account is compromised, a hacker can call these functions at any time to launch an attack. Even if the community or the minters themselves find out about this problem, there is no remedy. Because the Frankencoin contract cannot invalidate a minter or position.
VS Code
We should add the ability to remove minter and cancel positions to Frankencoin. A minter should be able to cancel any position, and the community should be able to vote to delete a minter.
#0 - c4-pre-sort
2023-04-28T10:37:48Z
0xA5DF marked the issue as duplicate of #230
#1 - c4-judge
2023-05-18T13:41:07Z
hansfriese marked the issue as satisfactory