Closed c4-bot-1 closed 9 months ago
raymondfam marked the issue as insufficient quality report
raymondfam marked the issue as duplicate of #21
raymondfam marked the issue as not a duplicate
raymondfam marked the issue as primary issue
QA low.
Intended design but we can consider
andresaiello (sponsor) acknowledged
alcueca marked the issue as duplicate of #21
alcueca marked the issue as satisfactory
Lines of code
https://github.com/code-423n4/2024-01-curves/blob/516aedb7b9a8d341d0d2666c23780d2bd8a9a600/contracts/Curves.sol#L428-L437 https://github.com/code-423n4/2024-01-curves/blob/516aedb7b9a8d341d0d2666c23780d2bd8a9a600/contracts/Curves.sol#L439-L454 https://github.com/code-423n4/2024-01-curves/blob/516aedb7b9a8d341d0d2666c23780d2bd8a9a600/contracts/Curves.sol#L456-L463 https://github.com/code-423n4/2024-01-curves/blob/516aedb7b9a8d341d0d2666c23780d2bd8a9a600/contracts/Curves.sol#L338-L356
Vulnerability details
Impact
Note: Due to that the protocol is a Social App, I have decided to report this issue, You have not to compare it with other cases/protocols.
setNameAndSymbol
and_deployERC20
are not checking if thename
is previously used by another token or not, this let's attacker to create a token with a duplicate name, where the token-name belongs to a famous person, this opens possible phishing attacks for abusers.Proof of Concept
Bob decides to join into the protocol, so he calls
buyCurvesTokenWithName
:For the
name
he enters exactly a token-name which belongs to a famous man, and forsymbol
he enters a unique symbol (or Bob may enter also the exact symbol with 1 different character which make the symbol to be unique, this helps Bob to implement a more successful attack and seems real)._buyCurvesToken will give the first 1-ether of Bob's token to himself. then it goes to
_mint
:It just checks if the Bob already created any curve or not, because the Bob is a new creator/user so he doesn't have any subjectToken and it goes to
_deployERC20
:We see the function is not authorizing the
name
is previously used or not, and just authorizes thesymbol
, so all the checks will be passed and the Bob's token will be created.Now he implements a phishing attack by advertising to other people, and only because of the similarity in token names they may buy the Bob's token instead of the original one.
Tools Used
Manual Review
Recommended Mitigation Steps
Contract should revert if the
name
is previously used by another token.Assessed type
Invalid Validation