# Missing permission control in create_oracle and create_pool.

create_wooracle and create_pool lacked authority checks, letting anyone register oracles/pools and squat token pairs the admin later needs.

- Payout: Audit contest
- Severity: medium
- Program: Woofi Solana Deployment
- Found by: 0xeix
- Disclosed: 2024-08-26
- Write-up quality: 6/10
- Original: https://github.com/sherlock-audit/2024-08-woofi-solana-deployment-judging/issues/54
- Library page: https://bugbountylibrary.com/r/sherlock%3A2024-08-woofi-solana-deployment%3AM-2
- Tags: area:web3 domain:web3 impact:integrity kind:contest platform:sherlock sev:medium tech:solana technique:source-review vuln:access-control vuln:business-logic vuln:oracle-manipulation

**Target:** Solana Anchor program admin instructions (create_wooracle, create_pool)
**Root cause:** CreateWooracle only requires a generic Signer as admin and sets wooracle.authority to that signer instead of wooconfig.authority; CreatePool's has_one=authority check is therefore satisfiable by any attacker-created oracle.
**Steps:**
1. Read create_wooracle.rs: admin is `Signer<'info>` with no constraint tying it to wooconfig.authority.
2. Call create_wooracle with attacker keypair as admin and chosen token_mint/feed_account/price_update; PDA seeds derive from wooconfig, token_mint, feed_account, price_update.
3. Call create_pool with the same attacker keypair as authority and the attacker-created wooracle; has_one=authority passes.
4. Result: attacker-owned oracle+pool registered for a token pair before the real admin.
**How found:** Code review of admin instruction account structs against the README's stated admin-only function list; noticed admin is an unconstrained Signer and authority is copied from it.
**Exploitation:** Attacker pre-creates oracle and pool PDAs for a token pair (e.g. WETH-USDT) with attacker-controlled price/bounds; later admin cannot create the same PDAs, and attacker could trade against protocol pools at manipulated prices if Pyth comparison passes.
**Escalation:** Chaining oracle creation into pool creation to squat PDAs and potentially manipulate prices against USDT/USDC pools.
**Insight:** On Anchor programs, compare every admin instruction's Signer against the config authority via has_one/constraint; a bare `Signer<'info>` plus `init` with deterministic seeds lets anyone squat PDAs and become the stored authority.

