Sparkly Seaweed Wolf
Medium
Base chain user the similar structure with Op chain. This will cause the possible re-org case. When we register address, we miss enough check to avoid the possible reorg attack.
In EthosProfile:373, users can register one address into their profiles. They will get one signature from Ethos app, and register this address into their profile. But the problem is that if re-org happens, the registered address may be registered to other user's profile and this register address may not be used any more.
From readme, we can find that the Ethos app will be deployed on Base L2 chain. Base Chain has one similar structure with Op chain. Both of them may have the possible re-org case. For example:
- Alice creates one profile, and the profile is 2.
- Alice register her another address X into the profile 2.
- If re-org happens, Bob monitors the re-org case, can create one profile before Alice's profile creation, then the profileId 2 will belongs to Alice.
- Alice's profile creation will be re-executed but the generated profileId will be 3.
- Alice register her address X into profile 2. Note, the signature is valid here.
- Alice's address X will be registered to Bob's profile. Bob can directly remove address X. Then Alice's address X will never be used again.
N/A
- Re-org happens in Base chain.
- Bob creates one profile before Alice's creation.
- Alice creates one profile, and the profile is 2.
- Alice register her another address X into the profile 2.
- If re-org happens, Bob monitors the re-org case, can create one profile before Alice's profile creation, then the profileId 2 will belongs to Alice.
- Alice's profile creation will be re-executed but the generated profileId will be 3.
- Alice register her address X into profile 2. Note, the signature is valid here.
- Alice's address X will be registered to Bob's profile. Bob can directly remove address X. Then Alice's address X will never be used again.
Users may not register his address into his profile as expected. And this address will never be used in this system.
N/A
Possible solution:
- Only
addressStr
can register himself into one profile. - When we create profile, change profileId to byte32 type, and add some salt information into profileId, for example creator. So even if re-org happens, other profile creators cannot own the same profileId.