Sample audits · Open-source projects and documentation, eight more

solana-foundation/program-examples

Example Solana programs that developers copy as starting points.

Summary card for this audit: 154 findings after review, 2 High, 23 Medium, 124 Low, 5 Info
Auditedsolana-foundation/program-examples at commit de090195e4de698e150572c4f886c333323a64a5
Date11 October 2026 (audited again; first audit 11 October 2026)
How it ranlocal run on our workstation, full audit, Standard review
Verdict after reviewFail (Fail if a High finding remains after review, otherwise Pass with notes)
2
High after review
23
Medium after review
124
Low after review
5
Info after review
1
excluded on review

Compared with the first audit

Same commit as the first audit: the project's default branch has no later commits (checked 11 October 2026), so nothing could have been fixed upstream in between. Each finding of the first audit (11 October 2026) was checked again against the code audited now. 54 findings in the first audit; 54 still open (37 found again, 17 not reported again but still present). This audit has 154 findings after review, 109 of them new.

First auditFindingReviewed rating thenNowIn this audit
#1Escrow (native): taker redirects offer rent to unchecked payerLowStill open#132
#2Escrow (Pinocchio): same rent redirectionLowStill open#133
#3chop_tree accepts any mintLowStill open#126
#4ABL transfer hook trusts caller accountsLowStill opennot reported again
#5Block-list hook (Pinocchio) skips owner/length checksLowStill opennot reported again
#6Wallet bridge returns partly signed txLowStill open#7
#7@solana/kit pinned to latestLowStill opennot reported again
#8Wallet connect lacks insecure-origin checkLowStill open#3, #4
#9Realloc (Pinocchio): any caller overwrites/resizes any recordMediumStill open#11, #93
#10Realloc (native): overwrite plus type confusionMediumStill open#12, #91, #92
#11sleep() test helper never waitsLowStill opennot reported again
#12Settlement operator polls getProgramAccounts in a loopLowStill open#21
#13Failed settlement retried with no backoffLowStill open#76
#14Pull account layout hand-copied into scriptsLowStill open#48
#15Token-2022 extension parser lacks bounds checksLowStill opennot reported again
#16world-cup dev API is one 777-line fileLowStill open#46
#17"Create mock USDC" not guarded against concurrencyLowStill open#42
#18"Start validator" reports success before startLowStill opennot reported again
#19RPC_URL read but hard-coded endpoint usedLowStill open#51
#20Pull status values re-declaredLowStill opennot reported again
#21world-cup program address declared in three modulesLowStill open#72
#22Buy instruction layout hand-copied into validationLowStill opennot reported again
#23Postinstall scripts switch global CLI to mainnetLowStill open#143
#24saveKeypairToFile deletes existing key fileLowStill open#59
#25savePublicKeyToFile wipes addresses after swallowed errorLowStill opennot reported again
#26getInstructionData copied three timesLowStill opennot reported again
#27CI orchestration copied across four workflowsLowStill open#60
#28Per-example script copies driftInfoStill opennot reported again
#29PDA rent payer (native): anyone drains rent vaultMediumStill open#85
#30PDA rent payer (Pinocchio): same drainMediumStill open#86
#31cNFT vault: anyone withdraws NFTs to any addressHighStill open#83
#32Fundraiser: maker fakes reaching goal via vault top-upHighStill open#23
#33Fundraiser: minimum contribution always 1 base unitLowStill open#136
#34Fundraiser: vault token account never closedLowStill opennot reported again
#35Token swap: LP minted as sqrt(a*b), not pool shareMediumStill open#89
#36Token swap: one-sided donation makes deposit panicLowStill open#134
#37PDA mint authority (native): anyone can mintLowStill open#130
#38PDA mint authority (Pinocchio): sameLowStill open#129
#39NFT operations: collection verify ignores declared authorityMediumStill open#127
#40Transfer hook: advertised limit not enforcedLowStill opennot reported again
#41Transfer hook: counter never savedLowStill open#24, #25
#42DAS endpoint bundled into browser via NEXT_PUBLIC_*LowStill open#90
#43World cup: entry fees locked if admin never finalizesLowStill open#115
#44World cup: first init_config caller becomes adminLowStill open#116
#45World cup dev API: any web page can trigger actionsLowStill open#117
#46World cup dev API: malformed request crashes serverLowStill open#118
#47World cup dev API: save-config stores unvalidated dataLowStill open#117
#48Anchor.toml program IDs differ from declare_id!LowStill opennot reported again
#49is_token_2022_mint indexes before length checkInfoStill open#9
#50Pinocchio basics: short instruction data panicsInfoStill opennot reported again
#51expectRevert helper can never failLowStill opennot reported again
#52cicd.sh deploys stale binary after failed buildLowStill open#58
#53Maintainer script builds shell command from package namesLowStill open#97
#54PRs changing setup action skip buildsLowStill opennot reported again
How to read this page

Each finding keeps the number it has in the audit report. The rating shown first is the one after review; the first automated rating is listed with it. 94 findings were first rated Medium or High; 25 of them are Medium or High after review. Text marked "From the report" is quoted from the audit report; fixes are suggestions and were not tested. Code locations link to the file and line at the audited commit.

High after review (2)

