<!-- canonical: https://0xsimao.com/findings/nerite-initialization-frontrun-mint-approve -->

# `BoldToken` initialization can be frontrun to silently mint/approve bold to an attacker

Medium · Sherlock · CDP stablecoin · 3rd February, 2025

Finding M-1 of the Nerite security review.

- Protocol: https://www.nerite.org/
- Report: /reports/nerite
- Source: https://drive.google.com/file/d/1knlIgoEGv5x33n9mhTLRqJe8T55r3HCy/view

---

## Summary

`BoldToken::initialize()` is frontrunnable.

## Vulnerability Detail

`BoldToken::initialize()` is called seperately after the constructor, which means that if sent in different txs (depending on deployment scripts, it may be possible to mitigate if sent via a multicall), an attacker can frontrun the deployment, initialize the `BoldToken` to a malicious implementation, mint/approve `Bold` to their address and then set the implementation to `address(0)` so the script does not revert and the `BoldToken::initialize()` call succeeds.

## Impact

Attackers mints/gets `Bold` for free.

## Code Snippet

https://github.com/sherlock-audit/2025-02-nerite/blob/main/nerite/contracts/src/BoldToken.sol#L59-L72
https://github.com/superfluid-finance/protocol-monorepo/blob/1edc4ed3ddafa87d42c1155e870532e2a5a80470/packages/ethereum-contracts/contracts/upgradability/UUPSProxy.sol#L25-L29

## Tool Used

Manual Review

## Recommendation

Use a multicall to deploy or move the `BoldToken::initialize()` logic to the constructor.

---

Related findings:

- [Malicious user may frontrun `GoodDollarExpansionController::mintUBIFromReserveBalance()` to make protocol funds stuck](https://0xsimao.com/findings/mento-frontrun-mint-ubi-stuck): Mento
- [SuperToken._skipSelfMint silently skips minting, breaking custom SuperToken implementations](https://0xsimao.com/findings/superfluid-super-mint-skips-implementations): Superfluid Yield Backends
- [DoSed liquidations as `PrizeVault::liquidatableBalanceOf()` does not take into account the `mintLimit` when the token out is the asset](https://0xsimao.com/findings/pooltogether-the-prize-layer-for-defi-liquidations-prize-liquidatable-mint): PoolTogether Prize Layer
