Frankencoin - DadeKuma's results

A decentralized and fully collateralized stablecoin.

General Information

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

Frankencoin

Findings Distribution

Researcher Performance

Rank: 65/199

Findings: 2

Award: $56.43

🌟 Selected for report: 0

🚀 Solo Findings: 0

Findings Information

🌟 Selected for report: Ruhum

Also found by: 7siech, DadeKuma, J4de, Lirios, deliriusz, foxb868, hihen, juancito, ladboy233, rbserver, santipu_, zaevlad

Labels

bug
2 (Med Risk)
satisfactory
duplicate-230

Awards

33.835 USDC - $33.83

External Links

Lines of code

https://github.com/Frankencoin-ZCHF/FrankenCoin/blob/main/contracts/Frankencoin.sol#L146-L151

Vulnerability details

Impact

Minters have a huge power in the Frankencoin system, as they can:

  • Transfer any amount of Frankencoin from/to anyone, as they have infinite allowance
  • Mint any amount of Frankencoin to anyone
  • Burn any amount of Frankencoin from anyone

We are supposing that minters are trustworthy, but bugs can (and will) happen even in the major firms in the DeFi space.

If a critical vulnerability leads to loss of access control and/or abuse of minter functions, the system will be permanently compromised, as this minter can't be removed after the application period.

Proof of Concept

It's possible to deny the application of a minter, but not remove it after the period has ended:

function denyMinter(
    address _minter,
    address[] calldata _helpers,
    string calldata _message
) external override {
    if (block.timestamp > minters[_minter]) revert TooLate();
    reserve.checkQualified(msg.sender, _helpers);
    delete minters[_minter];
    emit MinterDenied(_minter, _message);
}

Suppose that a trustworthy third party is allowed to become a minter by the system. Sometime after the application period has ended, one of the following scenarios could happen:

  1. A critical vulnerability is found in the minter contract, which could imply loss of access control and/or abuse of minter functions by unauthorized third parties. Frankencoin can't stop this minter in any way, and the system is permanently compromised.
  2. A minter contract is an upgradable contract that doesn't have any vulnerabilities, however, it's updated with a new version that has a critical bug, which leads to scenario 1.

Tools Used

Manual review

Consider adding a way to remove established minters (and their positions) for qualified pool shareholders.

#0 - c4-pre-sort

2023-04-21T15:19:33Z

0xA5DF marked the issue as duplicate of #230

#1 - c4-judge

2023-05-18T13:44:18Z

hansfriese marked the issue as satisfactory

AuditHub

A portfolio for auditors, a security profile for protocols, a hub for web3 security.

Built bymalatrax © 2024

Auditors

Browse

Contests

Browse

Get in touch

ContactTwitter