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

Predictability of newContractPool #99

Closed
c4-bot-3 opened this issue Apr 14, 2024 · 3 comments
Closed

Predictability of newContractPool #99

c4-bot-3 opened this issue Apr 14, 2024 · 3 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 🤖_99_group AI based duplicate group recommendation unsatisfactory does not satisfy C4 submission criteria; not eligible for awards

Comments

@c4-bot-3
Copy link
Contributor

Lines of code

https://github.com/code-423n4/2024-04-panoptic/blob/833312ebd600665b577fbd9c03ffa0daf250ed24/contracts/PanopticFactory.sol#L237

Vulnerability details

Impact

Stealing of user's deposit amount. When a user creates a new pool and deposit some funds in it, an attacker can frontrun the user's transaction and capture the deposit amounts.

Also, a user's newContractPool can forcefully be reverted by an attacker who creates a newContractPool for himself using a user's salt.

Proof of Concept

When creating newPoolContract, "salt" is the only value passed into cloneDeterministic.

   newPoolContract = PanopticPool(POOL_REFERENCE.cloneDeterministic(salt));

What this means is that there is nothing that makes the newPoolContract address unique. An attacker can frontrun the newPoolContract adddress by creating an exact newPoolContract.

Tools Used

Manual review

Recommended Mitigation Steps

"msg.sender" should be added to the "salt" value to make it unique like so:

   newPoolContract = PanopticPool(POOL_REFERENCE.cloneDeterministic(salt, msg.sender));

Assessed type

Other

@c4-bot-3 c4-bot-3 added 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 labels Apr 14, 2024
c4-bot-9 added a commit that referenced this issue Apr 14, 2024
@c4-bot-13 c4-bot-13 added the 🤖_99_group AI based duplicate group recommendation label Apr 22, 2024
@c4-judge
Copy link
Contributor

Picodes marked the issue as duplicate of #482

@c4-judge
Copy link
Contributor

c4-judge commented May 6, 2024

Picodes marked the issue as not a duplicate

@c4-judge c4-judge reopened this May 6, 2024
@c4-judge c4-judge closed this as completed May 6, 2024
@c4-judge c4-judge added the unsatisfactory does not satisfy C4 submission criteria; not eligible for awards label May 6, 2024
@c4-judge
Copy link
Contributor

c4-judge commented May 6, 2024

Picodes marked the issue as unsatisfactory:
Insufficient proof

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 🤖_99_group AI based duplicate group recommendation unsatisfactory does not satisfy C4 submission criteria; not eligible for awards
Projects
None yet
Development

No branches or pull requests

3 participants