Submitted by oakcobalt, also found by 0x1982us, Abdessamed, and Lambda
/contracts/pool-manager/src/helpers.rs#L563-L564
create_pool is permissionless. User will need to pay both pool creation fee and token factory fee (fees charged for creating lp token) when creating a pool.
The vulnerabilities are:
/contracts/pool-manager/src/helpers.rs#L577
Based on cosmwasm tokenfactory, denom creation fee (std.coins) can contain multiple coins and every coin needs to be paid.
https://github.com/CosmWasm/token-factory/blob/47dc2d5ae36980bcc03cf746580f7cb3deabc39e/x/tokenfactory/simulation/operations.go#L359-L361
Flows: contracts/pool-manager/src/manager/commands::create_pool -> validate_fees_are_paid()
User can either underpay fees, or create_pool tx will revert.
Because pool creation fee and all denom creation fee tokens need to be paid. Consider this edge case:
A. There are more than one token factory fee tokens required in denom_creation_fee.
B. One of the denomcreation fee token is the pool creation fee token (`fee.denom == poolcreation_fee.denom`).
In this case, user is required to send = pool token amount (pool_creation_fee + denom_creation_fee) and all other denom creation token amount.
If user sends all the required fees, paid_pool_fee_amount == pool_creation_fee.amount check will fail because paid_pool_fee.amount > pool_creation_fee.amount. This reverts create_pool.
If user chooses to take advantage of denom_creation_fee.iter().any, user sent = pool_creation_fee + one of denom creation token amounts (not the pool token). This passes both the strict equality check and .any. However, the user only paid pool_creation_fee and underpaid denom_creation_fee.
3docSec (judge) commented:
jvr0x (MANTRA) disputed and commented:
3docSec (judge) commented:
