
| Audited | solana-foundation/program-examples at commit de090195e4de698e150572c4f886c333323a64a5 |
|---|---|
| Date | 11 October 2026 (audited again; first audit 11 October 2026) |
| How it ran | local run on our workstation, full audit, Standard review |
| Verdict after review | Fail (Fail if a High finding remains after review, otherwise Pass with notes) |
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 audit | Finding | Reviewed rating then | Now | In this audit |
|---|---|---|---|---|
| #1 | Escrow (native): taker redirects offer rent to unchecked payer | Low | Still open | #132 |
| #2 | Escrow (Pinocchio): same rent redirection | Low | Still open | #133 |
| #3 | chop_tree accepts any mint | Low | Still open | #126 |
| #4 | ABL transfer hook trusts caller accounts | Low | Still open | not reported again |
| #5 | Block-list hook (Pinocchio) skips owner/length checks | Low | Still open | not reported again |
| #6 | Wallet bridge returns partly signed tx | Low | Still open | #7 |
| #7 | @solana/kit pinned to latest | Low | Still open | not reported again |
| #8 | Wallet connect lacks insecure-origin check | Low | Still open | #3, #4 |
| #9 | Realloc (Pinocchio): any caller overwrites/resizes any record | Medium | Still open | #11, #93 |
| #10 | Realloc (native): overwrite plus type confusion | Medium | Still open | #12, #91, #92 |
| #11 | sleep() test helper never waits | Low | Still open | not reported again |
| #12 | Settlement operator polls getProgramAccounts in a loop | Low | Still open | #21 |
| #13 | Failed settlement retried with no backoff | Low | Still open | #76 |
| #14 | Pull account layout hand-copied into scripts | Low | Still open | #48 |
| #15 | Token-2022 extension parser lacks bounds checks | Low | Still open | not reported again |
| #16 | world-cup dev API is one 777-line file | Low | Still open | #46 |
| #17 | "Create mock USDC" not guarded against concurrency | Low | Still open | #42 |
| #18 | "Start validator" reports success before start | Low | Still open | not reported again |
| #19 | RPC_URL read but hard-coded endpoint used | Low | Still open | #51 |
| #20 | Pull status values re-declared | Low | Still open | not reported again |
| #21 | world-cup program address declared in three modules | Low | Still open | #72 |
| #22 | Buy instruction layout hand-copied into validation | Low | Still open | not reported again |
| #23 | Postinstall scripts switch global CLI to mainnet | Low | Still open | #143 |
| #24 | saveKeypairToFile deletes existing key file | Low | Still open | #59 |
| #25 | savePublicKeyToFile wipes addresses after swallowed error | Low | Still open | not reported again |
| #26 | getInstructionData copied three times | Low | Still open | not reported again |
| #27 | CI orchestration copied across four workflows | Low | Still open | #60 |
| #28 | Per-example script copies drift | Info | Still open | not reported again |
| #29 | PDA rent payer (native): anyone drains rent vault | Medium | Still open | #85 |
| #30 | PDA rent payer (Pinocchio): same drain | Medium | Still open | #86 |
| #31 | cNFT vault: anyone withdraws NFTs to any address | High | Still open | #83 |
| #32 | Fundraiser: maker fakes reaching goal via vault top-up | High | Still open | #23 |
| #33 | Fundraiser: minimum contribution always 1 base unit | Low | Still open | #136 |
| #34 | Fundraiser: vault token account never closed | Low | Still open | not reported again |
| #35 | Token swap: LP minted as sqrt(a*b), not pool share | Medium | Still open | #89 |
| #36 | Token swap: one-sided donation makes deposit panic | Low | Still open | #134 |
| #37 | PDA mint authority (native): anyone can mint | Low | Still open | #130 |
| #38 | PDA mint authority (Pinocchio): same | Low | Still open | #129 |
| #39 | NFT operations: collection verify ignores declared authority | Medium | Still open | #127 |
| #40 | Transfer hook: advertised limit not enforced | Low | Still open | not reported again |
| #41 | Transfer hook: counter never saved | Low | Still open | #24, #25 |
| #42 | DAS endpoint bundled into browser via NEXT_PUBLIC_* | Low | Still open | #90 |
| #43 | World cup: entry fees locked if admin never finalizes | Low | Still open | #115 |
| #44 | World cup: first init_config caller becomes admin | Low | Still open | #116 |
| #45 | World cup dev API: any web page can trigger actions | Low | Still open | #117 |
| #46 | World cup dev API: malformed request crashes server | Low | Still open | #118 |
| #47 | World cup dev API: save-config stores unvalidated data | Low | Still open | #117 |
| #48 | Anchor.toml program IDs differ from declare_id! | Low | Still open | not reported again |
| #49 | is_token_2022_mint indexes before length check | Info | Still open | #9 |
| #50 | Pinocchio basics: short instruction data panics | Info | Still open | not reported again |
| #51 | expectRevert helper can never fail | Low | Still open | not reported again |
| #52 | cicd.sh deploys stale binary after failed build | Low | Still open | #58 |
| #53 | Maintainer script builds shell command from package names | Low | Still open | #97 |
| #54 | PRs changing setup action skip builds | Low | Still open | not reported again |
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)
tokens/token-fundraiser/anchor/programs/fundraiser/src/instructions/checker.rs:54 (also refund.rs:66)From the report
Evidence: self.vault.amount >= self.fundraiser.amount_to_raise,
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.
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
From the report
Evidence: pub leaf_owner: UncheckedAccount<'info>, with seeds = [b"cNFT-vault"]. There is no signer, and new_leaf_owner is chosen by the caller.
anyone can withdraw any cNFT the vault holds to an address of their choice. withdraw_two_cnfts has the same gap.
store an authority or the depositor and require it as a signer before the vault signs.
Medium after review (23)
From the report
Evidence: await rpc.sendTransaction(getBase64EncodedWireTransaction(signedTx), { encoding: 'base64' }).send(); followed by a success toast.
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.
use the send-and-confirm helper that the app already uses elsewhere, and show success only after the transaction is confirmed without error.
From the report
Evidence: setRetry({ buyer, pull, transaction });
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.
let the UI call the permissionless claim for any settled pull, or run a server worker that mints settled pulls.
From the report
Evidence: let count = ctx.accounts.counter_account.counter.checked_add(1)… on an account that is not declared mutable.
the hook's whole purpose does not work. The stored count stays 0.
mark the account mutable and write the new count back.
tokens/token-2022/transfer-hook/account-data-as-seed/anchor/programs/transfer-hook/src/lib.rs:69From the report
Evidence: same pattern as finding 24.
the per-owner count never changes.
same as finding 24.
From the report
Evidence: ctx.accounts.counter_account.counter += 1; where the counter is a u8 on an account that is not mutable.
the update is lost. Once persistence is fixed, the 256th transfer would overflow and block every later transfer of the mint.
make the account mutable, widen the counter to u64, and use checked_add.
From the report
Evidence: pub mint_authority: Pubkey, is never read, and mint::authority = payer.key() is used instead.
a user who enters another authority in the form gets a mint controlled by the payer, with no error.
apply the argument, or remove it from the arguments, the IDL and the UI.
Review: ` at :26)
From the report
Evidence: if (nftData.authorities[0] === nftAuthority), while the other handler normalises authority.address.
with spec-following DAS providers, "Chop tree Session" always reports that no NFT exists.
write one lookup helper that normalises the authority, and use it in both handlers.
basics/pda-rent-payer/anchor/programs/anchor-program-example/src/instructions/create_new_account.rs:32 (line corrected on review; the report cites :28)From the report
Evidence: from: ctx.accounts.rent_vault.to_account_info(),, where the only signer is a fresh new_account.
an attacker can loop over fresh keypairs and move the whole vault balance to accounts they control.
require an authorised signer, and cap payouts per caller and in total.
From the report
Evidence: **rent_vault.lamports.borrow_mut() -= lamports_required_for_rent;
any writable account passed in receives lamports on every call.
require an authorised signer and a fresh, system-owned recipient.
From the report
Evidence: rent_vault.set_lamports(rent_vault.lamports() - lamports_required_for_rent);
same drain as findings 84 and 85. The bump is also taken from instruction data.
add an authority check, and derive the canonical bump on chain.
From the report
Evidence: realloc::payer = payer,, while update writes message = input with no owner check.
any signer can replace another user's message. Shrinking it refunds the freed rent to the attacker.
store an owner in the account and require it with has_one.
tokens/token-2022/transfer-hook/block-list/pinocchio/program/src/instructions/block_wallet.rs:28From the report
Evidence: pinocchio_system::instructions::CreateAccount { from: self.authority, to: self.wallet_block,
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.
when the target already has lamports, top it up, then allocate and assign it.
From the report
Evidence: let mut liquidity = (amount_a as u128).checked_mul(amount_b as u128).unwrap().isqrt() as u64;
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.
after the first deposit, mint min(a × supply / reserve_a, b × supply / reserve_b).
From the report
Evidence: pub fn reallocate_zero_init(…) { … target_account.resize(account_span)?;
there is no owner or signer check, so any program-owned record can be rewritten.
store an authority and require its signature.
From the report
Evidence: .equ PROGRAM_ID, 0x7938
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.
copy the system program key (or the intended owner) from a computed offset, and test with a realistic id.
From the report
Evidence: let diff = target_account.lamports() - lamports_required;, where the requirement is the zero-size minimum.
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.
move the full balance to the payer.
From the report
Evidence: let diff = target_account.lamports() - lamports_required;
same as finding 99.
same as finding 99.
From the report
Evidence: const _RPC_PATH = '…';, while three files import { RPC_PATH } from './cnft-burn'.
the connection URL is undefined, so the example's test flow cannot run.
export the constant from a small config module.
From the report
Evidence: const index = pool.pool.pullsCount;, which comes from a cache refreshed every 15 seconds.
any other buy in that window makes this one fail, so concurrent buyers collide.
re-read the pool at signing time, or key pulls on a value the buyer controls.
tokens/token-2022/transfer-hook/account-data-as-seed/anchor/programs/transfer-hook/src/lib.rs:117From the report
Evidence: init, seeds = [b"counter", payer.key()…], while the hook resolves [b"counter", owner.key()].
other owners' counter accounts never exist, so their transfers fail.
create per-owner counters lazily.
From the report
Evidence: pub authority: Signer<'info>, is never used, and the PDA signs instead.
counterfeit NFTs can be marked as verified members of the collection.
require a stored collection admin, or proof that the program issued the NFT.
From the report
Evidence: if !payer.is_signer() { return Err(…) }
same as finding 127.
same as finding 127.
From the report
Evidence: redirect(/manage-token/${tokenAddress.toString()}); inside a submit handler.
redirect() is not valid in event handlers, so the form throws instead of navigating.
use router.push.
Low after review (124)
From the report
Evidence: if (!walletSignature || walletSignature.every(byte => byte === 0)) {
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.
verify the ed25519 signature over the message bytes against the buyer key before any lookups.
From the report
Evidence: onClick={() => connect(wallet)}
on a plain-HTTP origin that is not localhost, browser wallets refuse to connect without any visible error.
check window.isSecureContext before offering connect, and show "Wallets require HTTPS" when it is false.
games/world-cup/pinocchio/webapp/src/components/solana/solana-provider.tsx:80 (line corrected on review; the report cites :78)From the report
Evidence: await connect(connectorId);
same silent failure as finding 3.
same as finding 3.
From the report
Evidence: onClick={() => connect(wallet)}
a rejected or cancelled connect becomes an unhandled promise rejection, and the user is never told.
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)
From the report
Evidence: Transaction.populate(Message.from(Buffer.from(signed.messageBytes))), after which empty signatures are skipped.
a transaction with a missing fee-payer signature is passed on as if it were fully signed.
throw when the result is missing or the fee-payer signature is absent.
From the report
Evidence: "@solana/connector": "^0.2.6", "@solana/kit": "^7.0.0" alongside wallet-adapter-react.
caret ranges on two wallet stacks bridged together break silently when either stack is upgraded.
pin exact versions, use one wallet stack, and test the bridge after each upgrade.
tokens/escrow/native/program/src/instructions/take_offer.rs:152 (line corrected on review; the report cites :41)From the report
Evidence: invoke_signed(&token_instruction::transfer(token_program.key, vault.key, …
the program address that receives the vault's signature is supplied by the caller. The refund path does check it.
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
From the report
Evidence: target_account_data[25..37].copy_from_slice(instruction_data);
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.
start each record with a kind byte, check it before writing, and validate the input length.
From the report
Evidence: AddressInfo::try_from_slice(&target_account.data.borrow())?;
a crafted record of the other type can be parsed as this one.
add a discriminator and check the owner before deserializing.
scripts/lib/change-package-version.ts:7From the report
Evidence: if (content.dependencies?.[pkgName] && … ) { … return [true, content];
when a package appears in both dependencies and devDependencies, one run leaves one copy stale.
update both sections in a single pass.
From the report
Evidence: return a.owner < b.owner ? -1 : a.owner > b.owner ? 1 : 0;
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.
carry the entry index into each leaderboard row and compare on it before the owner.
From the report
Evidence: return fallbackImage(fonts); with s-maxage=86400, stale-while-revalidate=604800.
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.
send no-store or a short TTL for fallback images, and include the cluster in the cache key.
From the report
Evidence: const usdcToken = { symbol: 'USDC', mint, decimals: 6 };
the server and the scripts write the same file in different formats and drop each other's fields. Neither writer uses locking.
give the file one owner module and a schema version, and write through temp-file-and-rename.
From the report
Evidence: … latestPull.status === PullStatus.Pending) ? 2_000 : 0
the hook polls forever, even when the account never appears.
subscribe to account changes, and fall back to polling with capped exponential backoff.
From the report
Evidence: { refreshInterval: 15_000 } around getProgramAccounts.
public RPC nodes rate-limit or disable this call, so the app degrades as users grow.
resolve the pool once and derive addresses instead of scanning.
From the report
Evidence: for (;;) { try { await crankOnce(…) } catch … await new Promise(r => setTimeout(r, POLL_MS));
every cycle scans all pulls, including finished ones, and keeps the same pace while the RPC is failing.
track the last seen pull count, and back off on errors.
Review: with fixed POLL_MS`, default 5000)
From the report
Evidence: (featureFlags as { version: unknown }).version = VERSION.V2;
in a long-running server this switches every other user of that library in the process.
set the version once at startup, or pass it explicitly.
tokens/token-2022/transfer-hook/allow-block-list-token/src/components/abl-token/abl-token-data-access.tsx:173 (line corrected on review; the report cites :160)From the report
Evidence: onSuccess: signature => { transactionToast(signature); }
the page keeps showing the old mode for up to a minute, and the Apply button's state is computed from that stale value.
invalidate the token query in each mutation's onSuccess.
Review: line is 173
From the report
Evidence: supply: 0, // TODO
the real value is replaced by a placeholder, so the page always shows a supply of 0.
carry the fetched value through, or remove the field.
From the report
Evidence: let data = if config.blocked_wallets_count == 0 { EXTRA_METAS_EMPTY_DEPENDENCIES }
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.
always register the block-record accounts, and treat an empty record as "not blocked".
tokens/token-2022/nft-meta-data-pointer/anchor/programs/extension_nft/src/instructions/chop_tree.rs:79 (line corrected on review; the report cites :75)From the report
Evidence: seeds = [level_seed.as_ref()] sits beside seeds = [b"nft_authority".as_ref()].
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.
prefix the level seeds with a fixed namespace.
From the report
Evidence: let mut account_infos1 = vec![ … ] and let mut account_infos2 = vec![ … ]
a fix to one copy will not reach the others.
extract a single transfer helper.
From the report
Evidence: Pubkey::new_from_array([0x98, 0x8b, …
the hand-typed copies can drift from each other.
reuse the crate-level constant.
From the report
Evidence: for i in 1..count { alt_bn128_group_op(…) }
the work is bounded only by the instruction size limit and the compute budget.
add a maximum key count and reject larger inputs up front.
tokens/token-2022/transfer-hook/allow-block-list-token/src/components/account/account-ui.tsx:161From the report
Evidence: onClick={() => { const amount = window.prompt(…); … sendTokens.mutateAsync({
a repeated click can submit a second transfer.
disable the button while the send is pending.
tokens/token-2022/transfer-hook/allow-block-list-token/src/components/abl-token/abl-token-config.tsx:171 (line corrected on review; the report cites :170)From the report
Evidence: rows.filter(row => row.trim()).map(row => { const [address, mode] = row.split(',')…
the two copies will drift.
use one shared parser.
From the report
Evidence: export const TIME_TO_REFILL_ENERGY = 60n; export const MAX_ENERGY = 100n;
these silently diverge when the program's values change.
read the values from chain, or generate them from the program with a parity test.
From the report
Evidence: for sibling in hashes.chunks_exact(32) {
the proof depth is bounded only by the transaction size.
reject proofs deeper than the tree height.
Review: ` bounds the depth to the index)
From the report
Evidence: } catch (e) { log('warn', 'Failed to update config…') } … resolve(jsonResponse({ mint, alreadyExisted: false }));
the mint is never recorded, so the next call creates a second one.
return an error, including the mint address, when the write fails.
From the report
Evidence: log('warn', 'Failed to read config, using defaults' …); return { networks: {} };
a corrupt or half-written file, which concurrent writers can produce, is silently replaced. All saved program and token entries are lost.
fail when the file is unreadable as opposed to missing, and write atomically.
From the report
Evidence: const child = spawn('spl-token', [ 'create-token', …
concurrent calls create several mints and race on the config file.
keep one in-flight promise per operation.
From the report
Evidence: return NextResponse.json(await orchestratePull(client, config, buy));
a retry or replay runs the whole submit, settle and claim pipeline twice in parallel.
key in-flight work by buy signature and return the existing promise.
games/gacha/pinocchio/webapp/src/lib/pull-api.ts:46 (line corrected on review; the report cites :44)From the report
Evidence: throw new PullApiError(payload as PullFailure);
a gateway error page hides that the buy may already have been sent, so the UI offers no retry.
validate the response shape and default to a retryable failure.
Review: ` at :44 also throws on HTML)
From the report
Evidence: about 780 lines covering validator processes, config persistence, airdrops and deploy routing.
the parts are hard to change or test independently.
split it into modules and use a route table.
From the report
Evidence: a 701-line file.
the statistics code cannot be tested without chain access.
move the statistics and the reporting into separate modules.
From the report
Evidence: export const PULL_ACCOUNT_SIZE = 220n;
a change to the account layout silently breaks the filters that use these copies.
export the constants once from the client package.
From the report
Evidence: function bytesEqual(a: Uint8Array, b: Uint8Array): boolean {
maintenance drift across six copies.
use one shared helper.
From the report
Evidence: buildUpgradePlan has the same body as buildDeployPlan.
a fix applied to one copy will not reach the other.
keep one builder.
From the report
Evidence: function networkFromRpcUrl(rpcUrl: string) also exists in two other files.
the copies already behave differently on a corrupt file. The RPC URL is also hard-coded seven times.
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)
From the report
Evidence: export const ROUND_WEIGHT … = [1, 2, 4, 8, 16, 8];
if the program changes, the UI shows wrong scores and no test fails.
add a shared fixture that both the Rust and TypeScript test suites check.
games/gacha/pinocchio/webapp/src/server/orchestrate-pull.ts:219 (line corrected on review; the report cites :221)From the report
Evidence: if (pull.status === PULL_STATUS_PENDING) { … settlePendingPull(…)
if that one request fails, the pull waits for a manual crank or a refund.
queue pending pulls and run a durable settle worker.
.github/workflows/just.yml:111From the report
Evidence: just setup / just check-generated / just build / just test
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.
add those checks to the root workflow, or move the nested workflows to the root with path filters.
From the report
Evidence: if let Err(e) = generate_idl() { println!("cargo:warning=…") }
the generated-code check passes with a stale committed IDL. Every build also rewrites the IDL, regardless of GENERATE_IDL.
generate only when asked, and fail the build in that mode.
From the report
Evidence: just webapp-run is documented, but the justfile has no webapp-run, no webapp-clean and no surfnet-setup runbook.
the documented local flow, and the faucet, validator and deploy features that depend on it, cannot work.
add the recipes and the runbook, or remove the references.
From the report
Evidence: await clearConfig(NETWORK);
the "idempotent" setup deletes the user's other saved tokens on every run.
update only the entries the script owns, and write atomically.
Review: ` at :50 keeps the program address and clears tokens; dev script)
basics/account-data/native/cicd.sh:7From the report
Evidence: cargo build-sbf … followed by solana program deploy ./program/target/so/program.so
a failed build deploys a stale binary to whatever cluster the CLI points at. The same script is copied into about 50 examples.
add set -euo pipefail, print the target cluster, and verify the deployed program afterwards.
From the report
Evidence: if (fs.existsSync(fileName)) fs.unlinkSync(fileName);
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.
refuse to overwrite without a flag, and write the file with owner-only permissions.
From the report
Evidence: cat << 'EOF' > build_and_test.sh … function build_and_test() {
every fix has to be ported by hand to three other workflows.
use one reusable workflow or composite action.
.github/workflows/anchor.yml:238From the report
Evidence: failed_projects=$(cat $GITHUB_WORKSPACE/failed_projects.txt | jq …)
the other three copies guard this read with an existence check. Here the reporting step can itself fail.
share one guarded step.
.github/actions/setup/action.yml:188From the report
Evidence: sh -c "$(curl … install)" with no second version check.
a wrong toolchain can still pass the gate.
re-read the version after reinstalling, and fail on a mismatch.
.github/actions/setup/action.yml:169From the report
Evidence: run: sh -c "$(curl -sSfL https://release.anza.xyz/…/install)"
the installer is trusted by its URL alone.
download it, verify a pinned hash, then run it.
games/gacha/pinocchio/justfile:79From the report
Evidence: git diff --quiet -- {{generated_paths}} covers paths that are git-ignored.
the check certifies only the IDL, not the generated clients.
build and test the regenerated clients instead.
games/gacha/pinocchio/justfile:145From the report
Evidence: curl -sfL "{{proving_keys_cdn}}/$key" -o "$keys_dir/$key"
the CHECKSUM file is fetched but never compared, and a truncated download is treated as present on the next run.
download to a temporary file, verify, then rename.
games/gacha/pinocchio/justfile:163 (line corrected on review; the report cites :161)From the report
Evidence: nohup "$prover_bin" start … --prover-address 0.0.0.0:3001
a stale prover of another version is silently reused, and the prover listens on all interfaces.
record the PID, check the version, stop it on exit, and bind to 127.0.0.1.
games/gacha/pinocchio/justfile:214From the report
Evidence: solana program deploy target/deploy/gacha_program.so …
nothing confirms that the deployed bytes or the upgrade authority are the intended ones.
dump the deployed program and compare its hash with the build, and check the authority.
games/world-cup/pinocchio/justfile:138From the report
Evidence: curl -sf … -o "$out" && break followed by echo "✓ Saved $out"
success is printed for a file that was never written.
check the result and fail when the download did not succeed.
From the report
Evidence: const candidates = context.outputQueue === context.authorityQueue ? …
each copy behaves differently, so a fix to one does not reach the others.
move it into one function in the client package.
From the report
Evidence: const vrfAuthorityFrozenOffset = 32 + 32 + 1;
a layout change will silently break one of the copies.
reuse the decoder.
From the report
Evidence: const GACHA_ID = 'Bv65…' as Address;
a redeploy under a new id updates the client package but not this copy.
import the exported program address.
From the report
Evidence: const PROGRAM_ADDRESS = 'wCup…';
a program id change has to be made by hand in each place.
export the id once and import it everywhere.
From the report
Evidence: export const CHUNK_SIZE = 900;
the server and browser copies mark the authority account differently, and most of the browser copy is unused.
keep one builder module.
From the report
Evidence: export function shortenAddress(addr: string)
the UI formats addresses inconsistently.
keep one formatter and delete the dead code.
From the report
Evidence: const soHash = crypto.createHash('sha256')…
the deploy path ships the buffer without confirming its integrity.
read the buffer back and compare its hash and size before deploying.
From the report
Evidence: console.error( ✗ failed to settle ${pubkey}:, err);
each retry rebuilds an expensive proof, and the log fills with repeats instead of one actionable line.
count failures per pull, back off, and quarantine pulls with non-retryable errors.
From the report
Evidence: echo ":x: Beta: build or tests failed (non-blocking)" >> $GITHUB_STEP_SUMMARY
nobody who is not watching the run learns of the failure.
open or update a tracking issue, or fail a separate non-required check.
From the report
Evidence: fs.writeFileSync(outputPath, JSON.stringify(output, null, 2));
the output path can be the input snapshot itself.
refuse to overwrite without a flag.
From the report
Evidence: await $solana program dump ${id} ${outputFile};
an upgradeable program makes the tests non-reproducible.
pin and verify the hash.
From the report
Evidence: only three program-level tests exist.
defects such as findings 137–139 go uncaught.
add a test that runs the UI's send, mint and mode flows against the built program.
From the report
Evidence: const DAS_URL = process.env.NEXT_PUBLIC_DAS_RPC;, beside a comment saying the endpoint carries a credential.
NEXT_PUBLIC_ values are inlined into the browser bundle. Any visitor can extract the key and spend the paid quota.
keep the URL server-side and proxy requests through an API route.
From the report
Evidence: let diff = lamports_required - target_account.lamports();
overflow checks are on. Anyone who sends a few lamports to the account makes this subtraction abort every time.
use saturating_sub and skip the transfer when the difference is 0.
From the report
Evidence: let diff = lamports_required - target_account.lamports();
same denial of service as finding 92, and neither resize path checks the owner.
use saturating arithmetic, plus owner and signer checks.
From the report
Evidence: .equ INSTRUCTION_DATA_LEN, 0x7938 / .equ INSTRUCTION_DATA, 0x7940
if the recipient account holds data, every later offset shifts and the transferred amount is read from the wrong bytes.
walk the input buffer using each account's data length, and check that the data is exactly 8 bytes.
From the report
Evidence: an ed25519 secret-key array beginning [211. lever-keypair.json holds the same kind of secret.
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.
generate keys per environment and keep them out of version control.
scripts/lib/command-update.ts:21From the report
Evidence: execSync(npm view ${pkgName} version)
dependency names come from every package.json in the repo, including contributed ones. A crafted name runs commands on the maintainer's machine.
call execFileSync('npm', ['view', pkgName, 'version']) with no shell, and validate the names.
scripts/lib/command-list.ts:4From the report
Evidence: export function commandList(path: string) {
the help text shows list with no argument, but that call passes undefined to readdirSync and throws.
default path to '.'.
From the report
Evidence: let bump_bytes = instruction_data[0].to_le_bytes();
create accepts any bump from the client, but close accepts only the canonical one.
derive the canonical bump on chain at creation.
basics/favorites/pinocchio/program/src/instructions/create_pda.rs:18 (line corrected on review; the report cites :19)From the report
Evidence: let bump = data[0];
the bump is supplied by the client, so one user can hold several valid records.
use the canonical bump and store it in the account.
From the report
Evidence: … &[page_visits.bump]]],)?; Ok(())
the supplied values are dropped, and the account stays zeroed with a bump of 0.
serialize the state after creating the account.
From the report
Evidence: let bump_bytes = &instruction_data[4..5];
same as finding 103. The bump is also supplied by the client.
same as finding 103, and derive the bump on chain.
From the report
Evidence: _ => { msg!("Error: unknown instruction") } … Ok(())
a wrong discriminator silently does nothing, and the transaction still succeeds.
return InvalidInstructionData.
From the report
Evidence: _ => { log!("Error: unknown instruction"); }
same as finding 105.
same as finding 105.
From the report
Evidence: new anchor.web3.PublicKey('CNftyK7T8…'), while the program declares Fd4iwp…. Line 7 loads '~/.config/solana/id.json'.
the scripts derive addresses for another program. Node does not expand ~, so they also fail at import.
read the id from the IDL or Anchor.toml, and expand the home directory explicitly.
From the report
Evidence: if settle_deadline_slots == 0 { return Err(…) }
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.
enforce a maximum on chain, and show the deadline before purchase.
From the report
Evidence: export async function POST(request: Request) calls orchestratePull(…) with the operator as payer.
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.
add rate limiting, and require the entry fee to be at least the per-pull cost.
From the report
Evidence: /// who withholds a reveal … can delay a payout, but can never keep the buyer's funds.
the operator sees each outcome before settling and can skip rare prizes, which skews the real odds. The UI still claims "provably fair".
force or penalise the reveal on the deadline, or use randomness the operator cannot pre-compute.
From the report
Evidence: create_pda_account(accounts.buyer, accounts.pull, …). Only the refund path closes the account.
settled and claimed pulls lock the buyer's rent forever.
add a close instruction for claimed pulls.
From the report
Evidence: const pools = await discoverPools(client); return pools[0] ?? null;
anyone can create a pool. Without the env setting, users sign buys that the server then rejects.
expose the server's configured pool to the client.
games/world-cup/pinocchio/program/src/instructions/finalize.rs:60 (line corrected on review; the report cites :51)From the report
Evidence: config.check_admin(accounts.admin.address())?;
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.
add a permissionless refund after a deadline, and separate the result authority from entrants.
From the report
Evidence: Config::init(&mut config_data, config_bump, accounts.admin.address(), …)
a front-runner can take control of the whole pot right after deployment.
require the upgrade authority or a fixed key.
From the report
Evidence: url.pathname === '/api/setup/save-config' and existing.networks[network] ?? …
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__.
check Origin, require JSON or a token, and allow-list network names.
From the report
Evidence: const response = await handleRequest(request); with no try/catch.
extractFields throws, and the unhandled rejection terminates the server and the validator it manages.
catch errors at the top level and return 400 or 500.
From the report
Evidence: CreateAccount { from: self.authority, to: self.config, … and config.authority = *self.authority.address();
whoever calls first becomes the global authority, and pre-funding the address blocks initialisation entirely.
gate initialisation on the deployer, and handle pre-funded addresses.
From the report
Evidence: CreateAccount { from: self.authority, to: self.extra_metas,
once setup fails, transfers of that mint cannot run.
top up, allocate and assign when the address already holds lamports.
From the report
Evidence: if self.admin_config.is_initialised { require_keys_eq!(…) }
the first caller controls every wallet's transfer switch.
restrict the first call to the deployer.
From the report
Evidence: create_account(CpiContext::new(…
the mint's validation account can never be created, so every transfer of that mint fails.
use Anchor init, or transfer, allocate and assign.
From the report
Evidence: Config { authority: self.payer.key(), … }
whoever initialises first controls the wallet lists of every mint that uses this hook.
gate it on the deployer.
From the report
Evidence: #[account(init, seeds = [b"counter"], …)]
setting up a second mint fails with "account already in use". transfer-cost has the same pattern.
key the counter by mint.
From the report
Evidence: /// CHECK: Make sure the ata to the mint is actually owned by the signer sits above pub mint: AccountInfo<'info>,
the check the comment describes does not exist. The program signs a metadata update for any mint passed in.
require the signer's token account for that mint, holding a balance of 1.
From the report
Evidence: let bump = MintAuthorityPda::deserialize(…)?.bump;, after which MintTo runs for any caller.
a racer can take a one-of-one NFT between its creation and the creator's mint.
record the creator and require their signature, or create and mint in one instruction.
From the report
Evidence: if associated_token_account.lamports() == 0 { … } else { msg!("…exists.") }
same race as finding 129, and an existing destination account is never tied to the payer.
bind the mint to the creator and check the destination account.
From the report
Evidence: CreateAccount { from: payer, to: mint_authority,
one lamport sent to the fixed address bricks initialisation, and with it every later mint.
handle pre-funded addresses.
tokens/escrow/native/program/src/instructions/take_offer.rs:204 (line corrected on review; the report cites :202)From the report
Evidence: **payer.lamports.borrow_mut() += lamports;
the maker funded the offer and vault rent, but it goes to the taker's chosen payer.
return the rent to the maker.
From the report
Evidence: payer.set_lamports(new_payer_lamports);
same as finding 132.
same as finding 132.
From the report
Evidence: let pool_creation = pool_a.amount == 0 && pool_b.amount == 0; and a later .checked_div(pool_a_u128).unwrap()
one stray token transfer causes a division-by-zero panic or a zero-liquidity path, and the pool can never be used.
track initialisation in state, and return errors instead of unwrap.
From the report
Evidence: self.fundraiser.current_amount -= …; Ok(()). The account is closed only on success.
the maker's single fundraiser slot and its rent are locked forever.
add a close path after the deadline for failed campaigns.
From the report
Evidence: amount >= MIN_AMOUNT_TO_RAISE.pow(self.mint_to_raise.decimals as u32). contribute.rs:61 uses 1_u64.pow(…).
the minimum target is 3^decimals rather than 3 whole tokens, and the contribution minimum is always 1.
use MIN × 10^decimals with checked arithmetic.
tokens/token-2022/transfer-hook/allow-block-list-token/src/components/abl-token/abl-token-config.tsx:205 (line corrected on review; the report cites :187)From the report
Evidence: remove is kept only for existing wallets, then .filter(entry => !existingAddresses.has(entry.address)) drops them.
a blocked wallet can never be unblocked through CSV.
exempt removals from the final filter.
tokens/token-2022/transfer-hook/allow-block-list-token/src/components/abl-token/abl-token-ui.tsx:248From the report
Evidence: const [address, mode] = row.split(',')…; mode.toLowerCase()
any row without a comma throws, and the whole upload is lost.
validate each row and report the bad ones.
tokens/token-2022/transfer-hook/allow-block-list-token/src/components/account/account-ui.tsx:174From the report
Evidence: amount: parseFloat(amount),, then BigInt(amount) in account-data-access.tsx:102.
typing 1 on a 6-decimal token sends 0.000001, and typing 1.5 throws.
convert decimals to base units using the mint's decimals.
.github/actions/setup/action.yml:247From the report
Evidence: cargo install --git https://github.com/coral-xyz/anchor avm --force
CI is not reproducible, and a broken or compromised upstream commit breaks every Anchor job.
pin a tag or commit and use --locked.
From the report
Evidence: await verifySettle(…); return; } catch (err) {
when verification lags the indexer, the script resends an already settled pull and finally throws a misleading error.
verify outside the send loop, and never resend after a confirmed signature.
From the report
Evidence: writeFileSync(OPERATOR_KEYPAIR_PATH, JSON.stringify(Array.from(secretKey)));
the key is both the signing key and the randomness key. Anyone who can read it can forge reveals.
write with mode 0o600 into a directory with mode 0o700 (also burst-randomness.ts:239).
From the report
Evidence: await $solana config set -um;, which runs from postinstall.
a later deploy script that relies on the CLI's setting spends real SOL on mainnet. The same line is in 8 examples.
pass the cluster explicitly to the one command that needs it.
From the report
Evidence: console.warn(Skipping invalid entry …)
a root can be published that excludes recipients, and the script still exits 0.
fail on invalid entries unless explicitly overridden, and print the counts in and out.
From the report
Evidence: sendAndConfirm(signedTransaction, { …, skipPreflight: true });
failing transactions land on chain, cost fees and surface only as opaque errors.
remove skipPreflight.
From the report
Evidence: const _re = svm.sendTransaction(tx);
LiteSVM returns failures as values instead of throwing, so these tests (about 27 such calls across 13 files) cannot fail on a failed transaction.
assert that the result is not a failure.
From the report
Evidence: hostname: '**',
image URLs come from on-chain metadata that anyone can write, so the deployed server becomes an open image proxy.
allow-list the specific gateways, or render these images unoptimised.
From the report
Evidence: <nav className="hidden items-center gap-1 md:flex">
on narrow screens there is no replacement navigation.
add a mobile menu.
From the report
Evidence: label={tier reproduced from beta → … (matches recorded)}
a failed fairness check is shown next to reassuring text.
build the label from tierOk.
games/world-cup/pinocchio/webapp/src/components/account/account-ui.tsx:51 (also line 122, and tokens/token-2022/transfer-hook/allow-block-list-token/src/components/account/account-ui.tsx:32)From the report
Evidence: {query.data?.value ? <BalanceSol …/> : '...'}
an empty wallet shows "..." forever.
check for undefined instead of truthiness.
From the report
Evidence: useGetToken(toAddress(tokenAddress)); during render.
a bad URL throws during render instead of showing an error state. Line 30 has the same problem.
validate the address and render an error message.
From the report
Evidence: <tr key={wallet.address || String(index)}>
each keystroke remounts the row, so addresses cannot be typed in by hand.
give each row a stable id.
tokens/token-2022/transfer-hook/allow-block-list-token/src/components/abl-token/abl-token-ui.tsx:41 (line corrected on review; the report cites :40) (also tokens/token-2022/nft-meta-data-pointer/app/components/MintNftButton.tsx:42)From the report
Evidence: console.error('Invalid form data:', err);
users get no feedback when an action fails.
show errors and results in the UI.
From the report
Evidence: getAssetsByOwner(signer.address); with no cancellation or catch.
a slow response for the old wallet overwrites the new wallet's list, and failures become unhandled rejections.
cancel stale requests in effect cleanup, and catch errors.
Info after review (5)
From the report
Evidence: autoConnect: true,
on an insecure origin, auto-connect fails silently.
detect an insecure origin on load and explain it to the user. Deploy only over HTTPS.
From the report
Evidence: let mint_type_byte = data[TYPE_BYTE_OFFSET]; comes before the length check.
a short (legacy) mint panics instead of returning a clear error.
check the owner program and data.len() before indexing.
From the report
Evidence: const body: unknown = await request.json();
the 4 KB limit is checked only after the whole body has been parsed.
check Content-Length and read with a hard limit before parsing.
Review: `)
From the report
Evidence: if (!programDeployed && !deployingProgram) { void deployProgramViaSurfnet(); }
each poll starts a new deploy attempt and logs another error.
rate-limit the attempts and return the last error in the status response.
From the report
Evidence: const RPC_PATH = ''; while the vault example's copy holds a URL.
the copies are standalone by policy but have drifted, and they swallow errors.
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.
- 18. Tally-reset code that can never run (wrong): Shown wrong on review.