-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Loss of Humanity Due to Incomplete Cross-Chain Transfer During Vouching Phase #165
Comments
humanity is not allowed to transfer during vouching state. |
duplicate #84 |
Hi, Issue #84 is not a duplicate of Issue #165. Issue #84 is invalid. A user can bypass the vouching phase and acquire a Humanity ID on two different chains by exploiting the `renewHumanity` and `transferHumanity` functions. This allows the user to transfer their Humanity ID from one chain to another without proper vouching, effectively registering the same ID on multiple chains. According to Issue #84, once a user transfers their humanity to a new chain, they can have humanity on multiple chains simultaneously. This is incorrect. When a user transfers their humanity to a different chain, their humanity on the original chain is deleted due to the The vulnerability, impact, and exploit described in Issue #84 are entirely different. |
Yeah, those are different. Indeed, you shouldn't have a request while having a humanity on another chain. If you do this means that when this submission advance you would have an invalid submission. Note that there is no point in preventing at the contract level the transfer of a humanity if there is a current request (made through a renewal) as the user could just claim the humanity just after the transfer anyways (and there is no way to prevent that as we can't know in real time if a user is registered on another platform). But the frontend should not allow the user to do that (and if someone does anyways, they can only harm themselves). |
@clesaege Because the A user can simply call the As a result, when the user transfers back to the previous chain, they will lose their humanity. The fix proposed in the report is straightforward. We don't need to know if a user is registered on another platform in real time. We just need to prevent users from transferring while they have an open request. |
Preventing transfer while there is an open request doesn't provide any security. Because they can just make a claim just after and end up in the same situation (have a request in one chain and a humanity on the other).
So here this is a frontend job. |
Answer from the frontend dev:
So from my understanding the frontend does prevent that. Of course, users can hurt themselves by interacting with the contract directly, but that is at their own risk. |
Github username: --
Twitter username: --
Submission hash (on-chain): 0xf755ff704c98237c79dac348dbc193563c8ddca77e650f175daa6daea5675e45
Severity: medium
Description:
Description
A user who transfers their humanity while in the vouching phase cannot transfer it back to the previous chain.
The
ccGrantHumanity
function checks if the user’s humanity is in the process of being claimed on the receiving chain:Similarly, the
ccDischargeHumanity
function does not allow the transfer of humanity if the user has any pending requests:The
nbPendingRequests
variable is updated when a request reaches theResolving
orResolved
state.However, when a user claims or reclaims their humanity, the request initially enters the
vouching
state, where therequestCount
variable is updated.As a result, a user can only transfer their humanity if they have no ongoing requests or if their claim request has not reached the
Resolving
state. This means a user is allowed to transfer their humanity while the request is in thevouching
state.Problems occur when a user makes a reclaim request on Chain A and then decides to reclaim their humanity on Chain B without first withdrawing the request on Chain A. Initially, this causes no issues. However, when the user attempts to transfer their humanity back from Chain B to Chain A, their humanity will be lost on both chains due to the ongoing reclaim request on Chain A, which keeps the
requestCount
variable updated.Vulnerability Scenario
renewHumanity
function. His humanity enters thevouching
state, where other users can vouch for his humanity. TherequestCount
variable for Bob’s humanity is updated to reflect the ongoing reclaim request.vouching
phase, Bob decides to transfer his humanity to Chain B using thetransferHumanity
function.ccDischargeHumanity
function on Chain A checks if Bob has any pending requests. Since his request is in thevouching
state, and not yet in theResolving
orResolved
state, the transfer is allowed.ccDischargeHumanity
function on Chain B checks for any pending requests.vouching
state, with an activerequestCount
, the transfer is blocked.vouching
state.Mitigation:
Add the following lines to the
ccDischargeHumanity
function:The text was updated successfully, but these errors were encountered: