Hacking Truth: Forged Lean Proofs and the Risk of Verifier Bugs
Jonathan Brossard (Prince of Darkness · PSIRT.COM), Jean-Philippe Aumasson (Cryptography Team Lead · Cloudflare)
[un]prompted II 2026 — The AI Security Practitioner Conference · Day 3 · Stage 2
Overview
In an era increasingly shaped by artificial intelligence, the integrity of mathematical proofs and formally verified software is paramount. This talk, "Hacking Truth: Forged Lean Proofs and the Risk of Verifier Bugs," delivered by cybersecurity expert Jonathan Brossard and cryptographer Jean-Philippe Aumasson, exposes critical vulnerabilities within the foundational tools used for formal verification. Specifically, it highlights how proof verifiers like Lean and Roc (formerly Coq), which are now being leveraged by large language models (LLMs) to solve complex mathematical problems and generate provably correct code, are susceptible to exploitation.

Key moments
- 0:30 AI-generated proofs and trusting verifiers
- 2:50 Soundness bugs: proving 1=0 with verifier flaws
- 6:00 First CVEs filed for Lean and Rock
- 8:50 Forging a Lean 4 proof for P vs NP
- 12:50 Backdooring Fiat Crypto in cryptographic libraries
- 16:30 Live demo: arbitrary code execution from Lean
- 18:00 Backdooring CompCert, impacting Airbus software
- 19:00 Call for security investment in proof frameworks
Hacking Truth: Forged Lean Proofs and the Risk of Verifier Bugs
Speakers: Jonathan Brossard (Prince of Darkness, PSIRT.COM); Jean-Philippe Aumasson (Cryptography Team Lead, Cloudflare)
Conference: [un]prompted II
YouTube: https://www.youtube.com/watch?v=HbOD4_sQk8
Overview
In an era increasingly shaped by artificial intelligence, the integrity of mathematical proofs and formally verified software is paramount. This talk, "Hacking Truth: Forged Lean Proofs and the Risk of Verifier Bugs," delivered by cybersecurity expert Jonathan Brossard and cryptographer Jean-Philippe Aumasson, exposes critical vulnerabilities within the foundational tools used for formal verification. Specifically, it highlights how proof verifiers like Lean and Roc (formerly Coq), which are now being leveraged by large language models (LLMs) to solve complex mathematical problems and generate provably correct code, are susceptible to exploitation.
The speakers meticulously demonstrate that existing, often long-standing, soundness bugs in these verifiers can be weaponized. These vulnerabilities allow attackers not only to forge proofs for unsolved mathematical problems—such as P vs NP or the Riemann hypothesis—but also to achieve arbitrary code execution within the verification pipelines themselves. The implications are profound, extending beyond abstract mathematics to encompass critical software supply chains, cryptographic libraries, and even safety-critical systems, underscoring an urgent need for enhanced security scrutiny in this rapidly evolving domain.
Brossard and Aumasson argue that these "soundness bugs" should no longer be considered mere mathematical annoyances but rather significant security flaws. Their work aims to shift the perception of these issues, compelling the formal verification community and major AI developers to invest in robust security policies and practices. By revealing the tangible risks, they advocate for a proactive approach to securing the very foundations upon which future AI-driven mathematical and software advancements will be built.
Background
▶ Watch: AI-generated proofs and trusting verifiers (0:30)
The landscape of mathematics and software development is undergoing a paradigm shift, largely driven by the advancements in artificial intelligence. Recent breakthroughs, such as OpenAI's success in solving complex mathematical problems like the Navier-Stokes theorem, illustrate the burgeoning capability of LLMs. The mechanism behind these achievements is not direct mathematical intuition by the AI, but rather the LLM's ability to generate code that can be verified by specialized systems known as proof verifiers. Languages and frameworks like Lean, Roc (formerly Coq), Agda, F\*, Daphne, and Isabelle serve as these computational gatekeepers, ensuring the correctness of mathematical theorems and software properties.
The process involves two main components: a program that formally defines the theorem to be proven and another program that constitutes the proof itself. The verifier then checks this proof code against the theorem statement. If the verifier outputs "correct," it provides a mathematical guarantee of the proof's validity, even if a human cannot fully comprehend the underlying logic. This reliance on machine trust introduces a critical vulnerability: the verifier itself must be infallible. However, as the speakers emphasize, software is inherently prone to bugs, and formal verifiers are no exception.
Historically, the formal verification community has encountered soundness bugs—flaws that allow a verifier to "prove" something false as true (e.g., 1 = 0 or true = false). Once such a contradiction is established, anything can be proven, rendering the entire system unreliable. A notable case involved a result posted online that was initially verified as correct but later found to exploit a soundness bug. Alarmingly, when a second implementation of the same verifier was used, it exhibited the identical bug, highlighting a systemic weakness rather than an isolated incident.
The prevalence of these issues is evident in the open-source nature of projects like Lean and Roc. Lean's GitHub repository, for instance, lists over a thousand open issues, many of which are soundness bugs. Roc fares similarly with over 2,500 open issues. Until recently, these tools operated within a niche academic field, and their maintainers, often mathematicians, lacked the resources or immediate impetus to prioritize cybersecurity. Crucially, many projects, including Lean, lack formal security policies on platforms like GitHub, which define disclosure terms and contact points for vulnerability reports.
However, the advent of AI and its increasing dependence on formal verification for tasks such like VARICoding (LLM-generated code with accompanying proofs) has dramatically elevated the stakes. What were once considered mere mathematical annoyances now have direct implications for software supply chain security and the integrity of critical systems. The core premise of this talk is that soundness bugs in formal verifiers must be reclassified and treated with the same gravity as any other security vulnerability, including the potential for proof forgery and code execution.
Key Findings
▶ Watch: First CVEs filed for Lean and Rock (6:00)
Jonathan Brossard and Jean-Philippe Aumasson presented a series of groundbreaking findings that fundamentally challenge the perceived trustworthiness of formal proof verifiers. Their work demonstrates that these systems, critical for modern mathematical and software assurance, are vulnerable to sophisticated attacks.
Firstly, the speakers revealed that they were responsible for filing the first CVEs (Common Vulnerabilities and Exposures) specifically for "kernel bugs" in Lean and Roc. This is a crucial distinction, as they classified existing soundness bugs, previously viewed as mathematical curiosities, as legitimate security vulnerabilities, thereby establishing a precedent for their treatment within the cybersecurity community. While they did not discover new bugs, they demonstrated the severe exploitability of unpatched, long-standing flaws—one Roc bug, for instance, had been open for six years.
Their attack surface extended beyond Lean and Roc to encompass a wide array of other formal solvers and proof assistants, including Agda, F\*, Daphne, Isabelle, Z3, and CVC5. This comprehensive assault underscores that the problem is not isolated to a single platform but is endemic across the formal verification ecosystem.
A particularly alarming finding was the successful exploitation of tools built on top of these verifiers, which are used for critical software supply chain verification. They targeted F\* (used to prove Rust code), F my C (for C code correctness), and most notably, CompCert. CompCert is a formally verified C compiler used in high-assurance contexts, including Airbus aeronautical software, to prove that C code precisely matches its compiled assembly. The ability to backdoor CompCert and still obtain a "formal proof that checks" completely undermines its core security guarantee, posing a significant risk to safety-critical systems.
The most dramatic demonstrations involved proof forgery. Brossard and Aumasson presented fake proofs for several of the most famous unsolved mathematical problems, including the Riemann hypothesis, the P vs NP problem (both P is NP and P is not NP), the Navier-Stokes existence and smoothness problem, the Hodge conjecture, and the Birch and Swinnerton-Dyer conjecture (BSD). These proofs, generated using Lean 4, came with official Lean 4 certificates, representing the highest level of formal mathematical assurance currently available. This feat highlighted the ease with which an attacker could manipulate these systems to "prove" arbitrary, incorrect statements.
Finally, they demonstrated a direct arbitrary code execution vulnerability within Lean itself. This exploit leveraged a use-after-free bug stemming from a reference counter overflow. While requiring a substantial heap spray (over 60 gigabytes of memory) to trigger the 32-bit counter overflow, this memory requirement is increasingly common on modern build servers. The successful execution allowed for arbitrary file creation and command execution, proving that verifier bugs can escalate beyond logical contradictions to full system compromise, especially within automated CI/CD pipelines that incorporate formal verification. They also pointed out that simpler backdoors could be implemented using FFI (Foreign Function Interface) calls embedded in dependencies.
In a striking example of real-world impact, Jean-Philippe Aumasson stated he was able to backdoor Fiat Crypto, an MIT-developed building block for generating formally proven cryptographic algorithms, in just two hours. Fiat Crypto is a foundational component used in critical cryptographic libraries such as BoringSSL, which underpins the security of Chrome—one of the most widely used pieces of software on the internet. This demonstrates the immediate and far-reaching implications of these verifier vulnerabilities for global digital security.
Technical Deep Dive
▶ Watch: Backdooring Fiat Crypto in cryptographic libraries (12:50)
The technical core of the vulnerabilities lies in the fundamental design and implementation of formal proof verifiers. At its heart, formal verification operates on the Curry-Howard correspondence, which posits a deep equivalence between mathematical proofs and computer programs, and between propositions and types. In essence, a correct proof in Lean (or similar systems) is analogous to a program that compiles successfully, meaning the theorem is correct. This elegant principle, however, is predicated on the verifier itself being flawless.
The primary class of vulnerability discussed is the soundness bug. A soundness bug in a proof verifier allows it to accept an incorrect proof as valid, thereby "proving" a false statement to be true. The canonical example is proving "1 = 0" or "true = false." Once such a contradiction is introduced into the system, the principle of explosion (or ex falso quodlibet) dictates that any statement can be proven, rendering the entire system logically compromised. The speakers highlighted that they did not discover these bugs but exploited existing ones, some of which had been open for years (e.g., a 6-year-old bug in Roc). Their contribution was to demonstrate that these are not merely academic curiosities but exploitable security vulnerabilities.
The method for forging proofs, as demonstrated with problems like P vs NP, often involves embedding the exploit within a seemingly legitimate, complex, and lengthy proof structure. The concept mirrors software supply chain attacks: instead of a malicious library, an attacker hides a malicious logical construct within a dependency or a deeply nested part of the proof. This makes detection extremely difficult for humans, especially for proofs spanning hundreds of thousands of lines of code, as seen in complex theorems like Navier-Stokes. The goal is not necessarily to escape detection forever, but to remain undetected for a period—weeks or months—sufficient to cause significant impact. The generated "proofs" received official Lean 4 certificates, emphasizing that from the verifier's perspective, these were legitimate, highest-assurance mathematical results.
Beyond logical contradictions, the talk delved into the more severe consequence of arbitrary code execution. The speakers presented an exploit for a use-after-free bug in Lean. This specific vulnerability stemmed from a reference counter overflow. In Lean, objects are managed using reference counting; when a 32-bit reference counter overflows (e.g., exceeds 2^32 - 1), it can wrap around, leading to situations where an object's memory is prematurely freed while still being referenced elsewhere.
To trigger this particular bug, a significant amount of memory allocation, specifically over 60 gigabytes, was required to perform a heap spray and force the counter overflow. While this might seem like a large requirement, the speakers noted that 60GB of RAM is increasingly standard on modern build servers and CI/CD environments, making the attack feasible in real-world scenarios. Once the use-after-free condition is achieved, it allows for pointer substitution, where an attacker can replace the freed memory with their own controlled data. This, in turn, can lead to the execution of arbitrary code, transforming a logical flaw into a direct system compromise.
The implications for "VARICoding"—the concept of LLMs generating code along with formal proofs of its correctness—are profound. If the proof verifier itself can be hacked to execute arbitrary code, then the entire pipeline, from AI-generated code to its formal assurance, becomes a vector for supply chain attacks. As an alternative, and potentially simpler, method for achieving code execution, the speakers also mentioned leveraging Foreign Function Interface (FFI) capabilities. FFI allows Lean proofs to interact with external code, and if malicious FFI calls or dependencies are introduced into a proof, they could directly execute arbitrary system commands without requiring complex memory corruption techniques. This highlights multiple avenues for exploitation, ranging from subtle logical manipulation to overt system control.
Demo / Proof of Concept
▶ Watch: Live demo: arbitrary code execution from Lean (16:30)
The talk featured several compelling demonstrations and proof-of-concept exploits that brought the abstract concept of verifier bugs into stark reality. Central to their presentation was the live demonstration of forged proofs for some of mathematics' most challenging unsolved problems.
The speakers showcased how they had generated proofs for both "P is NP" and "P is not NP," along with the Riemann hypothesis, the Navier-Stokes existence and smoothness problem, the Hodge conjecture, and the Birch and Swinnerton-Dyer conjecture (BSD). Crucially, these forged proofs were accompanied by Lean 4 certificates, which signify the highest level of formal mathematical validity within the Lean ecosystem. This demonstrated that from the perspective of the verifier, these fabricated results were indistinguishable from genuine, rigorously proven theorems. To ensure reproducibility and allow others to verify their claims, all exploit artifacts, including the forged proofs, were made available in Docker containers with pinned down versions of the verifiers, allowing anyone to replicate the results at home.
A key insight shared during this segment was the comparative difficulty of the tasks involved: "We found it more difficult to write a correct statement of P equal and P... than writing the actual exploit. So exploiting the bug was relatively easy but making sure that the statement was correct..." This highlights that the barrier to entry for exploiting these systems might be lower than one would assume, especially if the goal is to introduce subtle, hidden flaws rather than overtly contradictory statements.
The most impactful demonstration, however, was the arbitrary code execution in Lean. While described as "not super visual," the speakers initiated an attack leveraging the use-after-free vulnerability. After approximately 30 seconds, the exploit successfully created an arbitrary file on the system, confirming that they had achieved code execution. This live demonstration underscored that verifier vulnerabilities are not limited to logical subversion but can lead to full system compromise, posing a direct threat to any environment where formal verification is performed, such as CI/CD pipelines or cloud-based verification services.
Further reinforcing the real-world implications, Jean-Philippe Aumasson recounted a specific proof of concept: backdooring Fiat Crypto. Within a mere two hours, he was able to inject a backdoor into this critical component, which is used to generate formally proven cryptographic algorithms that find their way into widely deployed libraries like BoringSSL (used by Chrome). This anecdote served as a powerful example of how quickly and effectively these vulnerabilities can be weaponized to compromise the integrity of highly trusted software components, with cascading effects across the digital ecosystem.
Defensive Implications
▶ Watch: Call for security investment in proof frameworks (19:00)
The findings presented by Brossard and Aumasson carry profound defensive implications for anyone involved in software development, cybersecurity, and particularly, the formal verification community. The overarching message is clear: soundness bugs must be treated as security issues, not just mathematical or logical inconveniences.
Firstly, the most immediate defensive measure is for the maintainers of formal verifiers like Lean, Roc, Agda, and others to urgently implement robust security policies. This includes establishing clear channels for vulnerability disclosure, defining points of contact, and providing mechanisms for encrypted reports. The current lack of such policies on platforms like GitHub for many of these projects leaves them vulnerable to silent exploitation and hinders responsible disclosure.
Secondly, the talk highlighted the resource constraints faced by the small teams of mathematicians maintaining these complex systems. There is a critical need for increased investment in security expertise and resources for these projects. This responsibility extends beyond the immediate maintainers to major stakeholders, particularly frontier AI companies like OpenAI and Anthropic, who heavily rely on these verifiers for their LLM-driven mathematical and coding advancements. These companies have a vested interest in the security maturity of these frameworks and should proactively support their hardening.
For users of formal verification, including developers building safety-critical systems or cryptographic libraries, the talk serves as a stark warning against blind trust in verifier outputs. Even a "formally verified" certificate cannot guarantee absolute correctness if the underlying verifier is compromised. Defenders must adopt a more skeptical stance, especially when dealing with extremely long, complex, or deeply nested proofs, as these provide ideal hiding places for exploits embedded in dependencies. The analogy to software supply chain security is apt: just as one scrutinizes third-party libraries, one must consider the trustworthiness of proof dependencies.
The demonstration of arbitrary code execution in Lean underscores the need to secure the environments where formal verification takes place. CI/CD pipelines and build servers that incorporate formal verification steps are now potential targets for attack. Organizations must apply standard security hardening practices—such as least privilege, network segmentation, and robust logging—to these environments, treating the verifier itself as a critical attack surface.
Furthermore, the ability to backdoor tools like CompCert has direct implications for high-assurance software, such as that used in avionics (e.g., Airbus). The very purpose of CompCert is to provide an unforgeable link between source code and binary. If this link can be subverted by a compromised verifier, the entire chain of trust is broken. Organizations relying on such tools for Common Criteria certification (levels 6 and 7) or similar high-assurance standards must re-evaluate their risk models to account for these verifier-level vulnerabilities.
Finally, while the dream of perfectly reliable machine-generated proofs remains, the current reality demands a hybrid approach. Human oversight and critical review, though challenging for massive proofs, remain essential. The talk suggests that while machines might eventually produce more reliable proofs than humans, the journey there is fraught with the pitfalls of software bugs. Therefore, a multi-layered defense incorporating security policies, dedicated resources, skeptical review, and hardened execution environments is crucial to mitigate the risks posed by forged proofs and verifier bugs.
Key Takeaways
- Formal proof verifiers are critical infrastructure: Tools like Lean and Roc are no longer niche academic interests but foundational components for AI-driven mathematical advancements and software development, making their security paramount.
- Soundness bugs are security vulnerabilities: Flaws that allow verifiers to "prove" false statements (e.g., 1=0) must be reclassified and treated with the same urgency as other security bugs, not as mere mathematical annoyances.
- Forged proofs are achievable with high assurance: Attackers can exploit existing, unpatched bugs to generate "formally verified" proofs for major unsolved mathematical problems (e.g., P vs NP, Riemann hypothesis), complete with official certificates, undermining trust in formal methods.
- Arbitrary code execution is possible: Specific vulnerabilities, such as a use-after-free bug in Lean, can be exploited to gain arbitrary code execution within verification pipelines, posing a direct threat to software supply chains and systems utilizing formal verification.
- Significant supply chain risks exist: Backdoored verifiers or formally verified components (e.g., Fiat Crypto in BoringSSL/Chrome, CompCert in Airbus software) can introduce subtle, persistent vulnerabilities into critical software, with far-reaching consequences.
- Urgent need for security investment: Maintainers of formal verifiers require more resources and security expertise, and major AI companies relying on these tools have a vested interest in funding and supporting robust security policies and practices for the entire ecosystem.
About the Speaker(s)
Jonathan Brossard is a recognized cybersecurity and product security expert, known by his moniker "Prince of Darkness" and associated with PSIRT.COM. His work often involves deep dives into system vulnerabilities and novel attack vectors, as demonstrated by his contribution to this talk on hacking formal proof verifiers.
Jean-Philippe Aumasson is a distinguished cryptographer, currently serving as the Cryptography Team Lead at Cloudflare. He is widely respected in the field for his expertise in applied cryptography, notably as the co-author of the Blake hashing algorithm (including Blake3). His background in serious mathematics and cryptography provides a crucial perspective on the integrity and security of formal verification systems.
Reviews
- Dr. Zero (Offensive Security Researcher) — MUST SEE ★★★★★
- Heather Calloway (CISO) — MUST SEE ★★★★★
→ Top-rated talks at [un]prompted II 2026 — The AI Security Practitioner Conference
All talks from [un]prompted II 2026 — The AI Security Practitioner Conference