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

Return Values Ignored #47

Closed
code423n4 opened this issue Mar 19, 2022 · 2 comments
Closed

Return Values Ignored #47

code423n4 opened this issue Mar 19, 2022 · 2 comments
Labels
bug Something isn't working duplicate This issue or pull request already exists QA (Quality Assurance) Assets are not at risk. State handling, function incorrect as to spec, issues with clarity, syntax sponsor disputed Sponsor cannot duplicate the issue, or otherwise disagrees this is an issue

Comments

@code423n4
Copy link
Contributor

Lines of code

https://github.com/code-423n4/2022-03-prepo/blob/f63584133a0329781609e3f14c3004c1ca293e71/contracts/core/PrePOMarket.sol#L121
https://github.com/code-423n4/2022-03-prepo/blob/f63584133a0329781609e3f14c3004c1ca293e71/contracts/core/PrePOMarket.sol#L123
https://github.com/code-423n4/2022-03-prepo/blob/f63584133a0329781609e3f14c3004c1ca293e71/contracts/core/PrePOMarket.sol#L168
https://github.com/code-423n4/2022-03-prepo/blob/f63584133a0329781609e3f14c3004c1ca293e71/contracts/core/PrePOMarket.sol#L170

Vulnerability details

Proof of Concept

PrePOMarket.mintLongShortTokens(uint256) (contracts/core/PrePOMarket.sol#101-128) ignores return value by _collateral.transferFrom(msg.sender,_treasury,_fee) (contracts/core/PrePOMarket.sol#121)
PrePOMarket.mintLongShortTokens(uint256) (contracts/core/PrePOMarket.sol#101-128) ignores return value by _collateral.transferFrom(msg.sender,address(this),_amount) (contracts/core/PrePOMarket.sol#123)
PrePOMarket.redeem(uint256,uint256) (contracts/core/PrePOMarket.sol#130-173) ignores return value by _collateral.transfer(_treasury,_fee) (contracts/core/PrePOMarket.sol#168)
PrePOMarket.redeem(uint256,uint256) (contracts/core/PrePOMarket.sol#130-173) ignores return value by _collateral.transfer(msg.sender,_collateralOwed) (contracts/core/PrePOMarket.sol#170)
Reference: https://github.com/crytic/slither/wiki/Detector-Documentation#unchecked-transfer

Tools Used

slither

Recommended Mitigation Steps

validate return values

@code423n4 code423n4 added 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 labels Mar 19, 2022
code423n4 added a commit that referenced this issue Mar 19, 2022
@ramenforbreakfast
Copy link
Collaborator

duplicate of #4 and not valid because Collateral contract inherits from OZ ERC20 which safely reverts upon failed operations.

@ramenforbreakfast ramenforbreakfast added the duplicate This issue or pull request already exists label Mar 22, 2022
@CloudEllie CloudEllie added the sponsor disputed Sponsor cannot duplicate the issue, or otherwise disagrees this is an issue label Mar 23, 2022
@gzeoneth
Copy link
Member

gzeoneth commented Apr 3, 2022

Agree with sponsor, downgrading to Low/QA. Dup #34. Closing in favor of warden's QA report #21

@gzeoneth gzeoneth closed this as completed Apr 3, 2022
@gzeoneth gzeoneth added QA (Quality Assurance) Assets are not at risk. State handling, function incorrect as to spec, issues with clarity, syntax and removed 2 (Med Risk) Assets not at direct risk, but function/availability of the protocol could be impacted or leak value labels Apr 3, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working duplicate This issue or pull request already exists QA (Quality Assurance) Assets are not at risk. State handling, function incorrect as to spec, issues with clarity, syntax sponsor disputed Sponsor cannot duplicate the issue, or otherwise disagrees this is an issue
Projects
None yet
Development

No branches or pull requests

4 participants