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

cancelPromotion() Does Not Send Promotion Tokens Back to the Creator #36

Open
code423n4 opened this issue Dec 10, 2021 · 2 comments
Open
Assignees
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 disputed Sponsor cannot duplicate the issue, or otherwise disagrees this is an issue

Comments

@code423n4
Copy link
Contributor

Handle

Meta0xNull

Vulnerability details

Impact

@notice Cancel currently active promotion and send promotion tokens back to the creator.
The Notice Mention Token Send Back to the Creator.

_promotion.token.safeTransfer(_to, _remainingRewards);
But in the code, Token Send to _to.

  1. The code is different from what is written down.
  2. There is no Validation address _to == Creator Address. Address _to Could Be Third Party Address or Account Not Under Control by Creator which mean is possible Creator lose fund.

Proof of Concept

https://github.com/pooltogether/v4-periphery/blob/ceadb25844f95f19f33cb856222e461ed8edf005/contracts/interfaces/ITwabRewards.sol#L56
https://github.com/pooltogether/v4-periphery/blob/b520faea26bcf60371012f6cb246aa149abd3c7d/contracts/TwabRewards.sol#L133

Tools Used

Manual Review

Recommended Mitigation Steps

Since the Creator is msg.sender, should Transfer Tokens back to msg.sender.
_promotion.token.safeTransfer(msg.sender, _remainingRewards);

In cancelPromotion(), Remove Input address _to.

@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 Dec 10, 2021
code423n4 added a commit that referenced this issue Dec 10, 2021
@PierrickGT
Copy link
Member

PierrickGT commented Dec 10, 2021

This function is only callable by the promotion creator, the _to address param is here to offer the possibility to the creator to send the remaining funds to an address of his choosing, wether he his in control of it or not.
For this reason, I've disputed the issue.

@PierrickGT PierrickGT self-assigned this Dec 10, 2021
@PierrickGT PierrickGT added the sponsor disputed Sponsor cannot duplicate the issue, or otherwise disagrees this is an issue label Dec 10, 2021
@dmvt
Copy link
Collaborator

dmvt commented Jan 17, 2022

The sponsor's explanation is valid but also confirms that the code comment is wrong. This is a valid low risk issue.

1 — Low (L): vulns that have a risk of 1 are considered “Low” severity when assets are not at risk. Includes state handling, function incorrect as to spec, and issues with comments.

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 disputed Sponsor cannot duplicate the issue, or otherwise disagrees this is an issue
Projects
None yet
Development

No branches or pull requests

3 participants