AI tool finds 100+ crypto-misuse bugs by comparing libraries

In short

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.

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?

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

Sources

Related stories

More from AI and Security

All stories from AI and Security