Canto Application Specific Dollars and Bonding Curves for 1155s - ZanyBonzy's results

Tokenizable bonding curves using a Stablecoin-as-a-Service token

General Information

Platform: Code4rena

Start Date: 13/11/2023

Pot Size: $24,500 USDC

Total HM: 3

Participants: 120

Period: 4 days

Judge: 0xTheC0der

Id: 306

League: ETH

Canto

Findings Distribution

Researcher Performance

Rank: 88/120

Findings: 1

Award: $4.08

QA:
grade-b

🌟 Selected for report: 0

🚀 Solo Findings: 0

Awards

4.0797 USDC - $4.08

Labels

bug
downgraded by judge
grade-b
QA (Quality Assurance)
duplicate-313
Q-11

External Links

Lines of code

https://github.com/code-423n4/2023-11-canto/blob/335930cd53cf9a137504a57f1215be52c6d67cb3/asD/src/asDFactory.sol#L34

Vulnerability details

Impact

The create function makes a new asD token using the create, where the address derivation depends only on the asDFactory nonce. At the time of creation, a block reorg may be happenning. They're not uncommon EVM chains including Canto where this project will be deployed. A malicious user can use this to his advantage to steal funds from the initial creator.

Previous reports also contain more information on the issue. Frankencoin, Rabbithole, PoolTogether

Proof of Concept

Alice creates an asD contract through the create function. Bob sees that the block reorg is happening and calls the same function with different parameters. Thus, it creates the asD contract with an address that Alice is supposed to have. Subsequently, any transactions conducted on Alice's asD contaract (e.g minting, burning, etc.) will be executed on the asD contract with Bobs provided parameters.

function create(string memory _name, string memory _symbol) external returns (address) { asD createdToken = new asD(_name, _symbol, msg.sender, cNote, owner()); //@note isAsD[address(createdToken)] = true; emit CreatedToken(address(createdToken), _symbol, _name, msg.sender); return address(createdToken); }

Tools Used

Manual code review

Use create2 instead of create, with salt that depends on msg.sender.

Assessed type

Other

#0 - c4-pre-sort

2023-11-20T07:48:29Z

minhquanym marked the issue as duplicate of #313

#1 - c4-judge

2023-11-29T00:16:48Z

MarioPoneder changed the severity to QA (Quality Assurance)

#2 - c4-judge

2023-11-29T22:30:58Z

MarioPoneder marked the issue as grade-c

#3 - ZanyBonzy

2023-12-03T09:26:22Z

Hi, I believe this to have been misjudged.

This is something that does happen and causes loss of funds to the user, which we agree is a high risk situation. But it occurs not very often which brings the severity down to a medium.

But we do agree that this happens, I still don't think it's worth taking the risk, just because it happens rarely, attackers certainly don't care about these things.

Also, Issues of these type have always been historically judged as medium. Maïa Dao, RabbitHole, Pool together, Kairos Loan, etc as recent as 1/2 months ago. So, I don't quite follow why this shouldn't also be. I mean, a bit of consistency in judgement, please?

Thanks for your time.

#4 - c4-judge

2023-12-04T12:06:36Z

MarioPoneder marked the issue as grade-b

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