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

Users Can Game sNOTE Minting If Buybacks Occur Infrequently #231

Open
code423n4 opened this issue Feb 3, 2022 · 2 comments
Open

Users Can Game sNOTE Minting If Buybacks Occur Infrequently #231

code423n4 opened this issue Feb 3, 2022 · 2 comments
Labels
1 (Low Risk) Assets are not at risk. State handling, function incorrect as to spec, issues with comments bug Something isn't working sponsor acknowledged Technically the issue is correct, but we're not going to resolve it for XYZ reasons

Comments

@code423n4
Copy link
Contributor

Handle

leastwood

Vulnerability details

Impact

As there is no cooldown when minting sNOTE tokens, users can frontrun calls to TreasuryManager.investWETHToBuyNOTE and receive rewards without having staked for the full duration prior. If these buybacks occur infrequently, it may be possible for a NOTE holder to profit by staking before a call to investWETHToBuyNOTE, waiting for the cooldown to pass before finally redeeming sNOTE to be used in other protocols. This can be repeated again and again to extract additional yield from the protocol.

Proof of Concept

https://github.com/code-423n4/2022-01-notional/blob/main/contracts/TreasuryManager.sol

Tools Used

Manual code review.

Recommended Mitigation Steps

Ensure buybacks occur frequently or consider adding a mechanism to delay deposits to further disincentivize staking gamification.

@code423n4 code423n4 added 1 (Low Risk) Assets are not at risk. State handling, function incorrect as to spec, issues with comments bug Something isn't working labels Feb 3, 2022
code423n4 added a commit that referenced this issue Feb 3, 2022
@jeffywu jeffywu added duplicate This issue or pull request already exists sponsor acknowledged Technically the issue is correct, but we're not going to resolve it for XYZ reasons labels Feb 6, 2022
@jeffywu
Copy link
Collaborator

jeffywu commented Feb 6, 2022

While this is possible, the profitability of this is limited by the price slippage restriction on the treasury manager when they invest WETH to buy NOTE. If there is not a lot of price appreciation and a large base of BPT liquidity then this will not yield very much profit to the attacker, possible not enough to recoup their transaction fees.

Duplicate of #190

@pauliax
Copy link
Collaborator

pauliax commented Feb 16, 2022

Valid concern. I am making this a primary issue as it contains the sponsor's explanation of why this kind of attack may not be that impactful.

@pauliax pauliax reopened this Feb 16, 2022
@pauliax pauliax removed the duplicate This issue or pull request already exists label Feb 16, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
1 (Low Risk) Assets are not at risk. State handling, function incorrect as to spec, issues with comments bug Something isn't working sponsor acknowledged Technically the issue is correct, but we're not going to resolve it for XYZ reasons
Projects
None yet
Development

No branches or pull requests

4 participants