Signatures can be misused to reverify #323
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
duplicate-187
satisfactory
satisfies C4 submission criteria; eligible for awards
Lines of code
https://github.com/code-423n4/2023-01-ondo/blob/main/contracts/cash/kyc/KYCRegistry.sol#L79
Vulnerability details
Impact
It is possible to remove the KYC status of any user by using the
removeKYCAddresses
function. This could be easily overridden by user using theaddKYCAddressViaSignature
function as shown belowProof of Concept
User KYC is approved and he is provided with a signature signed by an address with the role kycGroupRoles[kycRequirementGroup]
User claims his KYC approved status using
addKYCAddressViaSignature
function which marks himkycState[kycRequirementGroup][user] = true
One of KYC group role realizes that User KYC was not actually proper and decides to remove his KYC status using
removeKYCAddresses
functionThis sets
kycState[kycRequirementGroup][user] = false
addKYCAddressViaSignature
function to again setkycState[kycRequirementGroup][user] = true
Recommended Mitigation Steps
Mark the signature as used
The text was updated successfully, but these errors were encountered: