Security Audit V3 — 71 findings (10 Critical, 20 High, 23 Medium, 18 Low) #38
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Security Audit V3 — 71 Findings
Full audit document:
SECURITY_AUDIT_V3.md(committed ondevelopment)Audit date: 2026-03-02 | Scope: development HEAD
267be5fAudited areas: 14 smart contracts, gateway server + client, SDK, CLI, Rhai engine, provision/cluster infrastructure, Docker, CI
Summary
Critical (fix before any production use)
run_command/run_command_output/env_varregistered in Rhai engine — full RCE via any.rhaiscriptAccountderivesDebug— private key leaks in any{:?}format, panic, or debug logheroledger infoprints 40 chars of private key to stdout--secret-key/--mnemonicvisible in/proc/<pid>/cmdlinechmod 0600— world-readableHEROLEDGER_VAULT_SECRET+SENDGRID_API_KEYwritten as plaintext env vars into zinit service configline_indexVectors all shareStorageKey::LineIndex— data corruption across all usersapproval_indexVectors all shareStorageKey::ApprovalIndex— cross-user approval corruptionAny/Any/Any) — same vulnerability as the deleted relayer, never ported to gatewaygateway.submitTransactionaccepts arbitrary user-crafted NEAR transactions — whitelist model bypassed entirelyHigh (fix before external user onboarding)
branch = "development"— supply chain injection risk(deposit_near * 1e24) as u128parse_nearreturnsi64— overflows and goes negative for amounts > ~9 NEARContractBuilder::deployreturns"deployed:<account>"instead of real tx hashb"x"byte literal storage key prefixes — collision riskstd::HashSetin NEAR storage — gas DoS for accounts with many group membershipsft_on_transferreturnsStringnotPromiseOrValue<U128>— NEP-141 violation, funds never landft_on_transferreturns bareU128notPromiseOrValue<U128>claim_refund/withdraw_feeshave no rollback callback — funds lost on failed token transfersla_settle_periodcallable by anyone with fabricated data — SLA forgeryassert_one_yocto()onwithdraw,spend,claim_refund,sla_stake_withdrawfund_accounthas no access control — faucet drainable by anyone0.0.0.0in dev mode — bypasses gateway auth entirely:2— supply chain via image repointing:latest,ubuntu:24.04) — not pinned to digestgateway.submitTransactionbypasses rate limiter — DoS amplificationdomainin HTML email confirmation pagereqwest::Clienthas no timeoutsMedium and Low
See
SECURITY_AUDIT_V3.mdfor the full list of 23 Medium and 18 Low findings covering:payeeparam, wrong view method name).expect()panics in callbacks, unboundedHashMapinset_records)Relationship to V2 Audit (PR #37)
PR #37 was closed because
developmentdiverged ~50 commits after the PR was opened (architectural shift: relayer → gateway). This issue supersedes it.V2 findings resolved independently on
development: CRIT-05, HIGH-08, MED-01, MED-06, MED-09, MED-17 (and partial fixes for others).All remaining open V2 findings are carried forward in V3 with updated IDs.