Submitted by 0xLogos
https://github.com/code-423n4/2024-04-panoptic/blob/833312ebd600665b577fbd9c03ffa0daf250ed24/contracts/CollateralTracker.sol#L478
https://github.com/code-423n4/2024-04-panoptic/blob/833312ebd600665b577fbd9c03ffa0daf250ed24/contracts/CollateralTracker.sol#L461-L467
Malicious actors can mint huge amounts of shares for free and then withdraw all collateral.
In the mint function user-controlled shares parameter goes right away to the previewMint function which then calculates required assets in unchecked block. If the shares value is high enough, overflow in shares * DECIMALS will occur, and assets will be very low.
Insert the following snippet to ColalteralTracker.t.sol for coded PoC:
Remove unchecked block.
Under/Overflow
dyedm1 (Panoptic) confirmed
