← All posts
OWASPVulnerabilitiesBusiness Logic

SC02: Business Logic Vulnerabilities, the Bugs No Scanner Can Find

Security Wiz team3 min read

ShareTelegramX

Second on the OWASP Smart Contract Top 10 for 2026 is SC02, business logic vulnerabilities. These are the flaws where the code runs, passes its tests, and does exactly what it was written to do, and what it was written to do is wrong. Think of a store coupon that was never meant to be used twice, with nothing at the register to stop you. The register is working perfectly. The rule has a hole in it.

Why scanners miss them

An automated scanner looks for known warning signs: a missing check, a risky call to another contract, a dangerous instruction. A business logic flaw has none of those. There is no suspicious line. The problem is in the design of a rule, the order things happen in, or an assumption about how people will use the system.

That makes these the hardest flaws to find. Finding them takes someone who understands what the product is supposed to do.

Common shapes

Bookkeeping in the wrong order. Paying someone before recording that they've been paid, or working out rewards from records that haven't been updated yet, so the same money is counted twice.

Steps that can be skipped. An action meant to be possible in one phase only (before launch, or after a lock-up ends) that can be taken in another, or a process where a required step can be jumped over.

Edge cases. How the code behaves at zero, at the maximum, and for the very first or very last user. An error here may cost little each time and be repeatable forever.

Rewards and penalties that don't add up. A reward that is cheaper to collect than to earn, a penalty that can be dodged, a fee that can be avoided by splitting one transaction into several.

Features that clash. Two features that are each correct and combine badly, such as being able to borrow against an asset you can also withdraw.

Assuming everything goes well. Logic that assumes users act honestly, that an outside service always answers, or that a number is always positive.

An example

Consider a staking contract, where users lock up tokens and earn rewards over time. This one pays based on how long it has been since you last claimed:

function claim() external {
    uint256 owed = rewardPerSecond * (block.timestamp - lastClaim[msg.sender]);
    token.transfer(msg.sender, owed);
    lastClaim[msg.sender] = block.timestamp;
}

In plain terms: work out the time since this user last claimed, pay them a fixed rate for it, and reset their clock. It reads fine, and something is missing. Nothing connects the reward to how much the user has locked up. Someone who locked one token is paid the same as someone who locked a million, and an account that has locked nothing at all can claim too. No line is "wrong." The rule is.

How we catch them

The most reliable method we know is to write down what must always be true, then try to break it. These rules are called invariants. For a staking contract:

  • total rewards paid out never exceed the rewards that were put in
  • what a user can claim never exceeds what their locked amount and time could have earned
  • everyone's recorded balances always add up to what the contract actually holds

We ask teams for these rules at the start, add our own, and turn each one into an automated test. The test throws thousands of random sequences of actions at the contract, looking for one that breaks the rule. When one does, we have a flaw, often one nobody had thought of, along with the shortest sequence of steps that reproduces it.

A rule that can't be tested this way goes on our manual review list, where a person reads the logic against the written description of how it should work.

What you can do first

  • Write your product's rules in plain English and have someone outside the team read them.
  • Write down the rules that must never break before the audit. This is where the audit checklist starts.
  • Test the edges: first user, last user, zero, the maximum, and both orders of any two actions.
  • Consider a design review before the code is final, when changing a rule is cheap.

Business logic flaws are the reason a manual review can't be replaced. Request an audit to have a person attack your rules.

ShareTelegramX

Shipping something onchain?

Send us your repo and we’ll return a quote within 24 hours.

Request an Audit