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

Upgraded Q -> 3 from #179 [1704126766195] #642

Closed
c4-judge opened this issue Jan 1, 2024 · 2 comments
Closed

Upgraded Q -> 3 from #179 [1704126766195] #642

c4-judge opened this issue Jan 1, 2024 · 2 comments
Labels
3 (High Risk) Assets can be stolen/lost/compromised directly duplicate-448 unsatisfactory does not satisfy C4 submission criteria; not eligible for awards

Comments

@c4-judge
Copy link
Contributor

c4-judge commented Jan 1, 2024

Judge has assessed an item in Issue #179 as 3 risk. The relevant finding follows:

There’s also a reentrancy in uniswapV3MintCallback() with ERC777 tokens (the project supports them). When Alice calls mintTokenizedPosition() the following will happen:
She’ll receive SFPM tokens from _mint();
_createLegInAMM() calculates and updates the liquidity held by Alice;
_mintLiquidity() calls UniswapV3Pool.mint();
Uniswap calls back to uniswapV3MintCallback();
The callback calls the token to transfer funds from Alice to Uniswap;
And if the token is ERC777, it’ll call Alice before the transfer. At this point, Alice has both SFPM tokens and liquidity to use in external systems before actually paying any money. Even if these external systems rely on non-standard liquidity counters inside SFPM (s_accountLiquidity mapping) instead of the standard ERC1155 to determine the liquidity held by Alice, they will still be vulnerable to this reentrancy. Solution here is to update the liquidity after the payment.

@c4-judge c4-judge added the 3 (High Risk) Assets can be stolen/lost/compromised directly label Jan 1, 2024
@c4-judge c4-judge closed this as completed Jan 1, 2024
@c4-judge
Copy link
Contributor Author

c4-judge commented Jan 1, 2024

Picodes marked the issue as duplicate of #519

@c4-judge
Copy link
Contributor Author

c4-judge commented Jan 1, 2024

Picodes marked the issue as unsatisfactory:
Insufficient proof

@c4-judge c4-judge added unsatisfactory does not satisfy C4 submission criteria; not eligible for awards duplicate-448 and removed duplicate-519 labels Jan 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3 (High Risk) Assets can be stolen/lost/compromised directly duplicate-448 unsatisfactory does not satisfy C4 submission criteria; not eligible for awards
Projects
None yet
Development

No branches or pull requests

1 participant