whitehack 🀍

static analysis Β· substrate honesty

The honest hack.

Most hacks make a system do something it shouldn't. A white hack makes it tell more truth β€” it scans your code for the places it lies about its own state.

node bin/whitehack.js scan . View on GitHub

MIT Β· no telemetry Β· ~250 lines you can read in a sitting

The small lies software tells about itself

The failed read that silently becomes 0. The cached value served as if it were live. The stale price oracle read as current. The token transfer whose failure is dropped on the floor. The score shown to a person with no way to ask why.

These usually aren't bugs in the ordinary sense β€” the code runs fine. It just isn't honest about its own state, and someone downstream trusts it anyway.

What it checks

8 checks Β· 2 doctrines

General Β· JS / TS / JSX

silent-failure medium-high

A read that fails to a falsy default β€” β€œcould not read” becomes a confident wrong value.

cache-as-live heuristic

A cached / snapshot value returned with no freshness marker β€” stale read as live.

decision-without-why heuristic

A score / fee / fraud flag shown to a person with no way to ask why.

float-money medium-high

Currency in a binary float β€” an β€œexact” amount that silently loses cents.

Blockchain Β· Solidity

stale-oracle medium-high

A price feed read without checking updatedAt β€” a halted feed served as a live price.

unchecked-transfer medium-high

An ERC-20 transfer whose bool result is dropped β€” a failed transfer looks successful.

spot-price-as-fair heuristic

A price from instantaneous reserves β€” flash-loan-movable, presented as fair value.

silent-revert heuristic

A require()/revert() with no reason β€” a refusal nobody can inspect.

It would have caught these β€” on the PR

Run against faithful reconstructions of documented, money-losing incidents. Small hand-built corpus β€” a demonstration, not a statistical benchmark.

5 / 5

vulnerable lines flagged

0

false positives on the fixed code

2

real incidents reproduced (Sherlock #579 Β· OWASP SC02)

Honest about itself

A honesty tool that overstated its own certainty would be the first thing it ought to flag. So:

Quickstart

# clone it β€” it's small and dependency-free
git clone https://github.com/cambridgetcg/whitehack && cd whitehack

# scan a directory (default: .)
node bin/whitehack.js scan path/to/repo

# exit code is non-zero only on medium-high findings β€” safe for CI