Signature can be forged for random addresses #644
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
primary issue
Highest quality submission among a set of duplicates
sponsor disputed
Sponsor cannot duplicate the issue, or otherwise disagrees this is an issue
sufficient quality report
This report is of sufficient quality
unsatisfactory
does not satisfy C4 submission criteria; not eligible for awards
Lines of code
https://github.com/code-423n4/2023-12-ethereumcreditguild/blob/main/src/tokens/ERC20MultiVotes.sol#L467-L505
Vulnerability details
Impact
A malicious user might attempt to forge signatures to delegate voting power from random addresses to
delegatee
.Proof of Concept
During signature verification using
ecrecover()
, there exists a vulnerability where the signature can be forged, causing ecrecover() to return a random address. Consequently, the voting power of this random address might be delegated todelegate
.Malicious user can forge signatures to generated a large number of random addresses, then find out which one has non-zero balance and delegate its voting power without any permission.
Copy below codes to
ERC20MultiVotes.t.sol
and runforge test --match-test testDelegateWithForgedSig
:Tools Used
Manual review
Recommended Mitigation Steps
Add
delegator
parameter in signed delegation, to avoid forging signatures for random addresses. Removenonce
parameter for simplicity:Assessed type
Other
The text was updated successfully, but these errors were encountered: