formallabs
From a security researcher at SEFCOM and CTF player in Shellphish

Don't hope it's secure. Prove it.

Forma is an automated verifier: it works out what your code must never do, proves that it never does and, where a proof fails, hunts for the exploit and drafts the fix.

a real bug

Fifty lines of PHP, and the gap behind PHP2Shell.

PHP2Shell (CVE-2026-109618) let attackers run code on PHP servers without logging in. The cause: PHP could run out of memory partway through an update and leave its own data half built.

These lines are one place the researchers showed it. A table slot is counted before its key exists.

PHP 8.5.11, Zend/zend_hash.c. Found by Calif, OpenAI and Wiz: PHP advisory, write-up. The marks are an illustration of how a proof reads this code.

how it works

From your code to a proof, with nothing written by hand.

A worked example on four lines of code.

01

A proof is only as good as the question it answers.

To prove software secure, someone first has to write down what "secure" means for it. That document is called a specification.

Today a person or an AI model writes it, and nobody can guarantee it says what was intended. Get the spec wrong and the proof proves the wrong thing.

spec, written by hand
/* requires: input is a string */
/* requires: ???               */
char name[16];
memcpy(name, input, n);

The line nobody wrote down: input fits in 16 bytes. That gap is a buffer overflow.

02

Forma does not ask anyone to write it.

Forma analyses the code itself. For every single operation, it derives the rules that operation must never break: never read past the end of a buffer, never use memory after it is freed, never overflow.

The same code always gives the same rules. No person and no model is involved in that step.

src/greet.crules, derived automatically
  1. char name[16]; is alive while it is used
  2. size_t n = strlen(input); input ends with a zero byte
  3. memcpy(name, input, n); n fits in nameinput has n bytes to read
  4. name[n] = '\0'; stays inside name

same code in=same rules outevery time

03

Then it proves your code follows them.

Not for the inputs someone thought to test. For every input.

Each proof is verified by a small, independent checker, so nothing has to be taken on trust. And when Forma cannot settle a rule, it says so instead of calling it a pass.

✕forma / verifygreet
  • ✓ proved name: is alive while it is used
  • ✓ proved memcpy: input has n bytes to read
  • ✕ counterexample memcpy: n fits in name
  • ✕ counterexample name[n]: stays inside name
  • ? unknown strlen: input ends with a zero byte
04

Where a proof fails, you get the exploit and the fix.

AI agents pick up every rule that could not be proved and look for an input that really breaks the program. When they find one, you get the input, a written report and a suggested patch.

A finding counts only if it crashes the real program at the exact spot the failed proof pointed to.

conversation
⊢formacommented on src/greet.c

The proof of memcpy: n fits in name failed. An agent found an input that breaks it, replayed on the built binary:

input   "AAAAAAAAAAAAAAAAA"   (17 letters)
result  stack buffer overflow, write of 17 bytes into 16
        greet  src/greet.c:3

Suggested change:

+ if (n >= sizeof name) return -1;
  memcpy(name, input, n);

We think formal verification is how software stops having vulnerabilities, and that the specification is what has kept it out of everyday code.

Checking code with mathematics is not new. Writing the spec is the part that needs an expert on every project, and there is no way to check that it says what was meant.

Forma's rules are not written per project. They come from one catalogue, built once and itself checked by machine, so every codebase is held to the same standard without anyone writing a spec for it.

Ship software you can prove. ∎