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.
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.
| Surface | What it includes | Public example |
|---|---|---|
| Frontends | Web app, hosted bundle, CDN, third-party scripts | Malicious JavaScript on app.safe.global targeted Bybit's signers (2025) |
| APIs and backends | Services that build, sign or relay transactions | Guardian found a Synthetix keeper endpoint that let anyone trigger vault actions |
| Cloud | Accounts, IAM, storage, secrets, databases | Mixin: cloud provider's database attacked, about $200M (2023) |
| CI/CD and supply chain | Pipelines, packages, published SDKs and extensions | Ledger Connect Kit (2023); Trust Wallet extension 2.68 (2025) |
| Keys and signers | Hot wallets, multisigs, KMS, signing services | Bybit: about $1.5B stolen, which the FBI attributes to North Korea |
| People | Staff devices, accounts and inboxes | A compromised Safe{Wallet} developer machine, per Safe (2025) |
| Vendors | Wallet UIs, registrars, cloud and RPC providers | Registrar Gandi SAS socially engineered, per CoW (2026) |
| Domains and DNS | Registrar, DNS, certificates, subdomains | cow.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 audit | Offchain security testing | |
|---|---|---|
| Target | Contract code at a commit | Running apps, cloud, keys, people and vendors |
| Question | Can the code break its own rules? | What can an attacker reach, sign or steal? |
| Method | Manual review, fuzzing, invariants | Pentests, OpSec review, configuration review |
| Cadence | Before each release | Continuous, 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.
| Level | What is true | Typical gap |
|---|---|---|
| 1. Inventoried | Every key, domain, account, vendor and pipeline has an owner | Forgotten subdomains; departed signers whose keys still work |
| 2. Hardened | Hardware-key MFA, least privilege, registrar locks, on-device signing checks | SMS fallbacks; one key holding several roles |
| 3. Tested | Each surface pentested, with every fix retested | Testing that stops at the contracts |
| 4. Watched | Changes detected and answered around the clock | Alerts 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
- List every key that can move funds or change contracts, and who holds it.
- Require hardware security keys on cloud, code host, registrar and signer accounts.
- Verify every admin transaction on the signing device, not the web page.
- Lock your registrar and DNS, and alert on any change.
- Pin dependencies, and control who can publish your builds, SDKs and extensions.
- Pentest the systems that build or sign transactions, then retest the fixes.
- 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
- Guardian: Onchain vs Offchain Attacks, Where Hack Losses Came From (November 2026)
- Guardian: Web2, The Hidden Layer of DeFi Risk (May 2025)
- Guardian: Web3 Pentest Findings in DeFi Backends, Keepers and Cloud (November 2026)
- Guardian: Wallet Frontend Security, Signing Interfaces After Bybit (November 2026)
- Guardian: Web3 Penetration Testing Explained (November 2026)
- Guardian: Synthetix Auto-Compound LP Vault case study
- Chainalysis: $2.2 Billion Stolen from Crypto Platforms in 2024 (December 19, 2024)
- FBI (IC3): North Korea Responsible for $1.5 Billion Bybit Hack (February 26, 2025)
- BleepingComputer: Lazarus Hacked Bybit via Breached Safe{Wallet} Developer Machine (February 26, 2025)
- TechCrunch: Hackers Steal $200 Million From Crypto Company Mixin (September 25, 2023)
- Ledger: Letter on the Ledger Connect Kit Exploit (December 14, 2023)
- Trust Wallet: Browser Extension v2.68 Incident Community Update (December 30, 2025, updated July 17, 2026)
- CoW DAO Forum: CIP-86, Discretionary Grants Program for Victims of the cow.fi Domain Hijacking (April 23, 2026)
- NIST CSRC: Glossary, Penetration Testing (definition from NIST SP 800-115)
Cover the surface around your contracts
Guardian pentests and watches the keys, signers, cloud, frontends and domains that most losses now run through.