You can deposit really small amount for other users to DoS them
The deposit and mint functions in the LiquidityPool contract lack access control, allowing anyone to call them for another user. An attacker can deposit a tiny amount (1 wei) for a victim, causing the victim's subsequent deposit to revert due to insufficient balance, effectively denying their deposit.
Submitted by 0x3b, also found by jaraxxus and twicek
Deposit and mint under LiquidityPool lack access control, which enables any user to proceed the mint/deposit for another user. Attacker can deposit (this does not require tokens) some wai before users TX to DoS the deposit.
Proof of Concept
deposit and mint do processDeposit/processMint which are the secondary functions to the requests. These function do not take any value in the form of tokens, but only send shares to the receivers. This means they can be called for free.
With this an attacker who wants to DoS a user, can wait him to make the request to deposit and on the next epoch front run him by calling deposit with something small like 1 wei. Afterwards when the user calls deposit, his TX will inevitable revert, as he will not have enough balance for the full deposit.
Recommended Mitigation Steps
Have some access control modifiers like withApproval used also in redeem.
- function deposit(uint256 assets, address receiver) public returns (uint256 shares) {
+ function deposit(uint256 assets, address receiver) public returns (uint256 shares) withApproval(receiver) {
shares = investmentManager.processDeposit(receiver, assets);
emit Deposit(address(this), receiver, assets, shares);
}
- function mint(uint256 shares, address receiver) public returns (uint256 assets) {
+ function mint(uint256 shares, address receiver) public returns (uint256 assets) withApproval(receiver) {
assets = investmentManager.processMint(receiver, shares);
emit Deposit(address(this), receiver, assets, shares);
}
Assessed type
Access Control
hieronx (Centrifuge) confirmed and commented:
Mitigated in https://github.com/centrifuge/liquidity-pools/pull/136
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
How it worked
Impact
An attacker can cause a victim's deposit to fail, denying their deposit.
What the attacker needed
Attacker can call deposit for any user; victim has made a deposit request; attacker front-runs victim's deposit
How it was found
- Victim makes a request to deposit.
- Attacker waits for the next epoch and front-runs the victim by calling deposit with a small amount (e.g., 1 wei) for the victim.
- When the victim calls deposit, their transaction reverts because they do not have enough balance for the full deposit.
Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
In a smart contract, some functions are meant to be called only by the user themselves. Here, the deposit and mint functions could be called by anyone on behalf of any user. An attacker can call deposit with a very small amount for the victim, which changes the victim's balance and makes their own deposit fail because they don't have enough funds to cover the full amount.
What is Access control?
A user can do something their role should not allow: reach an admin function, act on a feature they have not paid for, or skip a permission check. IDOR is the special case where the object belongs to someone else.