createProject can be frontrun #26
Labels
2 (Med Risk)
Assets not at direct risk, but function/availability of the protocol could be impacted or leak value
bug
Something isn't working
sponsor confirmed
Sponsor agrees this is a problem and intends to fix it (OK to use w/ "disagree with severity")
Lines of code
https://github.com/code-423n4/2022-03-joyn/blob/main/core-contracts/contracts/CoreFactory.sol#L70-L77
Vulnerability details
Impact
This is dangerous in scam senario because the malicious user can frontrun and become the owner of the collection. As owner, one can withdraw
paymentToken
. (note that _collections.isForSale can be change by frontrunner)Proof of Concept
createProject
.https://github.com/code-423n4/2022-03-joyn/blob/main/core-contracts/contracts/CoreFactory.sol#L70-L77
Recommended Mitigation Steps
Two way to mitigate.
msg.sender
. https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/utils/cryptography/ECDSA.sol#L102The text was updated successfully, but these errors were encountered: