Evaluating the Effectiveness of LLMs in Aiding Compliance Testing of PKCS#1-v1.5
This paper evaluates the effectiveness of combining grammar-level mutation with LLM-based code synthesis for compliance testing of PKCS#1 v1.5 implementations, finding that while the approach successfully reproduces known vulnerabilities and discovers new discrepancies, its utility is severely limited by high rates of LLM hallucination that create a significant gap between operational reliability and semantic fidelity.
Original paper licensed under CC BY 4.0 (http://creativecommons.org/licenses/by/4.0/). This is an AI-generated explanation of the paper below. It is not written or endorsed by the authors. For technical accuracy, refer to the original paper. Read full disclaimer
Imagine you are a strict building inspector. Your job is to check if every house built in a city follows the exact same blueprint. The blueprint (the "specification") says: "The front door must be 3 feet wide, the roof must be red, and the chimney must be exactly 10 feet tall."
In the world of computer security, these "houses" are software programs that handle encrypted messages (like digital signatures). The "blueprint" is a complex set of rules called PKCS#1 v1.5. If a program builds a house that doesn't match the blueprint perfectly, it might have a hidden backdoor that hackers can use to break in.
The Problem: Checking is Hard
Checking these houses is incredibly difficult.
- Random guessing doesn't work: If you just throw random bricks at a house, you'll almost never accidentally build a door that is exactly 3 feet wide. You need a very specific plan.
- Expert tools are slow: There are tools made by human experts that can check every possible variation of the blueprint, but building these tools takes years of deep study and manual work. They are like hiring a team of master architects to inspect every single house.
The New Idea: The "AI Architect"
The researchers in this paper asked a simple question: Can we use a Large Language Model (an AI) to act as a "translator" that turns a broken blueprint into a test?
Here is their process:
- The Original Blueprint: They took the official rules for the house.
- The Mutator (The "What-If" Machine): They used a computer program to intentionally break the blueprint in 13 different ways. For example, they might say, "What if the door is 4 feet wide?" or "What if the roof is blue?" or "What if we remove the chimney entirely?"
- The AI Translator: They handed these broken blueprints to an AI and said, "Write a computer program that builds a house exactly according to this broken blueprint."
- The Test: They ran the AI's program to build the house and then tried to feed that house to 48 different software programs (the "builders") to see if the builders accepted the broken house. If a builder accepted a broken house, that builder had a security flaw.
The Results: A Tale of Two Numbers
The results were a mix of great news and a major warning.
The Good News (Operational Reliability):
The AI was amazing at following instructions to start the job.
- 99.8% of the time, the AI successfully wrote a program that ran without crashing. It was like an architect who always managed to hand you a set of blueprints that didn't have any typos or missing pages.
The Bad News (Semantic Fidelity):
However, the AI was terrible at actually following the broken blueprint.
- Only 17.5% of the time did the AI actually build the house the way the broken blueprint asked.
- In 82.5% of cases, the AI "hallucinated." It looked at the broken blueprint, thought, "Oh, that looks wrong," and secretly fixed it back to the original perfect blueprint before building the house.
The Analogy:
Imagine you ask the AI: "Build a house with a blue door."
- Success: The AI builds a house with a blue door.
- Hallucination: The AI builds a house with a red door because it "knows" doors are usually red, even though you specifically asked for blue. It ignored your specific instruction.
What Did They Find?
- They found the big bugs: The approach successfully recreated 10 out of 13 known security flaws (including the most dangerous ones that allow hackers to forge signatures). This proves the idea works.
- They found a new bug: They discovered a new security issue in a library called LibTomCrypt that no one had reported before. This happened because the AI successfully built a house missing a specific part (the leading zero byte), and the library accepted it.
- The Bottleneck is the AI, not the Plan: The researchers found that the "Mutator" (the machine breaking the blueprints) was doing a great job. The problem was entirely the AI's inability to stick to the broken rules.
The "Hallucination" Types
The researchers categorized how the AI failed, like a doctor diagnosing a patient:
- The "Fixer" (Most Common): The AI saw a broken rule (like "padding must be less than 16 bytes") and thought, "That's impossible," so it silently fixed it back to the normal rule.
- The "Math Whiz Who Forgot Math": The AI tried to follow the rules but messed up the simple math (like calculating how much padding to add), resulting in a house that was the wrong size.
- The "Ignore": The AI completely ignored the broken part of the blueprint and built a standard house.
The Bottom Line
This paper shows that using AI to help test computer security is promising but currently unreliable.
The AI is great at writing code that runs (it doesn't crash), but it is very bad at writing code that means what you said. It has a habit of "correcting" your intentional mistakes because it thinks it knows better.
The researchers conclude that if you want to use AI for this kind of testing, you can't just trust the code it writes. You have to have a second layer of checking to make sure the AI actually followed your specific, broken instructions and didn't just "fix" them back to normal. Until then, the AI is a helpful intern who is very eager to please but often ignores your specific orders to do things the "right" way.
Drowning in papers in your field?
Get daily digests of the most novel papers matching your research keywords — with technical summaries, in your language.