#45674 [SC-Insight] `executeMinting()` allows impersonation of minter during chain-reorg due to deterministic `crtId` and lack of minter binding
Description
Description
function reserveCollateral(
address _minter,
address _agentVault,
uint64 _lots,
uint64 _maxMintingFeeBIPS,
address payable _executor,
string[] calldata _minterUnderlyingAddresses
)
internal
{
Agent.State storage agent = Agent.get(_agentVault);
Agents.requireWhitelistedAgentVaultOwner(agent);
Collateral.CombinedData memory collateralData = AgentCollateral.combinedData(agent);
AssetManagerState.State storage state = AssetManagerState.get();
...............
require(msg.value >= reservationFee, "inappropriate fee amount");
// create new crt id - pre-increment, so that id can never be 0
@>> state.newCrtId += PaymentReference.randomizedIdSkip();
uint64 crtId = state.newCrtId;
// create in-memory cr and then put it to storage to not go out-of-stack
CollateralReservation.Data memory cr;
cr.valueAMG = valueAMG;
cr.underlyingFeeUBA = Conversion.convertAmgToUBA(valueAMG).mulBips(agent.feeBIPS).toUint128();
cr.reservationFeeNatWei = reservationFee.toUint128();
// 1 is added for backward compatibility where 0 means "value not stored" - it is subtracted when used
cr.poolFeeShareBIPS = agent.poolFeeShareBIPS + 1;
cr.agentVault = _agentVault;
cr.minter = _minter;
cr.executor = _executor;
cr.executorFeeNatGWei = ((msg.value - reservationFee) / Conversion.GWEI).toUint64();
........
}Impact
Recommendation
References
Proof of Concept
Proof of Concept
Previous#45665 [SC-Medium] [H-02] Minting Cap Bypass via Pool Fee Exclusion during Self MintNext#45604 [SC-Low] User Overpayment in `transferToCoreVault` Fee Handling
Was this helpful?