Skip to content
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

Possible to steal funds from another chains #440

Closed
code423n4 opened this issue Jan 30, 2023 · 5 comments
Closed

Possible to steal funds from another chains #440

code423n4 opened this issue Jan 30, 2023 · 5 comments
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 downgraded by judge Judge downgraded the risk level of this issue duplicate-107 satisfactory satisfies C4 submission criteria; eligible for awards

Comments

@code423n4
Copy link
Contributor

Lines of code

https://github.com/rabbitholegg/quest-protocol/blob/8c4c1f71221570b14a0479c216583342bd652d8d/contracts/QuestFactory.sol#L215-L229

Vulnerability details

Impact

Current implementation of token vesting not resistant to:

  1. Deploy this factory on different chains (you've noticed you're going to be multi-chain).
  2. Deploy this factory on the same chain with different address.

Proof of Concept

  1. You deployed factory to the Etherium, and held a competition with name "makeTransfer".
  2. Users claimed tokens on the Etherium chain and know valid signature.
  3. You launched on the Polygon network, and held a competition with the same name "makeTransfer".
  4. Users may don't complete tasks on the Polygon network and just resubmit already known signature with hash. -- Here is critical error because user may cheat.

The same thing can happen if you deploy factory to the same network but to a new address, because your signature does not depend on the factory address.

Tools Used

Manual audit

Recommended Mitigation Steps

Use spec: https://eips.ethereum.org/EIPS/eip-712

See how it's implemented in Uniswap V2:
https://github.com/Uniswap/v2-core/blob/master/contracts/UniswapV2ERC20.sol
https://github.com/Uniswap/v2-core/blob/master/contracts/UniswapV2ERC20.sol#L29-L37
https://github.com/Uniswap/v2-core/blob/master/contracts/UniswapV2ERC20.sol#L81-L93

Do the same.

@code423n4 code423n4 added 3 (High Risk) Assets can be stolen/lost/compromised directly bug Something isn't working labels Jan 30, 2023
code423n4 added a commit that referenced this issue Jan 30, 2023
@c4-judge c4-judge closed this as completed Feb 6, 2023
@c4-judge
Copy link
Contributor

c4-judge commented Feb 6, 2023

kirk-baird marked the issue as duplicate of #45

@c4-judge
Copy link
Contributor

c4-judge commented Feb 6, 2023

kirk-baird marked the issue as partial-25

@c4-judge c4-judge added the partial-25 Incomplete articulation of vulnerability; eligible for partial credit only (25%) label Feb 6, 2023
@kirk-baird
Copy link

Partial credit as this is very poorly described.

@c4-judge c4-judge added 2 (Med Risk) Assets not at direct risk, but function/availability of the protocol could be impacted or leak value downgraded by judge Judge downgraded the risk level of this issue and removed 3 (High Risk) Assets can be stolen/lost/compromised directly labels Feb 14, 2023
@c4-judge
Copy link
Contributor

kirk-baird changed the severity to 2 (Med Risk)

@c4-judge
Copy link
Contributor

kirk-baird marked the issue as satisfactory

@c4-judge c4-judge added satisfactory satisfies C4 submission criteria; eligible for awards duplicate-107 and removed partial-25 Incomplete articulation of vulnerability; eligible for partial credit only (25%) duplicate-45 labels Feb 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
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 downgraded by judge Judge downgraded the risk level of this issue duplicate-107 satisfactory satisfies C4 submission criteria; eligible for awards
Projects
None yet
Development

No branches or pull requests

3 participants