code-423n4 / 2022-06-putty-findings

5 stars 0 forks source link

`fee` can change without the consent of users #422

Open code423n4 opened 2 years ago

code423n4 commented 2 years ago

Lines of code

https://github.com/code-423n4/2022-06-putty/blob/3b6b844bc39e897bd0bbb69897f2deff12dc3893/contracts/src/PuttyV2.sol#L240 https://github.com/code-423n4/2022-06-putty/blob/3b6b844bc39e897bd0bbb69897f2deff12dc3893/contracts/src/PuttyV2.sol#L497

Vulnerability details

Impact

Fees are applied during withdraw, but can change between the time the order is filled and its terms are agreed upon and the withdrawal time, leading to a loss of the expected funds for the concerned users.

Proof of Concept

The scenario would be:

Recommended Mitigation Steps

Mitigation could be:

outdoteth commented 2 years ago

Report: Admin can change fee at any time for existing orders

outdoteth commented 2 years ago

PR with fix: https://github.com/outdoteth/putty-v2/pull/4