Rust Smart Contract Audit

A Rust audit is a security review of blockchain code written in Rust — Solana programs, NEAR contracts, Substrate pallets or CosmWasm modules — focused on the bugs the borrow checker cannot see: missing signer and ownership checks, account confusion, arithmetic that silently wraps in release builds, and runtime-specific privilege escalation.

Why Rust code needs a specialist review

Rust removes an entire category of exploit — use-after-free, data races, buffer overruns — and teams frequently over-read that guarantee. Memory safety is not authorisation. The critical findings in Rust blockchain code are almost always semantic: an account accepted without checking who owns it, a PDA derived with a non-canonical bump, a pallet extrinsic whose declared weight is below its real cost, a CosmWasm entry point missing its sender check.

Our Rust reviews are runtime-aware. Solana code is read against the account model and Anchor's constraint semantics; Substrate against origins, weights and storage growth; NEAR against cross-contract callback resolution and gas attachment. Beneath all of it we audit the Rust itself: every unsafe block, every unwrap on untrusted input, and every arithmetic operation that behaves differently in release than in debug.

Rust-specific security considerations

Arithmetic in release builds

Overflow panics in debug and wraps in release unless overflow-checks is set. Silent wrapping in balance maths is one of the highest-impact bug classes we find in Rust chains.

unwrap, expect and panic surfaces

Panics on attacker-controlled input, which in runtime context can mean an aborted transaction at best and a halted chain at worst.

unsafe blocks and FFI boundaries

Every unsafe block reviewed for the invariant it is assuming, plus any zero-copy deserialisation that trusts untrusted bytes.

Account and ownership validation

is_signer, program ownership, account discriminators, and the substitution attacks that follow when any of them is skipped.

Serialisation and type confusion

Borsh and bincode decoding of untrusted input, length fields taken on trust, and struct layouts reinterpreted as the wrong type.

Dependency and build supply chain

cargo-audit over the dependency tree, unpinned versions, build.rs behaviour, and features that change security-relevant defaults.

Tooling we run on Rust

How the engagement runs

  1. Scoping and threat modelling

    We fix a commit hash, agree the in-scope contracts and read your architecture docs, then build a threat model: who the actors are, what the trust boundaries are, and which invariants must never break. Nothing is reviewed against assumptions we have not written down.

  2. Manual review

    Line-by-line review by at least two auditors working independently, focused on authorisation, accounting, upgrade paths, external integrations and the gap between what the code does and what the documentation claims it does. Most critical findings come from this phase, not from tooling.

  3. Static and dynamic analysis

    Static analysers appropriate to the language, plus property-based fuzzing and invariant testing to push the system into states no unit test covers. Tooling is used to widen coverage, never to replace the manual pass.

  4. Exploit-path simulation

    Candidate findings are proven on a forked network with a working proof of concept. We report what an attacker can actually do and what it costs them, not a theoretical severity label.

  5. Reporting

    Every finding gets a severity rating, reproduction steps, the affected code, the impact in concrete terms and a specific remediation. You get a draft for discussion before anything is finalised.

  6. Fix review and re-test

    We re-test every remediation against the original proof of concept and check that the fix has not opened a new path. The final report is yours to publish.

What you receive

Rust audit: frequently asked questions

Rust is memory-safe — do we still need an audit?

Yes. Memory safety eliminates one bug class and none of the others. Every large Rust chain exploit we have studied was an authorisation, accounting or account-validation failure, all of which compile perfectly.

Do you review unsafe blocks specifically?

Every one. We ask what invariant the block assumes, whether an attacker can violate it, and whether the safe wrapper around it actually enforces it.

Which Rust ecosystems do you cover?

Solana (Anchor and native), NEAR, Substrate/Polkadot FRAME pallets, CosmWasm, and standalone Rust services such as relayers, keepers and indexers that hold keys.

Do you check our dependencies?

Yes — cargo-audit across the tree, plus a manual look at any dependency in the trust path for a security decision. A vulnerable crate in your signing path is your vulnerability.

What do you need from us to start an audit?

A repository or contract address, a commit hash to freeze the scope, whatever architecture or spec documentation exists, and a point of contact who can answer design questions. If documentation is thin we will write our understanding of the system back to you and ask you to confirm it — that step alone catches design-level bugs.

How long does an audit take?

A single token contract is 24–48 hours. A typical dApp or mid-sized protocol runs one to two weeks. Large DeFi systems, L2s, bridges and ZK circuits are scoped per project after we have seen the code. We will give you a fixed timeline with the quote, not an estimate that moves.

Is a re-test included after we fix the issues?

Yes. Fix review is part of the engagement, not an upsell. We re-run the original proof of concept against your patched code and confirm the fix has not introduced a new path.

Chains that run Rust

Related security services

Get a fixed quote in 24 hours

Send the repository and a commit hash through the contact form, message @bugtester25 on Telegram, or book a 30-minute scoping call. 200+ protocols audited · $4B+ secured · 0 hacks post-audit. Prefer email? info@safeedges.in.