$1,000,000 in security audit grants are live now, Apply here →

← Resource Hub

What Is Offchain Security? The Attack Surface Audits Miss

By the Guardian team Updated 5 min read

What Is Offchain Security? The Attack Surface Audits Miss

Quick answer. Offchain security protects everything around the smart contracts that can move funds or change what users sign. That means frontends, APIs and backends, cloud, CI/CD and dependencies, keys and signers, people, vendors, and domains and DNS.

Watch: What Is Offchain Security? The Attack Surface Audits Miss 1:45
Video transcript

A smart contract audit covers the code that holds the money. Most of the money lost recently came from somewhere else.

In Guardian's analysis of DefiLlama data, keys, signers, infrastructure and people caused 72 to 74 percent of reported losses in 2024 and 2025, and 82 percent in 2026 so far.

Offchain security protects every system outside the chain that can move funds, change contracts, or change what users and signers see.

Eight surfaces sit around a typical protocol: frontends, APIs and backends, cloud, build pipelines, keys and signers, people, vendors, and domains and DNS.

Each one has a public example, from Mixin's cloud provider to Ledger Connect Kit to CoW's hijacked domain in 2026.

These surfaces chain together. At Bybit, a vendor's developer machine led to a tampered frontend, and signers approved a disguised transaction. The contracts worked as written. About 1.5 billion dollars was stolen.

An audit reads contract code at a fixed commit. Offchain testing attacks running systems, asking what an attacker can reach, sign or steal. Most teams that hold funds need both.

Maturity has four levels. Inventory every key, domain and vendor. Harden accounts with hardware keys. Test each surface and retest fixes. Then watch around the clock.

Guardian covers both sides, from offchain pentests to Managed Security after launch. Read the full guide, or talk to Guardian at guardian.security.

A smart contract audit covers the code that holds the money. Most of the money lost recently came from somewhere else.

In Guardian's analysis of DefiLlama data, keys, signers, infrastructure and people caused 72% to 74% of reported losses in 2024 and 2025, and 82% in 2026 so far.

This guide defines offchain security, maps the whole surface, and points to the posts that go deep on each part.

Offchain Security Defined

Offchain security is the protection of every system outside the chain that can move funds, change contracts, or change what users and signers see.

Onchain security covers the deployed code and its economic design. Offchain security covers what that code trusts: the keys that sign, the servers that build transactions, and the pages people sign through.

Our onchain vs offchain analysis uses a root-cause test. Did the attacker need a flaw in deployed code, or control of something around it?

Much of it is Web2 security applied to crypto. As our post on the Web2 layer of DeFi risk put it, "Whoever controls the calldata controls the world."

The Full Offchain Attack Surface

Eight surfaces sit around a typical protocol or exchange. Each has a public example.

SurfaceWhat it includesPublic example
FrontendsWeb app, hosted bundle, CDN, third-party scriptsMalicious JavaScript on app.safe.global targeted Bybit's signers (2025)
APIs and backendsServices that build, sign or relay transactionsGuardian found a Synthetix keeper endpoint that let anyone trigger vault actions
CloudAccounts, IAM, storage, secrets, databasesMixin: cloud provider's database attacked, about $200M (2023)
CI/CD and supply chainPipelines, packages, published SDKs and extensionsLedger Connect Kit (2023); Trust Wallet extension 2.68 (2025)
Keys and signersHot wallets, multisigs, KMS, signing servicesBybit: about $1.5B stolen, which the FBI attributes to North Korea
PeopleStaff devices, accounts and inboxesA compromised Safe{Wallet} developer machine, per Safe (2025)
VendorsWallet UIs, registrars, cloud and RPC providersRegistrar Gandi SAS socially engineered, per CoW (2026)
Domains and DNSRegistrar, DNS, certificates, subdomainscow.fi hijacked; about 1.2M USDC taken (2026)

The surfaces chain together. At Bybit, a vendor's developer machine led to a tampered frontend, which led signers to approve a disguised transaction.

Our guide to signing interface security covers that path and the controls that close it.

Why It Drives Most Losses

