
CVE-2026-72844 : Example of proving "0 = 1" using a vulnerability in the Lean 4 kernel.
Proving 0 = 1 axiom-free via nested inductive projection validation bypass.
The Lean 4 kernel does not verify that the structure named in a projection
expression matches the type of the value being projected, and
environment::add_inductive in src/kernel/inductive.cpp did not type
check the nested inductive applications that are replaced by auxiliary
types, so their parametric arguments escaped checking.
A metaprogram running in the Lean process can register an ill-typed nested
inductive whose constructor applies a .proj C 0 projection to a value of
the unrelated type W, and the kernel admits the declaration through the
ordinary checked addDecl path at maximum kernel checking. The result is a
type confusion yielding a proof of False that carries no axioms, from
which any proposition — including 0 = 1 — can be derived.
The exploit:
addDecl kernel path--trust=0 (maximum checking)#print axiomssorry, unsafeCast, debug.skipKernelTC, FFI, or .olean tamperingdocker build -t lean-cve-poc .
docker run --rm lean-cve-poc
Expected output on a vulnerable Lean version:
[*] Running ZeroEqOne.lean with --trust=0 ...
'bad' does not depend on any axioms
'boom' does not depend on any axioms
'zero_eq_one' does not depend on any axioms
zero_eq_one : 0 = 1
[!] VULNERABILITY CONFIRMED — CVE-2026-72844
zero_eq_one : 0 = 1
Depends on: no axioms
On a patched Lean version, the kernel rejects the ill-typed inductive and the script reports the version is not vulnerable.
Any system that trusts Lean's kernel-checked proofs as ground truth is affected. This includes:
The root cause is in the kernel's handling of nested inductive types.
When eliminating a nested occurrence I Ds is, the kernel must verify that
the parametric arguments Ds match the inductive's declared parameters.
The vulnerable code fails to check that projection expressions (.proj)
in Ds reference the correct structure name — a .proj C 0 w is accepted
even when w : W and W ≠ C.
Combined with a hash collision (the kernel uses Expr.hash comparisons
in its definitional equality check), this allows an attacker to register
declarations where the kernel's internal type assignment disagrees with the
actual term semantics, leading to type confusion and a proof of False.
| Field | Value |
|---|
| CVE | CVE-2026-72844 |
| Advisory | VulnCheck VCSA |
| Bug report | leanprover/lean4#14576 |
| Fix | leanprover/lean4#14577 |
| Affected | Lean 4 ≤ v4.31.0 / nightly ≤ 2026-07-27 |
| Fixed in | nightly 2026-07-29+ / v4.32.2 |
| CVSS 4.0 | AV:L/AC:L/AT:N/PR:N/UI:P/VC:N/VI:H/VA:N/SC:N/SI:N/SA:N — 6.8 MEDIUM |
| CVSS 3.1 | AV:L/AC:L/PR:N/UI:R/S:C/C:N/I:H/A:N — 6.3 MEDIUM |
| CWE | CWE-843 (Type Confusion) |