AI Meets Cryptography 1: What AI Found in Cloudflare's Circl
TL;DR Highlight
An AI audit pipeline on Cloudflare's CIRCL found seven real bugs, all now fixed upstream.
Who Should Read
Backend or security developers who want to use LLMs to audit cryptography and security-critical code
Core Mechanics
- All seven AI-found bugs were fixed
- zkSecurity ran its AI audit agent pipeline on Cloudflare's CIRCL, a library of advanced and post-quantum cryptography.
- Seven of the candidate findings were confirmed as real bugs and fixed upstream.
- Humans validated each issue, checked exploitability, minimized the POC and handled disclosure.
- float64 and int64 broke threshold RSA
- Polynomial evaluation computed x^i in float64, which silently rounds once the value exceeds 2^53.
- Lagrange coefficients used int64, which overflows at around 21 players, and dividing before multiplying truncated results.
- Both were fixed by moving to big.Int.
- The verifier read its security parameter from the proof
- The qndleq DLEQ proof stored SecParam in the Proof struct and recomputed the challenge from it during verification.
- SecParam=1 gave a 1-bit challenge, and 8 gave about 2^8=256 attempts to forge.
- The fix makes SecParam an explicit argument to Verify so the verifier sets it.
- One bug needed two harmless things to combine
- Feeding -g_x to the DLEQ verifier cancels out when challenge c is even because (-1)^c=1.
- FillBytes drops the sign, so -gx and gx hash identically.
- It works on about half of honest proofs, and a checkBounds step requiring 0<x<N fixes it.
- Go's case a | b trap skipped HPKE validation
- case modePSK | modeAuthPSK is one case with value 0x03, not two cases.
- modePSK (0x01) matched no case, so SetupPSK passed with no PSK.
- The fix uses comma-separated cases.
- A one-line AND-share mistake fully broke access control
- In CP-ABE (tkn20), the AND gate discarded the random share and gave In0 the whole parent secret.
- Every key carries the wildcard leaf that is In0, so any key could decrypt regardless of policy.
- zkao found this one on its own, and both the AI and Cloudflare rated it Critical.
- AI is weak at severity judgment
- In most cases the AI rated impact higher than Cloudflare's confirmed severity.
- For the BLS aggregate bug (rogue key attack), the AI said Medium while Cloudflare confirmed High.
- The authors hypothesize that library impact depends on unseen callers, so for now humans own severity.
Community Reactions
- Question on candidate-to-confirmed ratio
- A commenter asked the authors to expand on "AI candidate findings are cheap while trustworthy reports are not".
- They asked how many candidate reports the LLMs produced versus the 7 true vulnerabilities.
- Opinion that a higher-level test was missing
- A commenter noted a regression test was added for the CP-ABE bug.
- They wondered why no higher-level test checked that decryption fails when a required attribute is absent.
- Confusion about what zkao is
- A commenter said even after reading the zkao article it was unclear whether zkao is an LLM or a pipeline.
- Surprise at floats in crypto code
- Another commenter expressed surprise that people use floats to implement crypto algorithms.
How to Apply
- Grep your crypto and security code for overflow patterns today
- Search the repo for math.Pow, float64 conversions and int64 multiplication in key, polynomial or coefficient computation.
- List the places to switch to an arbitrary-precision type like big.Int.
- Move verifier parameters out of input structs
- Check whether values the verifier must decide, like challenge length or security level, live in proof or request fields.
- If so, move them to explicit Verify arguments or server config.
- Have humans re-rate LLM audit severity
- Treat the LLM's severity as a hint and re-decide with a reproducible PoC and your threat model.
- For library code, state caller assumptions in the prompt so impact is assessed with them.
- Catch Go case a | b with a code search
- Find switch case labels that OR constants together.
- Change them to comma-separated cases and add tests that each mode is accepted or rejected correctly.
Try It
# Paste into Claude or ChatGPT (simplified version of the article's AI audit approach)
Act as a security auditor and review the {{code}} below. Prioritize these patterns.
1. Operations where float64/int64 cause precision loss or overflow
2. Places where a security parameter the verifier should set is read from input (proof/request)
3. Places where hashing or serialization drops information such as sign, making different inputs collide
4. Go switch statements using constant OR like case a | b:
5. Code implementing AND/OR logic that does not actually behave as the logic requires
For each finding give: location, exploit scenario, minimal PoC idea, severity.
Do not lower severity just because 'the caller is supposed to handle it'; also describe the impact if the caller does not.
{{code}}Terminology
Related Papers
Frostbite: A new CPU architecture discovered, designed and verified by AI
AI agents designed a CPU from scratch, claiming 4.59x perf/W over a traditional core
Restricting AI agents in mobile operating systems platforms from capturing data
Signal now blocks OS-level AI agents from reading its screen on iOS 27 and Android
Actions Speak Louder than Words: Stateful Privacy Sniffing of LLM Agents via Behavioral Covert Channels in Web Interactions
Agents' link choices alone let attackers rebuild user queries at F1 0.89; SOR cuts it to 0.39.
Tracking and Limiting Unsupported Claim Propagation in Multi-Agent LLM Systems: A Provenance-Aware Framework
Passing claims with source, evidence and history kept equivalence at 5 agent stages at 96% versus 31%.
LLM assisted reverse engineering
Pointing an agent at binaries with skills and MD notes made years-long hacks feasible
Metrics-in-the-Loop: Complexity Feedback Reshapes Agent-Written Code
Injecting per-turn complexity reports into coding agents cut code erosion without changing correctness
Why is Gemini 4 Carbon taking so long?
Carbon took nearly an hour on bug fixes that Astra and Opus finished in minutes, mostly from extra unrequested work.
Weight-Space Programming builds neural networks like a 1990s researcher
LLM hand-wrote MNIST weights to 91.3%, using 1990s-style techniques