23. High Fundraiser success and refunds decided from the raw vault balance
First rating: Medium · Reviewed rating: High · Review: confirmed, rated higher on review · also in the first audit (#32)
From the report
Evidence

Evidence: self.vault.amount >= self.fundraiser.amount_to_raise,

Why it matters

anyone can send tokens straight to the vault. That can flip a campaign to "target met" and block contributors' refunds, even though the recorded contributions fell short.

Suggested fix, not tested

compare the recorded current_amount with the target in both places.

Review: but understated: checker.rs:54 requires vault.amount >= target, then sweeps the whole vault.amount (:80) and closes the fundraiser; a top-up returns to the maker, so the maker can take contributors' funds; refund.rs:66 reads the same balance

83. High Vault releases compressed NFTs to any caller
First rating: High · Reviewed rating: High · Review: confirmed · also in the first audit (#31)
From the report
Evidence

Evidence: pub leaf_owner: UncheckedAccount<'info>, with seeds = [b"cNFT-vault"]. There is no signer, and new_leaf_owner is chosen by the caller.

Why it matters

anyone can withdraw any cNFT the vault holds to an address of their choice. withdraw_two_cnfts has the same gap.

Suggested fix, not tested

store an authority or the depositor and require it as a signer before the vault signs.

Medium after review (23)

1. Medium Token creation reports success before the transaction is confirmed
First rating: Medium · Reviewed rating: Medium · Review: confirmed · new in this audit
From the report
Evidence

Evidence: await rpc.sendTransaction(getBase64EncodedWireTransaction(signedTx), { encoding: 'base64' }).send(); followed by a success toast.

Why it matters

a dropped or failed transaction still shows "Token mint created" and returns the mint address. The next step (mint-to) can then run against a mint that does not exist.

Suggested fix, not tested

use the send-and-confirm helper that the app already uses elsewhere, and show success only after the transaction is confirmed without error.

15. Medium Paid pull cannot be completed after a page reload
First rating: Medium · Reviewed rating: Medium · Review: confirmed · new in this audit
From the report
Evidence

Evidence: setRetry({ buyer, pull, transaction });

Why it matters

the only way to retry lives in React memory. If the claim step fails and the page reloads, a settled but unminted pull has no button anywhere in the UI to finish it.

Suggested fix, not tested

let the UI call the permissionless claim for any settled pull, or run a server worker that mints settled pulls.

24. Medium Transfer counter is never saved (counter hook)
First rating: Medium · Reviewed rating: Medium · Review: location checked, kept as rated · also in the first audit (#41)
From the report
Evidence

Evidence: let count = ctx.accounts.counter_account.counter.checked_add(1)… on an account that is not declared mutable.

Why it matters

the hook's whole purpose does not work. The stored count stays 0.

Suggested fix, not tested

mark the account mutable and write the new count back.

25. Medium Per-owner transfer counter is never saved
First rating: Medium · Reviewed rating: Medium · Review: confirmed · also in the first audit (#41)
From the report
Evidence

Evidence: same pattern as finding 24.

Why it matters

the per-owner count never changes.

Suggested fix, not tested

same as finding 24.

26. Medium Transfer-cost counter is not saved and is too small
First rating: Medium · Reviewed rating: Medium · Review: confirmed · also in the first audit (#41)
From the report
Evidence

Evidence: ctx.accounts.counter_account.counter += 1; where the counter is a u8 on an account that is not mutable.

Why it matters

the update is lost. Once persistence is fixed, the 256th transfer would overflow and block every later transfer of the mint.

Suggested fix, not tested

make the account mutable, widen the counter to u64, and use checked_add.

27. Medium Requested mint authority is silently ignored
First rating: Medium · Reviewed rating: Medium · Review: confirmed · new in this audit
From the report
Evidence

Evidence: pub mint_authority: Pubkey, is never read, and mint::authority = payer.key() is used instead.

Why it matters

a user who enters another authority in the form gets a mint controlled by the payer, with no error.

Suggested fix, not tested

apply the argument, or remove it from the arguments, the IDL and the UI.

Review: ` at :26)

35. Medium Duplicated NFT lookup has drifted; the session chop never finds the NFT
First rating: Medium · Reviewed rating: Medium · Review: confirmed · new in this audit
From the report
Evidence

Evidence: if (nftData.authorities[0] === nftAuthority), while the other handler normalises authority.address.

Why it matters

with spec-following DAS providers, "Chop tree Session" always reports that no NFT exists.

Suggested fix, not tested

write one lookup helper that normalises the authority, and use it in both handlers.

84. Medium Rent vault can be drained by anyone (Anchor)
First rating: High · Reviewed rating: Medium · Review: rated too high · also in the first audit (#29)
From the report
Evidence

Evidence: from: ctx.accounts.rent_vault.to_account_info(),, where the only signer is a fresh new_account.

Why it matters

an attacker can loop over fresh keypairs and move the whole vault balance to accounts they control.

Suggested fix, not tested

require an authorised signer, and cap payouts per caller and in total.

85. Medium Rent vault can be drained by anyone (native)
First rating: High · Reviewed rating: Medium · Review: rated too high · also in the first audit (#29)
From the report
Evidence

Evidence: **rent_vault.lamports.borrow_mut() -= lamports_required_for_rent;

Why it matters

any writable account passed in receives lamports on every call.

Suggested fix, not tested

require an authorised signer and a fresh, system-owned recipient.

86. Medium Rent vault can be drained by anyone (Pinocchio)
First rating: High · Reviewed rating: Medium · Review: rated too high · also in the first audit (#30)
From the report
Evidence

Evidence: rent_vault.set_lamports(rent_vault.lamports() - lamports_required_for_rent);

Why it matters

same drain as findings 84 and 85. The bump is also taken from instruction data.

Suggested fix, not tested

add an authority check, and derive the canonical bump on chain.

87. Medium Anyone can overwrite any message account and take its rent
First rating: High · Reviewed rating: Medium · Review: rated too high · also in the first audit (#9, #10)
From the report
Evidence

Evidence: realloc::payer = payer,, while update writes message = input with no owner check.

Why it matters

any signer can replace another user's message. Shrinking it refunds the freed rent to the attacker.

Suggested fix, not tested

store an owner in the account and require it with has_one.

88. Medium A wallet can make itself impossible to block
First rating: High · Reviewed rating: Medium · Review: rated too high · new in this audit
From the report
Evidence

Evidence: pinocchio_system::instructions::CreateAccount { from: self.authority, to: self.wallet_block,

Why it matters

the block record's address is predictable, and account creation fails if the address already holds lamports. A wallet that expects to be blocked sends one lamport there first, and the block list can never be enforced against it.

Suggested fix, not tested

when the target already has lamports, top it up, then allocate and assign it.

89. Medium Liquidity deposits over-mint shares and dilute earlier providers
First rating: High · Reviewed rating: Medium · Review: rated too high · also in the first audit (#35)
From the report
Evidence

Evidence: let mut liquidity = (amount_a as u128).checked_mul(amount_b as u128).unwrap().isqrt() as u64;

Why it matters

once swap fees have grown the reserves, a new depositor receives more shares than their deposit is worth. A deposit followed by an immediate withdrawal extracts value from earlier providers.

Suggested fix, not tested

after the first deposit, mint min(a × supply / reserve_a, b × supply / reserve_b).

91. Medium Any caller can resize and overwrite another account (native realloc)
First rating: Medium · Reviewed rating: Medium · Review: confirmed · also in the first audit (#10)
From the report
Evidence

Evidence: pub fn reallocate_zero_init(…) { … target_account.resize(account_span)?;

Why it matters

there is no owner or signer check, so any program-owned record can be rewritten.

Suggested fix, not tested

store an authority and require its signature.

94. Medium Assembly example creates accounts with a garbage owner
First rating: Medium · Reviewed rating: Medium · Review: confirmed · new in this audit
From the report
Evidence

Evidence: .equ PROGRAM_ID, 0x7938

Why it matters

offset 0x7938 is the instruction-data length field (the sibling transfer example names it that way), not a program id. The owner written into the new account is 8 zero bytes plus part of the program id. The test passes only because its program id is almost all zeros.

Suggested fix, not tested

copy the system program key (or the intended owner) from a computed offset, and test with a realistic id.

99. Medium Closing an account leaves rent stranded (native)
First rating: Medium · Reviewed rating: Medium · Review: confirmed · new in this audit
From the report
Evidence

Evidence: let diff = target_account.lamports() - lamports_required;, where the requirement is the zero-size minimum.

Why it matters

about 890,000 lamports stay in an address nobody can sign for. The user can never re-create the account, because the address still holds lamports.

Suggested fix, not tested

move the full balance to the payer.

100. Medium Closing an account leaves rent stranded (Pinocchio)
First rating: Medium · Reviewed rating: Medium · Review: confirmed · new in this audit
From the report
Evidence

Evidence: let diff = target_account.lamports() - lamports_required;

Why it matters

same as finding 99.

Suggested fix, not tested

same as finding 99.

108. Medium cNFT burn test helpers import a constant that is not exported
First rating: Medium · Reviewed rating: Medium · Review: confirmed · new in this audit
From the report
Evidence

Evidence: const _RPC_PATH = '…';, while three files import { RPC_PATH } from './cnft-burn'.

Why it matters

the connection URL is undefined, so the example's test flow cannot run.

Suggested fix, not tested

export the constant from a small config module.

113. Medium Pull address derived from a stale shared counter
First rating: Medium · Reviewed rating: Medium · Review: confirmed · new in this audit
From the report
Evidence

Evidence: const index = pool.pool.pullsCount;, which comes from a cache refreshed every 15 seconds.

Why it matters

any other buy in that window makes this one fail, so concurrent buyers collide.

Suggested fix, not tested

re-read the pool at signing time, or key pulls on a value the buyer controls.

125. Medium Transfers fail for every holder except the initialiser
First rating: Medium · Reviewed rating: Medium · Review: confirmed · new in this audit
From the report
Evidence

Evidence: init, seeds = [b"counter", payer.key()…], while the hook resolves [b"counter", owner.key()].

Why it matters

other owners' counter accounts never exist, so their transfers fail.

Suggested fix, not tested

create per-owner counters lazily.

127. Medium Anyone can verify any NFT into the collection (Anchor)
First rating: Medium · Reviewed rating: Medium · Review: confirmed · also in the first audit (#39)
From the report
Evidence

Evidence: pub authority: Signer<'info>, is never used, and the PDA signs instead.

Why it matters

counterfeit NFTs can be marked as verified members of the collection.

Suggested fix, not tested

require a stored collection admin, or proof that the program issued the NFT.

128. Medium Anyone can verify any NFT into the collection (Pinocchio)
First rating: Medium · Reviewed rating: Medium · Review: confirmed · new in this audit
From the report
Evidence

Evidence: if !payer.is_signer() { return Err(…) }

Why it matters

same as finding 127.

Suggested fix, not tested

same as finding 127.

151. Medium Manage Token form does not navigate
First rating: Medium · Reviewed rating: Medium · Review: confirmed · new in this audit
From the report
Evidence

Evidence: redirect(/manage-token/${tokenAddress.toString()}); inside a submit handler.

Why it matters

redirect() is not valid in event handlers, so the form throws instead of navigating.

Suggested fix, not tested

use router.push.

Low after review (124)

2. Low Relayed buy transaction signature is not verified by the server
First rating: Low · Reviewed rating: Low · Review: confirmed · new in this audit
From the report
Evidence

Evidence: if (!walletSignature || walletSignature.every(byte => byte === 0)) {

Why it matters

the server only checks that the signature is non-zero. A signature that equals an already confirmed buy is trusted without checking that it matches the submitted message.

Suggested fix, not tested

verify the ed25519 signature over the message bytes against the buyer key before any lookups.

3. Low No secure-origin check before wallet connect (gacha app)
First rating: Low · Reviewed rating: Low · Review: confirmed · also in the first audit (#8)
From the report
Evidence

Evidence: onClick={() => connect(wallet)}

Why it matters

on a plain-HTTP origin that is not localhost, browser wallets refuse to connect without any visible error.

Suggested fix, not tested

check window.isSecureContext before offering connect, and show "Wallets require HTTPS" when it is false.

4. Low No secure-origin check before wallet connect (world-cup app)
First rating: Low · Reviewed rating: Low · Review: confirmed · also in the first audit (#8)
Location: games/world-cup/pinocchio/webapp/src/components/solana/solana-provider.tsx:80 (line corrected on review; the report cites :78)
From the report
Evidence

Evidence: await connect(connectorId);

Why it matters

same silent failure as finding 3.

Suggested fix, not tested

same as finding 3.

6. Low Wallet connect promise is dropped
First rating: Low · Reviewed rating: Low · Review: confirmed · new in this audit
From the report
Evidence

Evidence: onClick={() => connect(wallet)}

Why it matters

a rejected or cancelled connect becomes an unhandled promise rejection, and the user is never told.

Suggested fix, not tested

await the connect in an async handler, catch errors, and show a message when the user cancels.

Review: => connect(wallet)}` with no catch; the world-cup variant wraps it)

7. Low Signed transaction rebuilt without checking required signatures
First rating: Low · Reviewed rating: Low · Review: confirmed · also in the first audit (#6)
From the report
Evidence

Evidence: Transaction.populate(Message.from(Buffer.from(signed.messageBytes))), after which empty signatures are skipped.

Why it matters

a transaction with a missing fee-payer signature is passed on as if it were fully signed.

Suggested fix, not tested

throw when the result is missing or the fee-payer signature is absent.

8. Low Two wallet stacks mixed with floating versions
First rating: Low · Reviewed rating: Low · Review: confirmed · new in this audit
From the report
Evidence

Evidence: "@solana/connector": "^0.2.6", "@solana/kit": "^7.0.0" alongside wallet-adapter-react.

Why it matters

caret ranges on two wallet stacks bridged together break silently when either stack is upgraded.

Suggested fix, not tested

pin exact versions, use one wallet stack, and test the bridge after each upgrade.

10. Low Token program identity not checked in escrow take and make
First rating: Low · Reviewed rating: Low · Review: confirmed · new in this audit
Location: tokens/escrow/native/program/src/instructions/take_offer.rs:152 (line corrected on review; the report cites :41)
From the report
Evidence

Evidence: invoke_signed(&token_instruction::transfer(token_program.key, vault.key, …

Why it matters

the program address that receives the vault's signature is supplied by the caller. The refund path does check it.

Suggested fix, not tested

check the program account against the Token and Token-2022 ids in take_offer and make_offer.

Review: line wrong, the invoke_signed is at 152

11. Low Two account record types share one layout with no type tag
First rating: Medium · Reviewed rating: Low · Review: rated too high · also in the first audit (#9)
From the report
Evidence

Evidence: target_account_data[25..37].copy_from_slice(instruction_data);

Why it matters

both record types are 25 bytes and untagged, so either instruction accepts the other's account and corrupts it. A wrong-length input also panics.

Suggested fix, not tested

start each record with a kind byte, check it before writing, and validate the input length.

12. Low Record type inferred from its shape only (native realloc)
First rating: Low · Reviewed rating: Low · Review: confirmed · also in the first audit (#10)
From the report
Evidence

Evidence: AddressInfo::try_from_slice(&target_account.data.borrow())?;

Why it matters

a crafted record of the other type can be parsed as this one.

Suggested fix, not tested

add a discriminator and check the owner before deserializing.

13. Low Dependency version updated in one section at a time
First rating: Low · Reviewed rating: Low · Review: confirmed · new in this audit
From the report
Evidence

Evidence: if (content.dependencies?.[pkgName] && … ) { … return [true, content];

Why it matters

when a package appears in both dependencies and devDependencies, one run leaves one copy stale.

Suggested fix, not tested

update both sections in a single pass.

14. Low Leaderboard drops the on-chain tiebreak
First rating: Medium · Reviewed rating: Low · Review: rated too high · new in this audit
From the report
Evidence

Evidence: return a.owner < b.owner ? -1 : a.owner > b.owner ? 1 : 0;

Why it matters

the program breaks ties by earliest entry, but the client breaks them by owner address. The board can show a different leader from the one who can claim the pot.

Suggested fix, not tested

carry the entry index into each leaderboard row and compare on it before the owner.

16. Low Fallback share image is cached as long as a real one
First rating: Medium · Reviewed rating: Low · Review: rated too high · new in this audit
From the report
Evidence

Evidence: return fallbackImage(fonts); with s-maxage=86400, stale-while-revalidate=604800.

Why it matters

an RPC hiccup, or a crawler arriving early, pins the generic card for a day or more. The cache key also leaves out the cluster.

Suggested fix, not tested

send no-store or a short TTL for fallback images, and include the cluster in the cache key.

17. Low config.json written by two writers with different record shapes
First rating: Low · Reviewed rating: Low · Review: location checked, kept as rated · new in this audit
From the report
Evidence

Evidence: const usdcToken = { symbol: 'USDC', mint, decimals: 6 };

Why it matters

the server and the scripts write the same file in different formats and drop each other's fields. Neither writer uses locking.

Suggested fix, not tested

give the file one owner module and a schema version, and write through temp-file-and-rename.

19. Low Pull status polled every 2 seconds with no backoff
First rating: Low · Reviewed rating: Low · Review: confirmed · new in this audit
From the report
Evidence

Evidence: … latestPull.status === PullStatus.Pending) ? 2_000 : 0

Why it matters

the hook polls forever, even when the account never appears.

Suggested fix, not tested

subscribe to account changes, and fall back to polling with capped exponential backoff.

20. Low Program-wide account scans every 15 seconds from every open tab
First rating: Low · Reviewed rating: Low · Review: confirmed · new in this audit
From the report
Evidence

Evidence: { refreshInterval: 15_000 } around getProgramAccounts.

Why it matters

public RPC nodes rate-limit or disable this call, so the app degrades as users grow.

Suggested fix, not tested

resolve the pool once and derive addresses instead of scanning.

21. Low Settlement crank rescans all pulls at a fixed interval with no backoff
First rating: Low · Reviewed rating: Low · Review: confirmed · also in the first audit (#12)
From the report
Evidence

Evidence: for (;;) { try { await crankOnce(…) } catch … await new Promise(r => setTimeout(r, POLL_MS));

Why it matters

every cycle scans all pulls, including finished ones, and keeps the same pace while the RPC is failing.

Suggested fix, not tested

track the last seen pull count, and back off on errors.

Review: with fixed POLL_MS`, default 5000)

22. Low Shared library global flag changed on every call
First rating: Low · Reviewed rating: Low · Review: confirmed · new in this audit
From the report
Evidence

Evidence: (featureFlags as { version: unknown }).version = VERSION.V2;

Why it matters

in a long-running server this switches every other user of that library in the process.

Suggested fix, not tested

set the version once at startup, or pass it explicitly.

28. Low Token view not refreshed after mode changes
First rating: Low · Reviewed rating: Low · Review: confirmed · new in this audit
From the report
Evidence

Evidence: onSuccess: signature => { transactionToast(signature); }

Why it matters

the page keeps showing the old mode for up to a minute, and the Apply button's state is computed from that stale value.

Suggested fix, not tested

invalidate the token query in each mutation's onSuccess.

Review: line is 173

29. Low Supply read from chain is overwritten with 0
First rating: Low · Reviewed rating: Low · Review: confirmed · new in this audit
From the report
Evidence

Evidence: supply: 0, // TODO

Why it matters

the real value is replaced by a placeholder, so the page always shows a supply of 0.

Suggested fix, not tested

carry the fetched value through, or remove the field.

30. Low Blocks do not apply to mints set up while the list was empty
First rating: Medium · Reviewed rating: Low · Review: rated too high · new in this audit
From the report
Evidence

Evidence: let data = if config.blocked_wallets_count == 0 { EXTRA_METAS_EMPTY_DEPENDENCIES }

Why it matters

a mint set up before any wallet was blocked never checks the block records. Later blocks have no effect on it until its own authority re-runs setup.

Suggested fix, not tested

always register the block-record accounts, and treat an empty record as "not blocked".

31. Low Caller-chosen seed can occupy the program's authority address
First rating: Medium · Reviewed rating: Low · Review: rated too high · new in this audit
From the report
Evidence

Evidence: seeds = [level_seed.as_ref()] sits beside seeds = [b"nft_authority".as_ref()].

Why it matters

initialising a level named nft_authority before the first mint places a game record at the authority address. That breaks minting and chopping for everyone.

Suggested fix, not tested

prefix the level seeds with a fixed namespace.

32. Low cNFT transfer call assembled three times
First rating: Low · Reviewed rating: Low · Review: confirmed · new in this audit
From the report
Evidence

Evidence: let mut account_infos1 = vec![ … ] and let mut account_infos2 = vec![ … ]

Why it matters

a fix to one copy will not reach the others.

Suggested fix, not tested

extract a single transfer helper.

33. Low Bubblegum program id typed out twice
First rating: Low · Reviewed rating: Low · Review: confirmed · new in this audit
From the report
Evidence

Evidence: Pubkey::new_from_array([0x98, 0x8b, …

Why it matters

the hand-typed copies can drift from each other.

Suggested fix, not tested

reuse the crate-level constant.

34. Low Public-key aggregation loop has no explicit cap
First rating: Low · Reviewed rating: Low · Review: confirmed · new in this audit
From the report
Evidence

Evidence: for i in 1..count { alt_bn128_group_op(…) }

Why it matters

the work is bounded only by the instruction size limit and the compute budget.

Suggested fix, not tested

add a maximum key count and reject larger inputs up front.

36. Low Send button has no in-flight guard
First rating: Low · Reviewed rating: Low · Review: confirmed · new in this audit
From the report
Evidence

Evidence: onClick={() => { const amount = window.prompt(…); … sendTokens.mutateAsync({

Why it matters

a repeated click can submit a second transfer.

Suggested fix, not tested

disable the button while the send is pending.

37. Low CSV wallet parser duplicated in two components
First rating: Low · Reviewed rating: Low · Review: confirmed · new in this audit
From the report
Evidence

Evidence: rows.filter(row => row.trim()).map(row => { const [address, mode] = row.split(',')…

Why it matters

the two copies will drift.

Suggested fix, not tested

use one shared parser.

38. Low Energy rules copied into client constants
First rating: Low · Reviewed rating: Low · Review: confirmed · new in this audit
From the report
Evidence

Evidence: export const TIME_TO_REFILL_ENERGY = 60n; export const MAX_ENERGY = 100n;

Why it matters

these silently diverge when the program's values change.

Suggested fix, not tested

read the values from chain, or generate them from the program with a parity test.

39. Low Merkle proof length is uncapped
First rating: Low · Reviewed rating: Low · Review: confirmed · new in this audit
From the report
Evidence

Evidence: for sibling in hashes.chunks_exact(32) {

Why it matters

the proof depth is bounded only by the transaction size.

Suggested fix, not tested

reject proofs deeper than the tree height.

Review: ` bounds the depth to the index)

40. Low Mock USDC reported created when its config write failed
First rating: Medium · Reviewed rating: Low · Review: rated too high · new in this audit
From the report
Evidence

Evidence: } catch (e) { log('warn', 'Failed to update config…') } … resolve(jsonResponse({ mint, alreadyExisted: false }));

Why it matters

the mint is never recorded, so the next call creates a second one.

Suggested fix, not tested

return an error, including the mint address, when the write fails.

41. Low Unreadable config replaced by empty defaults and written back
First rating: Medium · Reviewed rating: Low · Review: rated too high · new in this audit
From the report
Evidence

Evidence: log('warn', 'Failed to read config, using defaults' …); return { networks: {} };

Why it matters

a corrupt or half-written file, which concurrent writers can produce, is silently replaced. All saved program and token entries are lost.

Suggested fix, not tested

fail when the file is unreadable as opposed to missing, and write atomically.

42. Low Side-effecting dev-server requests have no in-flight guard
First rating: Low · Reviewed rating: Low · Review: confirmed · also in the first audit (#17)
From the report
Evidence

Evidence: const child = spawn('spl-token', [ 'create-token', …

Why it matters

concurrent calls create several mints and race on the config file.

Suggested fix, not tested

keep one in-flight promise per operation.

43. Low No single-flight per signed buy in the pull API
First rating: Low · Reviewed rating: Low · Review: confirmed · new in this audit
From the report
Evidence

Evidence: return NextResponse.json(await orchestratePull(client, config, buy));

Why it matters

a retry or replay runs the whole submit, settle and claim pipeline twice in parallel.

Suggested fix, not tested

key in-flight work by buy signature and return the existing promise.

45. Low Pull API client trusts the shape of error responses
First rating: Low · Reviewed rating: Low · Review: confirmed · new in this audit
Location: games/gacha/pinocchio/webapp/src/lib/pull-api.ts:46 (line corrected on review; the report cites :44)
From the report
Evidence

Evidence: throw new PullApiError(payload as PullFailure);

Why it matters

a gateway error page hides that the buy may already have been sent, so the UI offers no retry.

Suggested fix, not tested

validate the response shape and default to a retryable failure.

Review: ` at :44 also throws on HTML)

46. Low Dev API server mixes several responsibilities in one file
First rating: Low · Reviewed rating: Low · Review: confirmed · also in the first audit (#16)
From the report
Evidence

Evidence: about 780 lines covering validator processes, config persistence, airdrops and deploy routing.

Why it matters

the parts are hard to change or test independently.

Suggested fix, not tested

split it into modules and use a route table.

47. Low Burst script mixes statistics, funding, chain I/O and reporting
First rating: Low · Reviewed rating: Low · Review: confirmed · new in this audit
From the report
Evidence

Evidence: a 701-line file.

Why it matters

the statistics code cannot be tested without chain access.

Suggested fix, not tested

move the statistics and the reporting into separate modules.

48. Low Account layout constants copied into four files
First rating: Low · Reviewed rating: Low · Review: confirmed · also in the first audit (#14)
From the report
Evidence

Evidence: export const PULL_ACCOUNT_SIZE = 220n;

Why it matters

a change to the account layout silently breaks the filters that use these copies.

Suggested fix, not tested

export the constants once from the client package.

49. Low Byte-comparison helper defined six times
First rating: Low · Reviewed rating: Low · Review: confirmed · new in this audit
From the report
Evidence

Evidence: function bytesEqual(a: Uint8Array, b: Uint8Array): boolean {

Why it matters

maintenance drift across six copies.

Suggested fix, not tested

use one shared helper.

50. Low Two identical deploy-plan builders
First rating: Low · Reviewed rating: Low · Review: confirmed · new in this audit
From the report
Evidence

Evidence: buildUpgradePlan has the same body as buildDeployPlan.

Why it matters

a fix applied to one copy will not reach the other.

Suggested fix, not tested

keep one builder.

51. Low Network mapping and config migration duplicated
First rating: Low · Reviewed rating: Low · Review: location checked, kept as rated · also in the first audit (#19)
From the report
Evidence

Evidence: function networkFromRpcUrl(rpcUrl: string) also exists in two other files.

Why it matters

the copies already behave differently on a corrupt file. The RPC URL is also hard-coded seven times.

Suggested fix, not tested

use one shared module and one RPC helper.

Review: with a correction (networkFromRpcUrl is defined only in server.ts; the migration is duplicated in config-manager.ts:27-34; the localhost RPC literal appears 7 times)

52. Low Scoring weights copied into the client without a shared check
First rating: Low · Reviewed rating: Low · Review: confirmed · new in this audit
From the report
Evidence

Evidence: export const ROUND_WEIGHT … = [1, 2, 4, 8, 16, 8];

Why it matters

if the program changes, the UI shows wrong scores and no test fails.

Suggested fix, not tested

add a shared fixture that both the Rust and TypeScript test suites check.

53. Low Reveal and mint depend on the buyer's own request
First rating: Low · Reviewed rating: Low · Review: confirmed · new in this audit
Location: games/gacha/pinocchio/webapp/src/server/orchestrate-pull.ts:219 (line corrected on review; the report cites :221)
From the report
Evidence

Evidence: if (pull.status === PULL_STATUS_PENDING) { … settlePendingPull(…)

Why it matters

if that one request fails, the pull waits for a manual crank or a refund.

Suggested fix, not tested

queue pending pulls and run a durable settle worker.

54. Low Game CI workflows are never executed
First rating: Medium · Reviewed rating: Low · Review: rated too high · new in this audit
From the report
Evidence

Evidence: just setup / just check-generated / just build / just test

Why it matters

the game's lint, format, IDL and webapp build and test workflows sit in a nested .github folder, which GitHub never runs. The root workflows also exclude the game crates, so these checks never run.

Suggested fix, not tested

add those checks to the root workflow, or move the nested workflows to the root with path filters.

55. Low IDL generation failures are only warnings
First rating: Medium · Reviewed rating: Low · Review: rated too high · new in this audit
From the report
Evidence

Evidence: if let Err(e) = generate_idl() { println!("cargo:warning=…") }

Why it matters

the generated-code check passes with a stale committed IDL. Every build also rewrites the IDL, regardless of GENERATE_IDL.

Suggested fix, not tested

generate only when asked, and fail the build in that mode.

56. Low Documented local development commands do not exist
First rating: Medium · Reviewed rating: Low · Review: rated too high · new in this audit
From the report
Evidence

Evidence: just webapp-run is documented, but the justfile has no webapp-run, no webapp-clean and no surfnet-setup runbook.

Why it matters

the documented local flow, and the faucet, validator and deploy features that depend on it, cannot work.

Suggested fix, not tested

add the recipes and the runbook, or remove the references.

57. Low Test-environment setup wipes the saved token list
First rating: Medium · Reviewed rating: Low · Review: rated too high · new in this audit
From the report
Evidence

Evidence: await clearConfig(NETWORK);

Why it matters

the "idempotent" setup deletes the user's other saved tokens on every run.

Suggested fix, not tested

update only the entries the script owns, and write atomically.

Review: ` at :50 keeps the program address and clears tokens; dev script)

58. Low Deploy scripts continue after a failed build
First rating: Medium · Reviewed rating: Low · Review: rated too high · also in the first audit (#52)
From the report
Evidence

Evidence: cargo build-sbf … followed by solana program deploy ./program/target/so/program.so

Why it matters

a failed build deploys a stale binary to whatever cluster the CLI points at. The same script is copied into about 50 examples.

Suggested fix, not tested

add set -euo pipefail, print the target cluster, and verify the deployed program afterwards.

59. Low Key-saving helper deletes an existing key file
First rating: Medium · Reviewed rating: Low · Review: rated too high · also in the first audit (#24)
From the report
Evidence

Evidence: if (fs.existsSync(fileName)) fs.unlinkSync(fileName);

Why it matters

an existing secret key, and access to any funds it controls, is silently destroyed. The cnft-burn copy of this helper is also not git-ignored.

Suggested fix, not tested

refuse to overwrite without a flag, and write the file with owner-only permissions.

60. Low Four CI workflows carry copies of the same orchestration
First rating: Low · Reviewed rating: Low · Review: confirmed · also in the first audit (#27)
From the report
Evidence

Evidence: cat << 'EOF' > build_and_test.sh … function build_and_test() {

Why it matters

every fix has to be ported by hand to three other workflows.

Suggested fix, not tested

use one reusable workflow or composite action.

61. Low Anchor workflow failure step reads a file that may not exist
First rating: Low · Reviewed rating: Low · Review: confirmed · new in this audit
From the report
Evidence

Evidence: failed_projects=$(cat $GITHUB_WORKSPACE/failed_projects.txt | jq …)

Why it matters

the other three copies guard this read with an existence check. Here the reporting step can itself fail.

Suggested fix, not tested

share one guarded step.

62. Low Toolchain version gate does not re-check after reinstalling
First rating: Low · Reviewed rating: Low · Review: confirmed · new in this audit
From the report
Evidence

Evidence: sh -c "$(curl … install)" with no second version check.

Why it matters

a wrong toolchain can still pass the gate.

Suggested fix, not tested

re-read the version after reinstalling, and fail on a mismatch.

63. Low Installers piped to a shell without an integrity check
First rating: Low · Reviewed rating: Low · Review: confirmed · new in this audit
From the report
Evidence

Evidence: run: sh -c "$(curl -sSfL https://release.anza.xyz/…/install)"

Why it matters

the installer is trusted by its URL alone.

Suggested fix, not tested

download it, verify a pinned hash, then run it.

64. Low Generated-code check cannot see the ignored client output
First rating: Low · Reviewed rating: Low · Review: confirmed · new in this audit
From the report
Evidence

Evidence: git diff --quiet -- {{generated_paths}} covers paths that are git-ignored.

Why it matters

the check certifies only the IDL, not the generated clients.

Suggested fix, not tested

build and test the regenerated clients instead.

65. Low Prover binary and keys downloaded without verification
First rating: Low · Reviewed rating: Low · Review: confirmed · new in this audit
From the report
Evidence

Evidence: curl -sfL "{{proving_keys_cdn}}/$key" -o "$keys_dir/$key"

Why it matters

the CHECKSUM file is fetched but never compared, and a truncated download is treated as present on the next run.

Suggested fix, not tested

download to a temporary file, verify, then rename.

66. Low Background prover started and never stopped
First rating: Low · Reviewed rating: Low · Review: confirmed · new in this audit
Location: games/gacha/pinocchio/justfile:163 (line corrected on review; the report cites :161)
From the report
Evidence

Evidence: nohup "$prover_bin" start … --prover-address 0.0.0.0:3001

Why it matters

a stale prover of another version is silently reused, and the prover listens on all interfaces.

Suggested fix, not tested

record the PID, check the version, stop it on exit, and bind to 127.0.0.1.

67. Low Devnet deploy is not verified
First rating: Low · Reviewed rating: Low · Review: confirmed · new in this audit
From the report
Evidence

Evidence: solana program deploy target/deploy/gacha_program.so …

Why it matters

nothing confirms that the deployed bytes or the upgrade authority are the intended ones.

Suggested fix, not tested

dump the deployed program and compare its hash with the build, and check the authority.

68. Low Sample-card recipe reports success on failure
First rating: Low · Reviewed rating: Low · Review: confirmed · new in this audit
From the report
Evidence

Evidence: curl -sf … -o "$out" && break followed by echo "✓ Saved $out"

Why it matters

success is printed for a file that was never written.

Suggested fix, not tested

check the result and fail when the download did not succeed.

69. Low Settle-with-fallback sequence implemented three times
First rating: Low · Reviewed rating: Low · Review: confirmed · new in this audit
From the report
Evidence

Evidence: const candidates = context.outputQueue === context.authorityQueue ? …

Why it matters

each copy behaves differently, so a fix to one does not reach the others.

Suggested fix, not tested

move it into one function in the client package.

70. Low Registry authority layout duplicated
First rating: Low · Reviewed rating: Low · Review: confirmed · new in this audit
From the report
Evidence

Evidence: const vrfAuthorityFrozenOffset = 32 + 32 + 1;

Why it matters

a layout change will silently break one of the copies.

Suggested fix, not tested

reuse the decoder.

71. Low Program id hard-coded in the settlement crank
First rating: Low · Reviewed rating: Low · Review: confirmed · new in this audit
From the report
Evidence

Evidence: const GACHA_ID = 'Bv65…' as Address;

Why it matters

a redeploy under a new id updates the client package but not this copy.

Suggested fix, not tested

import the exported program address.

72. Low World-cup program id hard-coded in several places
First rating: Low · Reviewed rating: Low · Review: confirmed · also in the first audit (#21)
From the report
Evidence

Evidence: const PROGRAM_ADDRESS = 'wCup…';

Why it matters

a program id change has to be made by hand in each place.

Suggested fix, not tested

export the id once and import it everywhere.

73. Low Loader instruction builders duplicated and drifted
First rating: Low · Reviewed rating: Low · Review: confirmed · new in this audit
From the report
Evidence

Evidence: export const CHUNK_SIZE = 900;

Why it matters

the server and browser copies mark the authority account differently, and most of the browser copy is unused.

Suggested fix, not tested

keep one builder module.

74. Low Three address formatters and dead helpers
First rating: Low · Reviewed rating: Low · Review: confirmed · new in this audit
From the report
Evidence

Evidence: export function shortenAddress(addr: string)

Why it matters

the UI formats addresses inconsistently.

Suggested fix, not tested

keep one formatter and delete the dead code.

75. Low Deploy-plan hash computed but never checked
First rating: Low · Reviewed rating: Low · Review: confirmed · new in this audit
From the report
Evidence

Evidence: const soHash = crypto.createHash('sha256')…

Why it matters

the deploy path ships the buffer without confirming its integrity.

Suggested fix, not tested

read the buffer back and compare its hash and size before deploying.

76. Low Unsettleable pull retried and logged forever
First rating: Low · Reviewed rating: Low · Review: confirmed · also in the first audit (#13)
From the report
Evidence

Evidence: console.error( ✗ failed to settle ${pubkey}:, err);

Why it matters

each retry rebuilds an expensive proof, and the log fills with repeats instead of one actionable line.

Suggested fix, not tested

count failures per pull, back off, and quarantine pulls with non-retryable errors.

78. Low Nightly beta failures reported only in the step summary
First rating: Low · Reviewed rating: Low · Review: confirmed · new in this audit
From the report
Evidence

Evidence: echo ":x: Beta: build or tests failed (non-blocking)" >> $GITHUB_STEP_SUMMARY

Why it matters

nobody who is not watching the run learns of the failure.

Suggested fix, not tested

open or update a tracking issue, or fail a separate non-required check.

79. Low Airdrop tree output overwritten without a check
First rating: Low · Reviewed rating: Low · Review: confirmed · new in this audit
From the report
Evidence

Evidence: fs.writeFileSync(outputPath, JSON.stringify(output, null, 2));

Why it matters

the output path can be the input snapshot itself.

Suggested fix, not tested

refuse to overwrite without a flag.

80. Low Mainnet program dump at install time with no hash check
First rating: Low · Reviewed rating: Low · Review: confirmed · new in this audit
From the report
Evidence

Evidence: await $solana program dump ${id} ${outputFile};

Why it matters

an upgradeable program makes the tests non-reproducible.

Suggested fix, not tested

pin and verify the hash.

81. Low Web app flows have no end-to-end test
First rating: Low · Reviewed rating: Low · Review: location checked, kept as rated · new in this audit
From the report
Evidence

Evidence: only three program-level tests exist.

Why it matters

defects such as findings 137–139 go uncaught.

Suggested fix, not tested

add a test that runs the UI's send, mint and mode flows against the built program.

90. Low Paid API endpoint with credentials shipped to every browser
First rating: High · Reviewed rating: Low · Review: rated too high · also in the first audit (#42)
From the report
Evidence

Evidence: const DAS_URL = process.env.NEXT_PUBLIC_DAS_RPC;, beside a comment saying the endpoint carries a credential.

Why it matters

NEXT_PUBLIC_ values are inlined into the browser bundle. Any visitor can extract the key and spend the paid quota.

Suggested fix, not tested

keep the URL server-side and proxy requests through an API route.

92. Low Pre-funded account makes reallocation fail permanently (native)
First rating: Medium · Reviewed rating: Low · Review: rated too high · new in this audit
From the report
Evidence

Evidence: let diff = lamports_required - target_account.lamports();

Why it matters

overflow checks are on. Anyone who sends a few lamports to the account makes this subtraction abort every time.

Suggested fix, not tested

use saturating_sub and skip the transfer when the difference is 0.

93. Low Pre-funded account blocks reallocation, and no owner check (Pinocchio)
First rating: Medium · Reviewed rating: Low · Review: rated too high · also in the first audit (#9)
From the report
Evidence

Evidence: let diff = lamports_required - target_account.lamports();

Why it matters

same denial of service as finding 92, and neither resize path checks the owner.

Suggested fix, not tested

use saturating arithmetic, plus owner and signer checks.

95. Low Assembly transfer reads the amount from a fixed offset
First rating: Medium · Reviewed rating: Low · Review: rated too high · new in this audit
From the report
Evidence

Evidence: .equ INSTRUCTION_DATA_LEN, 0x7938 / .equ INSTRUCTION_DATA, 0x7940

Why it matters

if the recipient account holds data, every later offset shifts and the transferred amount is read from the wrong bytes.

Suggested fix, not tested

walk the input buffer using each account's data length, and check that the data is exactly 8 bytes.

96. Low Program signing keypairs committed to the repository
First rating: Medium · Reviewed rating: Low · Review: rated too high · new in this audit
From the report
Evidence

Evidence: an ed25519 secret-key array beginning [211. lever-keypair.json holds the same kind of secret.

Why it matters

anyone can deploy to these program ids on any cluster where they are not yet taken, so copies of the example can be pointed at an attacker's program.

Suggested fix, not tested

generate keys per environment and keep them out of version control.

97. Low Shell command injection in the dependency update script
First rating: Medium · Reviewed rating: Low · Review: rated too high · also in the first audit (#53)
From the report
Evidence

Evidence: execSync(npm view ${pkgName} version)

Why it matters

dependency names come from every package.json in the repo, including contributed ones. A crafted name runs commands on the maintainer's machine.

Suggested fix, not tested

call execFileSync('npm', ['view', pkgName, 'version']) with no shell, and validate the names.

98. Low Documented 'list' command crashes without a path
First rating: Medium · Reviewed rating: Low · Review: rated too high · new in this audit
From the report
Evidence

Evidence: export function commandList(path: string) {

Why it matters

the help text shows list with no argument, but that call passes undefined to readdirSync and throws.

Suggested fix, not tested

default path to '.'.

101. Low Accounts created at a non-canonical address can never be closed
First rating: Medium · Reviewed rating: Low · Review: rated too high · new in this audit
From the report
Evidence

Evidence: let bump_bytes = instruction_data[0].to_le_bytes();

Why it matters

create accepts any bump from the client, but close accepts only the canonical one.

Suggested fix, not tested

derive the canonical bump on chain at creation.

102. Low Several 'favorites' records can exist for one user
First rating: Medium · Reviewed rating: Low · Review: rated too high · new in this audit
Location: basics/favorites/pinocchio/program/src/instructions/create_pda.rs:18 (line corrected on review; the report cites :19)
From the report
Evidence

Evidence: let bump = data[0];

Why it matters

the bump is supplied by the client, so one user can hold several valid records.

Suggested fix, not tested

use the canonical bump and store it in the account.

103. Low Account created but its state never written (native)
First rating: Medium · Reviewed rating: Low · Review: rated too high · new in this audit
From the report
Evidence

Evidence: … &[page_visits.bump]]],)?; Ok(())

Why it matters

the supplied values are dropped, and the account stays zeroed with a bump of 0.

Suggested fix, not tested

serialize the state after creating the account.

104. Low Account created but its state never written (Pinocchio)
First rating: Medium · Reviewed rating: Low · Review: rated too high · new in this audit
From the report
Evidence

Evidence: let bump_bytes = &instruction_data[4..5];

Why it matters

same as finding 103. The bump is also supplied by the client.

Suggested fix, not tested

same as finding 103, and derive the bump on chain.

105. Low Unknown instruction reported as success (native counter)
First rating: Medium · Reviewed rating: Low · Review: rated too high · new in this audit
From the report
Evidence

Evidence: _ => { msg!("Error: unknown instruction") } … Ok(())

Why it matters

a wrong discriminator silently does nothing, and the transaction still succeeds.

Suggested fix, not tested

return InvalidInstructionData.

106. Low Unknown instruction reported as success (Pinocchio counter)
First rating: Medium · Reviewed rating: Low · Review: rated too high · new in this audit
From the report
Evidence

Evidence: _ => { log!("Error: unknown instruction"); }

Why it matters

same as finding 105.

Suggested fix, not tested

same as finding 105.

107. Low Vault client scripts target a different program and cannot load the wallet
First rating: Medium · Reviewed rating: Low · Review: rated too high · new in this audit
From the report
Evidence

Evidence: new anchor.web3.PublicKey('CNftyK7T8…'), while the program declares Fd4iwp…. Line 7 loads '~/.config/solana/id.json'.

Why it matters

the scripts derive addresses for another program. Node does not expand ~, so they also fail at import.

Suggested fix, not tested

read the id from the IDL or Anchor.toml, and expand the home directory explicitly.

109. Low Refund deadline has no upper bound
First rating: Medium · Reviewed rating: Low · Review: rated too high · new in this audit
From the report
Evidence

Evidence: if settle_deadline_slots == 0 { return Err(…) }

Why it matters

a pool admin working with the operator can set an effectively infinite deadline. That defeats the promise that a withheld reveal never keeps buyers' funds.

Suggested fix, not tested

enforce a maximum on chain, and show the deadline before purchase.

110. Low Public pull endpoint spends the operator's funds without limits
First rating: Medium · Reviewed rating: Low · Review: rated too high · new in this audit
From the report
Evidence

Evidence: export async function POST(request: Request) calls orchestratePull(…) with the operator as payer.

Why it matters

each request makes the operator pay settle, mint and token-account rent. Nothing checks that the entry fee covers this, and there is no rate limit.

Suggested fix, not tested

add rate limiting, and require the entry fee to be at least the per-pull cost.

111. Low Operator can withhold unfavourable reveals
First rating: Medium · Reviewed rating: Low · Review: rated too high · new in this audit
From the report
Evidence

Evidence: /// who withholds a reveal … can delay a payout, but can never keep the buyer's funds.

Why it matters

the operator sees each outcome before settling and can skip rare prizes, which skews the real odds. The UI still claims "provably fair".

Suggested fix, not tested

force or penalise the reveal on the deadline, or use randomness the operator cannot pre-compute.

112. Low Buyer's rent for each pull is never returned
First rating: Medium · Reviewed rating: Low · Review: rated too high · new in this audit
From the report
Evidence

Evidence: create_pda_account(accounts.buyer, accounts.pull, …). Only the refund path closes the account.

Why it matters

settled and claimed pulls lock the buyer's rent forever.

Suggested fix, not tested

add a close instruction for claimed pulls.

114. Low UI may sell from a different pool than the server accepts
First rating: Medium · Reviewed rating: Low · Review: rated too high · new in this audit
From the report
Evidence

Evidence: const pools = await discoverPools(client); return pools[0] ?? null;

Why it matters

anyone can create a pool. Without the env setting, users sign buys that the server then rejects.

Suggested fix, not tested

expose the server's configured pool to the client.

115. Low Tournament pot can be locked forever by the admin
First rating: Medium · Reviewed rating: Low · Review: rated too high · also in the first audit (#43)
Location: games/world-cup/pinocchio/program/src/instructions/finalize.rs:60 (line corrected on review; the report cites :51)
From the report
Evidence

Evidence: config.check_admin(accounts.admin.address())?;

Why it matters

lock, results, finalize and therefore every claim need one admin signature. There is no refund or timeout path, and the admin may also enter a bracket.

Suggested fix, not tested

add a permissionless refund after a deadline, and separate the result authority from entrants.

116. Low First caller becomes tournament admin
First rating: Medium · Reviewed rating: Low · Review: rated too high · also in the first audit (#44)
From the report
Evidence

Evidence: Config::init(&mut config_data, config_bump, accounts.admin.address(), …)

Why it matters

a front-runner can take control of the whole pot right after deployment.

Suggested fix, not tested

require the upgrade authority or a fixed key.

117. Low Local API server accepts cross-site requests and unsafe config keys
First rating: Medium · Reviewed rating: Low · Review: rated too high · also in the first audit (#45, #47)
From the report
Evidence

Evidence: url.pathname === '/api/setup/save-config' and existing.networks[network] ?? …

Why it matters

any website the developer visits can POST here as text/plain and change the program address the app uses. It can also spawn airdrop and mint commands with the developer's keypair, or pollute Object.prototype through __proto__.

Suggested fix, not tested

check Origin, require JSON or a token, and allow-list network names.

118. Low One malformed request crashes the local API server
First rating: Medium · Reviewed rating: Low · Review: rated too high · also in the first audit (#46)
From the report
Evidence

Evidence: const response = await handleRequest(request); with no try/catch.

Why it matters

extractFields throws, and the unhandled rejection terminates the server and the validator it manages.

Suggested fix, not tested

catch errors at the top level and return 400 or 500.

119. Low Block-list configuration can be claimed or blocked by anyone
First rating: Medium · Reviewed rating: Low · Review: rated too high · new in this audit
From the report
Evidence

Evidence: CreateAccount { from: self.authority, to: self.config, … and config.authority = *self.authority.address();

Why it matters

whoever calls first becomes the global authority, and pre-funding the address blocks initialisation entirely.

Suggested fix, not tested

gate initialisation on the deployer, and handle pre-funded addresses.

120. Low Anyone can block a mint's hook setup by pre-funding its address
First rating: Medium · Reviewed rating: Low · Review: rated too high · new in this audit
From the report
Evidence

Evidence: CreateAccount { from: self.authority, to: self.extra_metas,

Why it matters

once setup fails, transfers of that mint cannot run.

Suggested fix, not tested

top up, allocate and assign when the address already holds lamports.

121. Low First caller becomes the transfer-switch admin
First rating: Medium · Reviewed rating: Low · Review: rated too high · new in this audit
From the report
Evidence

Evidence: if self.admin_config.is_initialised { require_keys_eq!(…) }

Why it matters

the first caller controls every wallet's transfer switch.

Suggested fix, not tested

restrict the first call to the deployer.

122. Low Anyone can block transfer-switch setup by pre-funding its address
First rating: Medium · Reviewed rating: Low · Review: rated too high · new in this audit
From the report
Evidence

Evidence: create_account(CpiContext::new(…

Why it matters

the mint's validation account can never be created, so every transfer of that mint fails.

Suggested fix, not tested

use Anchor init, or transfer, allocate and assign.

123. Low First caller becomes the allow/block-list authority
First rating: Medium · Reviewed rating: Low · Review: rated too high · new in this audit
From the report
Evidence

Evidence: Config { authority: self.payer.key(), … }

Why it matters

whoever initialises first controls the wallet lists of every mint that uses this hook.

Suggested fix, not tested

gate it on the deployer.

124. Low Global counter blocks setup of every mint after the first
First rating: Medium · Reviewed rating: Low · Review: rated too high · new in this audit
From the report
Evidence

Evidence: #[account(init, seeds = [b"counter"], …)]

Why it matters

setting up a second mint fails with "account already in use". transfer-cost has the same pattern.

Suggested fix, not tested

key the counter by mint.

126. Low Any player can rewrite another player's NFT metadata
First rating: Medium · Reviewed rating: Low · Review: rated too high · also in the first audit (#3)
From the report
Evidence

Evidence: /// CHECK: Make sure the ata to the mint is actually owned by the signer sits above pub mint: AccountInfo<'info>,

Why it matters

the check the comment describes does not exist. The program signs a metadata update for any mint passed in.

Suggested fix, not tested

require the signer's token account for that mint, holding a balance of 1.

129. Low Anyone can mint a token another user created (Pinocchio)
First rating: Medium · Reviewed rating: Low · Review: rated too high · also in the first audit (#38)
From the report
Evidence

Evidence: let bump = MintAuthorityPda::deserialize(…)?.bump;, after which MintTo runs for any caller.

Why it matters

a racer can take a one-of-one NFT between its creation and the creator's mint.

Suggested fix, not tested

record the creator and require their signature, or create and mint in one instruction.

130. Low Anyone can mint a token another user created (native)
First rating: Medium · Reviewed rating: Low · Review: rated too high · also in the first audit (#37)
From the report
Evidence

Evidence: if associated_token_account.lamports() == 0 { … } else { msg!("…exists.") }

Why it matters

same race as finding 129, and an existing destination account is never tied to the payer.

Suggested fix, not tested

bind the mint to the creator and check the destination account.

131. Low Mint authority setup can be blocked by pre-funding
First rating: Medium · Reviewed rating: Low · Review: rated too high · new in this audit
From the report
Evidence

Evidence: CreateAccount { from: payer, to: mint_authority,

Why it matters

one lamport sent to the fixed address bricks initialisation, and with it every later mint.

Suggested fix, not tested

handle pre-funded addresses.

132. Low Maker's rent is paid to the taker (native escrow)
First rating: Medium · Reviewed rating: Low · Review: rated too high · also in the first audit (#1)
Location: tokens/escrow/native/program/src/instructions/take_offer.rs:204 (line corrected on review; the report cites :202)
From the report
Evidence

Evidence: **payer.lamports.borrow_mut() += lamports;

Why it matters

the maker funded the offer and vault rent, but it goes to the taker's chosen payer.

Suggested fix, not tested

return the rent to the maker.

133. Low Maker's rent is paid to the taker (Pinocchio escrow)
First rating: Medium · Reviewed rating: Low · Review: rated too high · also in the first audit (#2)
From the report
Evidence

Evidence: payer.set_lamports(new_payer_lamports);

Why it matters

same as finding 132.

Suggested fix, not tested

same as finding 132.

134. Low Pool can be bricked by a donation before the first deposit
First rating: Medium · Reviewed rating: Low · Review: rated too high · also in the first audit (#36)
From the report
Evidence

Evidence: let pool_creation = pool_a.amount == 0 && pool_b.amount == 0; and a later .checked_div(pool_a_u128).unwrap()

Why it matters

one stray token transfer causes a division-by-zero panic or a zero-liquidity path, and the pool can never be used.

Suggested fix, not tested

track initialisation in state, and return errors instead of unwrap.

135. Low Failed fundraiser can never be closed
First rating: Medium · Reviewed rating: Low · Review: rated too high · new in this audit
From the report
Evidence

Evidence: self.fundraiser.current_amount -= …; Ok(()). The account is closed only on success.

Why it matters

the maker's single fundraiser slot and its rent are locked forever.

Suggested fix, not tested

add a close path after the deadline for failed campaigns.

136. Low Minimum-amount checks use the wrong formula
First rating: Medium · Reviewed rating: Low · Review: rated too high · also in the first audit (#33)
From the report
Evidence

Evidence: amount >= MIN_AMOUNT_TO_RAISE.pow(self.mint_to_raise.decimals as u32). contribute.rs:61 uses 1_u64.pow(…).

Why it matters

the minimum target is 3^decimals rather than 3 whole tokens, and the contribution minimum is always 1.

Suggested fix, not tested

use MIN × 10^decimals with checked arithmetic.

137. Low CSV removals can never be applied
First rating: Medium · Reviewed rating: Low · Review: rated too high · new in this audit
From the report
Evidence

Evidence: remove is kept only for existing wallets, then .filter(entry => !existingAddresses.has(entry.address)) drops them.

Why it matters

a blocked wallet can never be unblocked through CSV.

Suggested fix, not tested

exempt removals from the final filter.

138. Low One malformed CSV row discards the whole upload
First rating: Medium · Reviewed rating: Low · Review: rated too high · new in this audit
From the report
Evidence

Evidence: const [address, mode] = row.split(',')…; mode.toLowerCase()

Why it matters

any row without a comma throws, and the whole upload is lost.

Suggested fix, not tested

validate each row and report the bad ones.

139. Low Token send uses the typed amount as raw base units
First rating: Medium · Reviewed rating: Low · Review: rated too high · new in this audit
From the report
Evidence

Evidence: amount: parseFloat(amount),, then BigInt(amount) in account-data-access.tsx:102.

Why it matters

typing 1 on a 6-decimal token sends 0.000001, and typing 1.5 throws.

Suggested fix, not tested

convert decimals to base units using the mint's decimals.

140. Low CI builds a tool from an unpinned repository head
First rating: Medium · Reviewed rating: Low · Review: rated too high · new in this audit
From the report
Evidence

Evidence: cargo install --git https://github.com/coral-xyz/anchor avm --force

Why it matters

CI is not reproducible, and a broken or compromised upstream commit breaks every Anchor job.

Suggested fix, not tested

pin a tag or commit and use --locked.

141. Low Successful settlement can be reported as a failure
First rating: Medium · Reviewed rating: Low · Review: rated too high · new in this audit
From the report
Evidence

Evidence: await verifySettle(…); return; } catch (err) {

Why it matters

when verification lags the indexer, the script resends an already settled pull and finally throws a misleading error.

Suggested fix, not tested

verify outside the send loop, and never resend after a confirmed signature.

142. Low Operator secret keys written with default file permissions
First rating: Medium · Reviewed rating: Low · Review: rated too high · new in this audit
From the report
Evidence

Evidence: writeFileSync(OPERATOR_KEYPAIR_PATH, JSON.stringify(Array.from(secretKey)));

Why it matters

the key is both the signing key and the randomness key. Anyone who can read it can forge reveals.

Suggested fix, not tested

write with mode 0o600 into a directory with mode 0o700 (also burst-randomness.ts:239).

143. Low Install hook switches the global CLI to mainnet
First rating: Medium · Reviewed rating: Low · Review: rated too high · also in the first audit (#23)
From the report
Evidence

Evidence: await $solana config set -um;, which runs from postinstall.

Why it matters

a later deploy script that relies on the CLI's setting spends real SOL on mainnet. The same line is in 8 examples.

Suggested fix, not tested

pass the cluster explicitly to the one command that needs it.

144. Low Airdrop generator silently drops recipients
First rating: Medium · Reviewed rating: Low · Review: rated too high · new in this audit
From the report
Evidence

Evidence: console.warn(Skipping invalid entry …)

Why it matters

a root can be published that excludes recipients, and the script still exits 0.

Suggested fix, not tested

fail on invalid entries unless explicitly overridden, and print the counts in and out.

145. Low Transactions sent with preflight checks disabled
First rating: Medium · Reviewed rating: Low · Review: rated too high · new in this audit
From the report
Evidence

Evidence: sendAndConfirm(signedTransaction, { …, skipPreflight: true });

Why it matters

failing transactions land on chain, cost fees and surface only as opaque errors.

Suggested fix, not tested

remove skipPreflight.

146. Low Tests ignore failed transactions
First rating: Medium · Reviewed rating: Low · Review: rated too high · new in this audit
From the report
Evidence

Evidence: const _re = svm.sendTransaction(tx);

Why it matters

LiteSVM returns failures as values instead of throwing, so these tests (about 27 such calls across 13 files) cannot fail on a failed transaction.

Suggested fix, not tested

assert that the result is not a failure.

147. Low Image optimiser fetches images from any host
First rating: Medium · Reviewed rating: Low · Review: rated too high · new in this audit
From the report
Evidence

Evidence: hostname: '**',

Why it matters

image URLs come from on-chain metadata that anyone can write, so the deployed server becomes an open image proxy.

Suggested fix, not tested

allow-list the specific gateways, or render these images unoptimised.

148. Low Verify and Admin pages unreachable from the menu on phones
First rating: Medium · Reviewed rating: Low · Review: rated too high · new in this audit
From the report
Evidence

Evidence: <nav className="hidden items-center gap-1 md:flex">

Why it matters

on narrow screens there is no replacement navigation.

Suggested fix, not tested

add a mobile menu.

149. Low Fairness check says 'matches' even when it fails
First rating: Medium · Reviewed rating: Low · Review: rated too high · new in this audit
From the report
Evidence

Evidence: label={tier reproduced from beta → … (matches recorded)}

Why it matters

a failed fairness check is shown next to reassuring text.

Suggested fix, not tested

build the label from tierOk.

150. Low A zero balance shows as loading forever
First rating: Medium · Reviewed rating: Low · Review: rated too high · new in this audit
From the report
Evidence

Evidence: {query.data?.value ? <BalanceSol …/> : '...'}

Why it matters

an empty wallet shows "..." forever.

Suggested fix, not tested

check for undefined instead of truthiness.

152. Low Invalid token address in the URL crashes the page
First rating: Medium · Reviewed rating: Low · Review: rated too high · new in this audit
From the report
Evidence

Evidence: useGetToken(toAddress(tokenAddress)); during render.

Why it matters

a bad URL throws during render instead of showing an error state. Line 30 has the same problem.

Suggested fix, not tested

validate the address and render an error message.

153. Low Wallet rows lose focus on every keystroke
First rating: Medium · Reviewed rating: Low · Review: rated too high · new in this audit
From the report
Evidence

Evidence: <tr key={wallet.address || String(index)}>

Why it matters

each keystroke remounts the row, so addresses cannot be typed in by hand.

Suggested fix, not tested

give each row a stable id.

154. Low Form and mint errors only reach the console
First rating: Medium · Reviewed rating: Low · Review: rated too high · new in this audit
From the report
Evidence

Evidence: console.error('Invalid form data:', err);

Why it matters

users get no feedback when an action fails.

Suggested fix, not tested

show errors and results in the UI.

155. Low NFT list for a previous wallet can overwrite the current one
First rating: Medium · Reviewed rating: Low · Review: rated too high · new in this audit
From the report
Evidence

Evidence: getAssetsByOwner(signer.address); with no cancellation or catch.

Why it matters

a slow response for the old wallet overwrites the new wallet's list, and failures become unhandled rejections.

Suggested fix, not tested

cancel stale requests in effect cleanup, and catch errors.

Info after review (5)

5. Info Wallet auto-connect with no secure-origin check (NFT game app)
First rating: Low · Reviewed rating: Info · Review: rated too high · also in the first audit (#8)
From the report
Evidence

Evidence: autoConnect: true,

Why it matters

on an insecure origin, auto-connect fails silently.

Suggested fix, not tested

detect an insecure origin on load and explain it to the user. Deploy only over HTTPS.

9. Info Token-2022 mint check indexes data before checking length and owner
First rating: Low · Reviewed rating: Info · Review: rated too high · also in the first audit (#49)
From the report
Evidence

Evidence: let mint_type_byte = data[TYPE_BYTE_OFFSET]; comes before the length check.

Why it matters

a short (legacy) mint panics instead of returning a clear error.

Suggested fix, not tested

check the owner program and data.len() before indexing.

44. Info Request body parsed before any size cap
First rating: Low · Reviewed rating: Info · Review: rated too high · new in this audit
From the report
Evidence

Evidence: const body: unknown = await request.json();

Why it matters

the 4 KB limit is checked only after the whole body has been parsed.

Suggested fix, not tested

check Content-Length and read with a hard limit before parsing.

Review: `)

77. Info Status polling re-triggers the fallback deploy
First rating: Low · Reviewed rating: Info · Review: rated too high · new in this audit
From the report
Evidence

Evidence: if (!programDeployed && !deployingProgram) { void deployProgramViaSurfnet(); }

Why it matters

each poll starts a new deploy attempt and logs another error.

Suggested fix, not tested

rate-limit the attempts and return the last error in the status response.

82. Info Helpers copied across examples have drifted
First rating: Info · Reviewed rating: Info · Review: confirmed · also in the first audit (#28)
From the report
Evidence

Evidence: const RPC_PATH = ''; while the vault example's copy holds a URL.

Why it matters

the copies are standalone by policy but have drifted, and they swallow errors.

Suggested fix, not tested

document the policy next to the copies and keep them in sync.

Excluded on review (1)

Findings the review showed to be wrong or a repeat of another finding. They are not counted above.

Want this for your code?

Upload a ZIP or link a public GitHub repo, pick the areas and the depth, and get findings by severity with fixes.