AI tool finds 100+ crypto-misuse bugs by comparing libraries
In short
- Chai, built by Corban Villa, Raluca Ada Popa and colleagues at UC Berkeley, is an AI system that looks for cryptographic misuse bugs: places where software uses a security library in a way that quietly breaks its protection. Nothing crashes when this happens, so there is no automatic signal to tell an AI agent it has found something.
- Chai sends the same test input to many independent libraries and treats any disagreement as a lead. It then follows each lead to the applications that depend on the library. The authors report over 100 vulnerabilities and security bugs across X.509 certificate, JWT token and SAML login-message libraries, in a preprint dated 25 June 2026.
- The most serious find is a critical certificate-checking bypass in wolfSSL, a library the paper says ships in billions of devices. The maintainers confirmed and patched it within hours of the report. The preprint is not peer-reviewed, and the names of most affected libraries are withheld while disclosure continues.
100+ vulnerabilities and security bugs reported (authors' count); 47 libraries tested, in 8 languages; 147 unique disagreements on X.509 from 1,500 certificates; 73 the best earlier tool's count, after about 500,000 certificates
What is a cryptographic misuse bug?
Cryptography software can be mathematically sound and still be used wrongly. A library may check a signature correctly but leave a decision, such as which keys to trust, to the application above it, while the application assumes the library already made that decision. The paper's own example is CVE-2018-0114: the node-jose library accepted a verification key embedded in the token itself by default, so an attacker could supply their own key and forge a valid token. The signature check passed, and the standard permits embedded keys, but the application read "verified" as "trusted".
That is why these bugs are hard for AI bug-hunters. For memory-safety flaws, tools such as address sanitizers raise an alarm when memory is misused, which filters out false claims. The authors say cryptographic misuse has no comparable check, so an agent can argue that a bug exists but has nothing to prove it. (Our reading: that leaves a human to sort through each claim.)
How does differential testing work here?
Differential testing, a technique from 1998, runs one input through several implementations of the same specification and compares what each does. If all agree, that stands in for the right answer. If one library accepts a certificate the others reject, at least one is wrong. Used alone it is noisy, and it needs hand-built input generators for each protocol.
Chai uses AI agents to write the test inputs and to triage the disagreements. The paper sorts each into one of four classes:
Library vulnerabilities and ambiguities are then confirmed by manual review. Each ambiguity drives what the paper calls a reverse search: Chai looks up which applications depend on that library and sends an agent to check each one for that single behaviour, for example whether it trusts a key supplied in the token.
What did it find?
The paper reports two wolfSSL flaws, both in X.509 certificate-chain validation. A chain should be accepted only if it leads back to a root the verifier already trusts. In wolfSSL's OpenSSL-compatible interface, an intermediate certificate loaded temporarily to check a signature was, in edge cases, never unloaded. It then vouched for the leaf certificate even though nothing reached a trusted root. The paper ties one case to an optional Subject Key Identifier field that some intermediates omit.
- wolfSSL acknowledged and reproduced the report in roughly ninety minutes, and the fix shipped in wolfSSL 5.9.2 with two CVEs, CVE-2026-11310 and CVE-2026-11999.
- The authors say the bypass needs no unusual configuration, and that a client could be made to accept a chain that reaches no trust anchor.
- Other X.509 findings, with names withheld, are a certificate-usage fail-open in the TLS library behind a major browser and a chain-validation flaw in a library shipped in major Linux distributions.
- On JWT the paper describes an audience-claim bypass in a widely used PHP library, which it classes as a security bug. It also traces a Base64URL-decoding ambiguity to a revocation bypass in an open-source RAG system: a revoked token's byte-equivalent spelling still verified.
The paper adds that wolfSSL had recently been audited by Anthropic's Mythos and that neither issue was surfaced. That is the authors' observation, not a test of Mythos on the same task.
The headline "over 100" mixes kinds of finding. The introduction describes "several confirmed" library-level findings plus "over 100 under-investigation" findings in downstream applications. The authors confirmed every reported finding themselves, but disclosure to maintainers is still in progress.
How does it compare with other tools?
On X.509, Chai found 147 unique disagreement patterns from 1,500 certificates at a cost of $52.5. The strongest baseline, MLCerts, reached 73 after about 500,000 certificates at roughly $560. Chai's own count of unique disagreements was about twice the strongest baseline's overall. Most were different ones, too: 132 of Chai's 147 on X.509, 39 of 50 on JWT and 12 of 17 on SAML were found by no other tool. The tools overlap only partly; MLCerts alone found 43 that Chai missed.
The paper also asked two general coding agents to find a certificate flaw in wolfSSL, ten runs each. Codex (GPT-5.5) found neither bypass in any run. Claude Code (Opus 4.8) found the depth bypass in seven of ten runs without a hint, but the subtler Subject Key Identifier bypass only once across all runs. Chai surfaced both among its 147 X.509 disagreements.
What is not shown?
- Coverage: the authors call it empirical, not exhaustive. Chai only sees a flaw when at least two independent implementations disagree on an input, and it does not look for flaws in the underlying mathematics or the specifications.
- Strict libraries help: the technique works best when every implementation tries to follow the specification closely. Permissive ones add noise.
- Unverifiable for now: names, code and proof-of-concept details are redacted for unpatched findings, so outsiders cannot yet check them.
- Cost figures: the dollar amounts are the authors' own measurements of model use in their set-up, not a general price.
Where things stand
The authors say disclosure is ongoing and takes roughly 2 to 5 hours of preparation per report, so they send library-level findings first and downstream ones later. The most severe were disclosed within 24 hours of discovery. They suggest the approach could spread beyond cryptography wherever many implementations share one interface, and propose a catalogue of the guarantees each library leaves to the application. We did not check whether more findings have since been published.
Sources
- Chai: Agentic Discovery of Cryptographic Misuse Vulnerabilities, Villa, Kim, Chu, Shakevsky and Popa, arXiv preprint (CC BY 4.0), 25 June 2026
Sources
Related stories
- Bound on solving degree-n polynomials drops to about n − √n
- Pi0 gamma data need excited rho and omega states, authors say
- Chip keeps photons entangled over 28 km of fibre, authors say
- Eight-ion indium clock hits 1/√N noise scaling, a preprint says
- A milligram mirror tightens collapse-noise limits, a preprint says
- Silver-94 masses rule out two-proton decay claim, preprint says