A defect in Lean’s low-level String.Pos.Raw.extract function affected stable releases through Lean 4.33.1, creating a semantic mismatch between its logical evaluator and compiled native code. At an astronomically large byte offset, Lean’s logical definition returned an empty string for a one-byte slice, while native code returned the original string; researchers used the discrepancy to construct a contradiction and a proof-of-concept false proof of Fermat’s Last Theorem.
The issue is not a flaw in Lean’s proof-checking kernel. Exploitation requires native_decide, which trusts native evaluation and expands the trusted computing base to include the compiler and runtime behavior. A memory-safety fix was opened roughly 90 minutes after disclosure, followed by a correction for the semantic mismatch; the fixes are included in Lean v4.34.0-rc1.

See affected versions and whether adversaries are exploiting it.
4 events from the most recent confirmed update back to the earliest known activity.
Five days after the report, contributor Rob23oba fixed the remaining mismatch between Lean's logical evaluator and compiled native behavior, closing the issue. The resulting patch was incorporated in Lean v4.34.0-rc1.
The memory-safety fix opened by hargoniX was merged roughly three hours after it was filed.
About 90 minutes after the issue was reported, contributor hargoniX opened a fix for the memory-safety issue in the low-level string extraction behavior.
Researchers identified a semantic mismatch in Lean's String.Pos.Raw.extract and used native_decide to derive a contradiction equating an empty string with a non-empty string. They used the contradiction in a proof-of-concept purported proof of Fermat's Last Theorem affecting stable Lean releases through 4.33.1.
See whether adversaries are exploiting this yet, and where the affected versions run in your environment.
4 references tracked. Mallory keeps watching after this page renders.
malware.news
Open sourceblog.trailofbits.com
Open sourcegithub.com
Open sourceanthropic.com
Open sourceMap indicators from this story to your assets and identify affected systems in minutes.
Every observed campaign, victim, and pivot linked to actors named in this story.
Malware, exploits, and IOCs connected to the activity described here.
YARA, Sigma, and Snort rules deployed to your SIEM as soon as they’re published.
Get matching new stories delivered to your team as they break — not the next morning.
Ask questions about this story and take action on the answers.