Frankencoin - carlitox477'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: 70/199

Findings: 2

Award: $50.88

🌟 Selected for report: 0

🚀 Solo Findings: 0

Findings Information

🌟 Selected for report: Josiah

Also found by: 0xDACA, Diana, Emmanuel, Kumpa, Nyx, RaymondFam, Ruhum, __141345__, bin2chen, carlitox477, lil_eth, nobody2018, rbserver

Labels

bug
2 (Med Risk)
satisfactory
duplicate-932

Awards

28.2764 USDC - $28.28

External Links

Lines of code

https://github.com/code-423n4/2023-04-frankencoin/blob/1022cb106919fba963a89205d3b90bf62543f68f/contracts/Position.sol#L97-L101

Vulnerability details

Description

According to code comment, Position.reduceLimitForClone(uint256) should Adjust this position's limit to give away half of the remaining limit to the clone.

This requirement is not meet by the function.

Impact

Allows someone how is cloning a position to get more than half of the remaining limit.

POC

https://gist.github.com/carlitox477/c80c5b1d660709d4f6b68b20d1e5b6d6

Mitigation steps

The reduction should be done by just \frac{limit - minted}{2} according to comments. This means that parameter _minimum should not be taken into account when reduceLimitForClone is called, given that the remaining limit = limit - minted. This means:

function reduceLimitForClone() external noChallenge noCooldown alive onlyHub returns (uint256) {
    uint256 reduction = (limit - minted)/2; // this will fail with an underflow if minimum is too high
    limit -= reduction;
    return reduction;
}

#0 - c4-pre-sort

2023-04-20T09:54:07Z

0xA5DF marked the issue as duplicate of #932

#1 - c4-judge

2023-05-18T14:16:19Z

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