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

Option buyer receives no refunds if he sends too much ETH #66

Closed
code423n4 opened this issue May 12, 2022 · 1 comment
Closed

Option buyer receives no refunds if he sends too much ETH #66

code423n4 opened this issue May 12, 2022 · 1 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 duplicate This issue or pull request already exists sponsor confirmed Sponsor agrees this is a problem and intends to fix it (OK to use w/ "disagree with severity")

Comments

@code423n4
Copy link
Contributor

Lines of code

Cally.sol#L224-L226

Vulnerability details

Impact

If option buyer sends an amount bigger than premium the difference is not refunded to buyer.

This could lead to a big loss for the buyer who could have made a mistake like for example typing an extra zero.

Proof of Concept

require(msg.value >= premium, "Incorrect ETH amount sent");

Recommended Mitigation Steps

Consider refunding the difference to the buyer (more gas expensive) or implementing a check with strict equality: msg.value == premium (less gas expensive).

@code423n4 code423n4 added 3 (High Risk) Assets can be stolen/lost/compromised directly bug Something isn't working labels May 12, 2022
code423n4 added a commit that referenced this issue May 12, 2022
@outdoteth outdoteth added sponsor confirmed Sponsor agrees this is a problem and intends to fix it (OK to use w/ "disagree with severity") duplicate This issue or pull request already exists labels May 15, 2022
@outdoteth
Copy link
Collaborator

reference issue: #84

@HardlyDifficult HardlyDifficult added 2 (Med Risk) Assets not at direct risk, but function/availability of the protocol could be impacted or leak value and removed 3 (High Risk) Assets can be stolen/lost/compromised directly labels May 20, 2022
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 duplicate This issue or pull request already exists sponsor confirmed Sponsor agrees this is a problem and intends to fix it (OK to use w/ "disagree with severity")
Projects
None yet
Development

No branches or pull requests

3 participants