By value, offchain attacks dominate. Our DefiLlama analysis found code exploits are the majority of incidents every year, and offchain compromises the majority of dollars.

One event skews 2026: Binance is 72% of the year's total. Without it, and filing incidents by root cause, offchain is still 63%.

Chainalysis found that private key compromises were the largest share of crypto stolen in 2024, at 43.8%.

The split is closer for DeFi protocols alone. Without exchanges, contract exploits were the larger share of 2025 losses in our data, so both sides need cover.

Three reasons recur:

  • Valid signatures: at Bybit, the contracts worked as written. The signers were deceived.
  • Short paths: one cloud credential or signing key can reach funds directly.
  • Less scrutiny: offchain systems change fast and are rarely audited like contracts.

How Testing Differs From an Audit

An audit reads contract code at a fixed commit. It asks whether the code can break its own rules.

Offchain testing attacks running systems. NIST describes penetration testing as security testing in which evaluators "mimic real-world attacks" to get around a system's security features.

Smart contract auditOffchain security testing
TargetContract code at a commitRunning apps, cloud, keys, people and vendors
QuestionCan the code break its own rules?What can an attacker reach, sign or steal?
MethodManual review, fuzzing, invariantsPentests, OpSec review, configuration review
CadenceBefore each releaseContinuous, as systems and staff change

Most teams that hold funds need both. Our guide to web3 penetration testing covers scope and method.

For what these tests find, read our offchain pentest findings report. The largest groups are offchain math that drifts from the chain, lost or raced messages, unvalidated inputs and missing rate limits.

A Maturity Model

Four levels show where a team stands. Each builds on the one before.

LevelWhat is trueTypical gap
1. InventoriedEvery key, domain, account, vendor and pipeline has an ownerForgotten subdomains; departed signers whose keys still work
2. HardenedHardware-key MFA, least privilege, registrar locks, on-device signing checksSMS fallbacks; one key holding several roles
3. TestedEach surface pentested, with every fix retestedTesting that stops at the contracts
4. WatchedChanges detected and answered around the clockAlerts nobody owns at 3 AM

Levels 1 and 2 are mostly internal work. Levels 3 and 4 need outside testers and someone on call.

Where to Start

  1. List every key that can move funds or change contracts, and who holds it.
  2. Require hardware security keys on cloud, code host, registrar and signer accounts.
  3. Verify every admin transaction on the signing device, not the web page.
  4. Lock your registrar and DNS, and alert on any change.
  5. Pin dependencies, and control who can publish your builds, SDKs and extensions.
  6. Pentest the systems that build or sign transactions, then retest the fixes.
  7. Write the incident response down and rehearse it before you need it.

How Guardian Covers It

Guardian's audits and pentests cover both sides. The offchain engagements are infrastructure, web app, API, browser extension and offchain automation pentests, plus SDK and OpSec audits.

The offchain department is led by Carlos Polop, creator of HackTricks and the PEASS privilege escalation suite.

Managed Security covers what comes after launch. Guardian maps every path to your funds and reviews every multisig transaction before it is signed.

Shield covers everything you have facing the internet, and Sentry watches your domains, DNS, certificates, cloud and code host.

Frequently Asked Questions

What is offchain security in crypto?

It is the protection of every system outside the chain that can move funds or change what users sign. That includes frontends, backends, cloud, pipelines, keys and signers, people, vendors and domains.

What is the difference between onchain and offchain security?

Onchain security covers deployed contract code and its economic design. Offchain security covers what that code trusts: keys, signers, servers, cloud, frontends and the people who run them.

Does a smart contract audit cover offchain risk?

No. An audit reviews contract code at a commit. Keys, signers, cloud, frontends and vendors need offchain pentests, operational security review and monitoring.

Are most crypto losses offchain?

By value, yes. In Guardian's analysis of DefiLlama data, keys, signers, infrastructure and people caused 72% to 74% of reported losses in 2024 and 2025, and 82% in 2026 so far.

Sources

Cover the surface around your contracts

Guardian pentests and watches the keys, signers, cloud, frontends and domains that most losses now run through.