# Vault.mintWithPermit() can be DoS'd 

Vault.mintWithPermit signs an exact asset amount derived from shares, so exchange-rate changes or front-running invalidate the permit and revert the mint, DoSing it.

- Payout: Contest reward
- Severity: medium
- Program: PoolTogether
- Credited: KupiaSec
- Disclosed: 2023-09-27
- Write-up quality: 6/10
- Original: https://github.com/code-423n4/2023-07-pooltogether-findings/issues/384
- Library page: https://bugbountylibrary.com/r/c4%3A2023-07-pooltogether%3AM-11
- Tags: domain:web3 impact:dos kind:contest platform:code4rena sev:medium tech:evm tech:solidity technique:source-review vuln:dos vuln:signature-replay

**Target:** Vault.sol mintWithPermit / ERC20 permit deposit flow
**Root cause:** mintWithPermit computes _assets from _shares via _convertToAssets using the current exchange rate, then passes that exact _assets into the permit signature; any rate change between signing and execution makes the permit value mismatch and revert.
**Steps:**
1. User computes _assets = _convertToAssets(_shares, Rounding.Up) off-chain and signs permit(msg.sender, address(this), _assets, _deadline, v, r, s)
2. Submit `mintWithPermit(_shares, _receiver, _deadline, v, r, s)`
3. _beforeMint recomputes _assets from _shares using _currentExchangeRate()
4. If exchange rate changed (or adversary front-runs to move it), recomputed _assets != signed _assets
5. _permit reverts on signature mismatch, so mintWithPermit reverts
**How found:** Code reading: noticed mintWithPermit derives the permit-signed asset amount from a live exchange-rate conversion rather than a user-supplied bound, making the signed value state-dependent.
**Exploitation:** Adversary front-runs the mintWithPermit transaction to shift the vault exchange rate so the recomputed asset amount differs from the signed value, causing the permit signature check to fail and the victim's mint to revert.
**Insight:** When a permit signature covers a value derived from on-chain state (exchange rate, oracle, balance), the signed value is not stable across blocks; look for permit/approval flows where the signed amount is computed rather than bounded by the user.
