Price can be easily inflated/deflated by large depositors in the Market
contract
#467
Labels
3 (High Risk)
Assets can be stolen/lost/compromised directly
bug
Something isn't working
primary issue
Highest quality submission among a set of duplicates
sponsor disputed
Sponsor cannot duplicate the issue, or otherwise disagrees this is an issue
sufficient quality report
This report is of sufficient quality
unsatisfactory
does not satisfy C4 submission criteria; not eligible for awards
Lines of code
https://github.com/code-423n4/2023-11-canto/blob/335930cd53cf9a137504a57f1215be52c6d67cb3/1155tech-contracts/src/Market.sol#L150
https://github.com/code-423n4/2023-11-canto/blob/335930cd53cf9a137504a57f1215be52c6d67cb3/1155tech-contracts/src/bonding_curve/LinearBondingCurve.sol#L21-L22
Vulnerability details
Impact
An attacker can manipulate/inflate market prices by donating/buying large amounts of tokens which can negatively impact subsequent transactions.
For example, an attacker who executes a large buy order can significantly increase the price of shares, causing other participants to pay an inflated price for the same shares. This will have greater effect especially if the attacker is an early buyer.
This will cause loss of trust in the protocol and potential loss of funds for subsequent users.
Proof of Concept
The problem arises due to the linear increases in share prices based on the token supply for each share in the
Market
contract.After buying, the token count increases :
Which in turn increase price and fee for the subsequent buys :
POC
This attack can be demonstrated as follows. To execute the test : forge test --mt testDonationAttack -vv
Tools Used
Manual review + foundry
Recommended Mitigation Steps
Consider the following changes
Assessed type
Other
The text was updated successfully, but these errors were encountered: