The bug that silently doubled user fees and how we caught it

A real-world example of a logic bug that looked fine in code until Octane traced the full execution path.

Hey, it’s Gio.

Last time, I shared how Octane flagged a vulnerability in Uniswap integration logic, a missing slippage check that could’ve exposed users to frontrunning.

Today, I want to walk through a different kind of issue. One that wasn’t exploitable in the traditional sense, but still posed a serious risk to users and protocol trust.

It came up during onboarding with a team building a gambling-style protocol. They’d already completed a manual audit with a well-known firm. Everything seemed in order.

But when they plugged into Octane, our system flagged a high-severity issue that hadn’t been caught earlier.

The bug: a silent double-charge

The contract was supposed to apply a 10% house rake each round.

But it was applying the rake twice—once early in the function logic, and again later in the payout path.

And it didn’t just happen when someone won.
Even when no one won, the rake was still being deducted twice.

That meant every round was silently overcharging the pool, regardless of outcome.

The individual functions looked fine in isolation. But when Octane traced the full execution path, the system flagged it as an incorrect state update. This one of our high-severity categories.

The result: a consistent 20% deduction instead of the intended 10%.

This logic error would’ve caused ongoing loss of funds and violated the protocol’s stated behavior.

Scoring the severity: impact × likelihood

At Octane, we classify every finding using a severity matrix that scores issues based on two dimensions:

  • Impact: How severe is the outcome if the issue occurs?

  • Likelihood: How frequently could it happen in real-world usage?

Each issue gets ranked: Informational → Low → Medium → High → Critical

In this case:

  • Impact was high — the overcharge would have led to significant monetary loss.

  • Likelihood was high — the condition (a user winning) happens almost every round.

That pushed the finding into CRITICAL.

It wasn’t an exploit. There was no attacker.

But it was still a severe issue that would have caused real financial loss if left in production.

Why this kind of bug can go unnoticed

Some issues don’t show up when you read the code. They only show up when you simulate how that code behaves in real conditions.

In this case, the individual logic steps didn’t raise alarms. But when Octane traced the full execution path, it spotted that the rake was being deducted twice.

This isn’t a knock on auditors. They’re working with limited time and scoped reviews, and many behavioral bugs only show up with dynamic analysis or layered scanning over time.

That’s where Octane fits in: not to replace other security methods, but to complement them with continuous, behavior-aware coverage.

How Octane caught it instantly

Our system flagged the issue as an incorrect state update, one of several high-severity categories our models are trained to detect.

The model saw that a fee was being deducted more than once in a single code path and that the result didn’t align with expected behavior.

The team confirmed the logic mismatch and patched the bug before launch.

No users were impacted.
No trust was lost.
And the protocol shipped clean.

The kind of issue that breaks trust, not just code

Security isn’t just about stopping attacks.
It’s about shipping software that behaves the way you say it does.

That’s why we score severity with intention. Not based on how “loud” a bug is, but on how likely it is to cause real damage in real usage.

Even with other layers of security in place, this bug would have reached production if not for Octane’s analysis.

Next time, I’ll break down what onboarding with Octane actually looks like — from repo integration to model tuning — and why most teams start seeing real findings within 48 hours.

More soon,
Gio

Ready to Secure Your Smart Contracts?

Deploy with confidence by adding Octane’s AI security to your CI/CD pipeline. Schedule a live demo to see how we deliver 24/7 offensive intelligence and real-time vulnerability detection.

Interested in hearing more?

Login or Subscribe to participate in polls.