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

Check the actual amounts transferred #206

Open
code423n4 opened this issue Sep 22, 2021 · 2 comments
Open

Check the actual amounts transferred #206

code423n4 opened this issue Sep 22, 2021 · 2 comments
Labels
1 (Low Risk) Assets are not at risk. State handling, function incorrect as to spec, issues with comments bug Warden finding duplicate Another warden found this issue sponsor acknowledged Technically the issue is correct, but we're not going to resolve it for XYZ reasons

Comments

@code423n4
Copy link
Contributor

Handle

pauliax

Vulnerability details

Impact

Consider checking the actual amount transferred, e.g. in function addBounty as otherwise, you may have trouble with non-standard tokens, e.g. deflationary with a fee on transfer. The actual amount transferred is balanceOf the token before and after.

Recommended Mitigation Steps

uint256 before = IERC20(token).balanceOf(address(this));
token.safeTransferFrom(msg.sender, address(this), amount);
uint256 after = IERC20(token).balanceOf(address(this));
amount = after - before;

@code423n4 code423n4 added 1 (Low Risk) Assets are not at risk. State handling, function incorrect as to spec, issues with comments bug Warden finding labels Sep 22, 2021
code423n4 added a commit that referenced this issue Sep 22, 2021
@frank-beard frank-beard added duplicate Another warden found this issue sponsor acknowledged Technically the issue is correct, but we're not going to resolve it for XYZ reasons labels Oct 19, 2021
@frank-beard
Copy link
Collaborator

#236

@GalloDaSballo
Copy link
Collaborator

This finding comments on the correctness of trusting input vs actually checking what the changed balance is.
There is no clear "attack" nor way to brick or grief the protocol.
Agree with finding and severity

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 Warden finding duplicate Another warden found this issue 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

3 participants