# Signatures missing some parameters being vulnerable to attackers using them coupled with malicious parameters

Crestal's createAgentWithSigWithNFT signs only projectId/base64RecParam/serverURL, letting a bundler-mempool attacker swap unsigned tokenId or privateWorkerAddress to censor workers or force wrong-token payment.

- Payout: Audit contest
- Severity: medium
- Program: Crestal Network
- Found by: 0x73696d616f
- Disclosed: 2025-03-10
- Write-up quality: 6/10
- Original: https://github.com/sherlock-audit/2025-03-crestal-network-judging/issues/225
- Library page: https://bugbountylibrary.com/r/sherlock%3A2025-03-crestal-network%3AM-2
- Tags: area:web3 domain:web3 impact:dos impact:funds-loss kind:contest platform:sherlock sev:medium tech:evm technique:chained technique:source-review vuln:access-control vuln:signature-replay

**Target:** BlueprintCore.sol signature-gated agent creation functions (ERC4337/Biconomy userOps)
**Root cause:** createAgentWithSigWithNFT() and createAgentWithTokenWithSig() verify a signature over only projectId, base64RecParam, serverURL, leaving tokenAddress, tokenId and privateWorkerAddress unauthenticated.
**Steps:**
1. User submits signature for `createAgentWithSigWithNFT(projectId, base64RecParam, serverURL, ...)` to offchain protocol, forwarded to Biconomy bundler mempool as a userOp.
2. Attacker (or malicious bundler) reads the userOp from the ERC4337 mempool.
3. Attacker resubmits the same signature onchain with a different `tokenId` or `privateWorkerAddress` (or a costlier `tokenAddress` for `createAgentWithTokenWithSig`).
4. Signature still validates since those fields are unsigned; agent is created with attacker-chosen params.
**How found:** Code review of signature verification: noticed the signed message hash omits tokenAddress/tokenId/privateWorkerAddress, then reasoned that Base's private mempool is bypassed because Biconomy's ERC4337 bundler mempool exposes userOps publicly.
**Exploitation:** Attacker monitors the Biconomy/ERC4337 bundler mempool, extracts a victim's signed userOp, and replays it on Base with substituted unsigned parameters: a malicious privateWorkerAddress to censor competing workers and capture deployment fees, an unintended tokenId, or a costlier tokenAddress to overcharge the victim.
**Insight:** When auditing signature-gated functions, diff the exact fields in the signed hash against every parameter that affects state or fund flow; ERC4337/bundler mempools make signed userOps publicly visible even on chains with private mempools, so any unsigned parameter is attacker-controllable.

