#46949 [SC-High] Top-up discount miscalculation allows minting excess pool tokens via repeated small deposits in `CollateralPool::enter`
Description
Brief/Intro
Vulnerability Details
function _collateralToTokenShare(AssetData memory _assetData, uint256 _collateral)
internal view returns (uint256)
{
uint256 natRequiredToTopup = …
uint256 collateralForTopupPricing = Math.min(_collateral, natRequiredToTopup);
uint256 collateralAtTopupPrice = collateralForTopupPricing.mulDiv(
SafePct.MAX_BIPS, topupTokenPriceFactorBIPS);
uint256 tokenShareAtTopupPrice = poolConsideredEmpty
? collateralAtTopupPrice
: _assetData.poolTokenSupply.mulDiv(collateralAtTopupPrice, _assetData.poolNatBalance);
uint256 tokenShareAtStandardPrice = …
return tokenShareAtTopupPrice + tokenShareAtStandardPrice;
}Impact Details
References
Proof of Concept
Previous#46943 [SC-Medium] Agents can prevent user CoreVault redemptions by sandwiching them with a requestReturnFromCoreVault and a cancelReturnFromCoreVaultNext#46953 [SC-High] agents who create agents with prior transactions can be instantly unfairly liquidated
Was this helpful?