# KYCRegistry is susceptible to signature replay attack.

KYCRegistry.addKYCAddressViaSignature lacks a nonce, so a revoked user can replay their original signed approval to regain KYC status before the deadline.

- Payout: Contest reward
- Severity: medium
- Program: Ondo Finance
- Credited: AkshaySrivastav
- Disclosed: 2023-02-28
- Write-up quality: 6/10
- Original: https://github.com/code-423n4/2023-01-ondo-findings/issues/187
- Library page: https://bugbountylibrary.com/r/c4%3A2023-01-ondo%3AM-04
- Tags: domain:web3 impact:integrity kind:contest platform:code4rena sev:medium tech:evm tech:solidity technique:source-review vuln:access-control vuln:signature-replay

**Target:** KYCRegistry smart contract (addKYCAddressViaSignature)
**Root cause:** Signature validation only checks deadline and current kycState; no nonce or used-signature tracking, so a signature remains valid after revocation until deadline.
**Steps:**
1. Deploy KYCRegistry, assign kycGroupRole to kycAgent via assignRoletoKYCGroup and grantRole
2. kycAgent signs EIP-712 KYCApproval{kycRequirementGroup, user, deadline} for attacker with deadline = now + 1 day
3. Attacker calls `addKYCAddressViaSignature(kycGroup, attacker, deadline, v, r, s)` to gain KYC
4. kycAgent calls `removeKYCAddresses(kycGroup, [attacker])` to revoke
5. Attacker resubmits the same `addKYCAddressViaSignature(...)` call with identical v,r,s; kycState becomes true again
**How found:** Code review of addKYCAddressViaSignature: noticed the require checks only deadline and current kycState, with no nonce or consumed-signature mapping, implying a signature stays valid across revocation.
**Exploitation:** A user whose KYC was revoked before the signature deadline resubmits the original signed approval to the contract, restoring their KYC status and regaining access to Ondo protocol until the deadline expires.
**Insight:** For signature-gated allowlists, check whether revocation actually invalidates outstanding signatures: if validation only checks a deadline and current state, a revoked user can replay the original signature until expiry. Look for missing nonce/used-hash tracking in any addViaSignature function.
