Adversarial SQL Injection Generation with LLM-Based Architectures
This paper introduces two novel LLM-based systems, RADAGAS and RefleXQLi, for generating adversarial SQL injection payloads and evaluates their effectiveness against diverse Web Application Firewalls, revealing that while these models significantly outperform baselines in bypassing AI/ML-based defenses, they struggle against rule-based systems and demonstrate that payload diversity does not always correlate with higher bypass success.
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
The Big Picture: The Digital Locksmith and the Master Key
Imagine the internet is a giant city of buildings (websites). To keep these buildings safe from thieves, security guards (called Web Application Firewalls or WAFs) stand at the front doors. Their job is to stop bad guys from sneaking in through the back door using a specific trick called SQL Injection (a way of tricking the building's database into revealing secrets).
For a long time, security experts have tried to test these locks by hiring human locksmiths or using robotic tools that try every known key shape. But the locks are getting smarter, and the old keys don't work as well anymore.
This paper asks a new question: What if we use a super-smart AI (a Large Language Model or LLM) to invent new keys that the security guards have never seen before?
The researchers built two new "AI Key-Makers" to see how good they are at tricking these security guards.
The Two New AI Key-Makers
The researchers created two different methods to help the AI generate these tricky keys:
1. RADAGAS: The "Library Researcher"
Think of this AI as a brilliant student who has read every book in the world's largest library of past heists.
- How it works: Before trying to pick a lock, this AI goes to its "library" (a database of known successful attacks from OWASP, GitHub, etc.). It grabs the best, most proven tricks from the past.
- The Twist: It uses a special technique called RAG (Retrieval Augmented Generation). Instead of just guessing, it looks up the most relevant "cheat codes" and then asks the AI to remix them into something new.
- The Result: It's like a thief who studies the blueprints of every successful robbery before attempting a new one.
2. RefleXQLi: The "Critical Thinker"
This AI works like a two-person team: a Creator and a Critic.
- How it works:
- The Creator tries to design a new key.
- The Critic (another AI) looks at the key and says, "No, that looks too suspicious. Try again."
- The Creator listens, thinks harder (using a "Chain of Thought" process), and tries to make a better, sneakier key.
- The Twist: They keep arguing back and forth until the Creator makes a key that the Critic can't spot. It's like a writer and an editor working together until the story is perfect.
The Great Test: 2.2 Million Attempts
To see who was the best, the researchers set up a massive simulation:
- The Attackers: They used 7 different systems (including the two new ones, plus old-school tools and standard AI).
- The Defenders: They tested against 10 different security guards (WAFs). Some were old-school rule-followers (like a guard with a checklist), some were AI-based (guards that learn by watching), and some were famous commercial guards (like Cloudflare and AWS).
- The Scale: They generated 240,000 keys and tried them on the guards 2.2 million times.
What Did They Find?
1. The "Library Researcher" (RADAGAS) Won the Race
The RADAGAS system, especially when powered by the GPT-4o AI, was the most successful overall. It managed to sneak past the guards about 22.7% of the time.
- Why? Because it didn't just guess; it learned from a curated list of things that actually worked in the past.
2. The "Critical Thinker" (RefleXQLi) Was Very Stable
The RefleXQLi system was slightly less successful overall (about 21.2%), but it was very consistent. It rarely made mistakes and always produced unique keys.
3. The "Diversity Myth" Was Debunked
A common belief in security is: "The more different your keys are from each other, the better your chances."
- The Paper's Finding: This wasn't true! The researchers found no strong link between making thousands of totally different keys and actually breaking in.
- The Analogy: It doesn't matter if you try 1,000 different shaped keys if none of them fit the lock. It's better to try 100 keys that are very similar to the one you know works, than 1,000 random shapes.
- Surprise: Sometimes, trying to make the keys too different actually made them worse.
4. Different Guards Need Different Keys
There was no "magic key" that opened every door.
- AI Guards (Machine Learning WAFs): The RADAGAS system was a monster against these, breaking in over 90% of the time. It seems these AI guards weren't trained well enough to spot the "remixed" old tricks.
- Rule-Based Guards (Checklist WAFs): These were very tough. The new AI systems struggled here, getting blocked almost all the time. The old-school tools (like SQLmap) actually did slightly better against these specific guards.
- Commercial Guards (Cloudflare/AWS): The results were mixed. Different AI systems found different "holes" in their defenses.
5. The "Temperature" Setting Matters
AI models have a "creativity dial" called Temperature.
- GPT-4o worked best when set to be less creative (low temperature, more logical).
- DeepSeek worked best when set to be very creative (high temperature).
- Claude was happiest in the middle.
- Lesson: You can't use the same settings for every AI; you have to tune them like a radio to get the best signal.
The Bottom Line
The paper concludes that if you want to test if a website is secure, you shouldn't just rely on one tool.
- Use RADAGAS to test against AI-based security systems.
- Use RefleXQLi (or seed-driven versions) for stable, high-quality testing.
- Don't obsess over making your attack keys "diverse"; focus on making them smart and relevant to the specific lock you are trying to open.
The researchers emphasize that they did this in a safe, isolated lab to help improve security, not to help criminals. They kept the "keys" private so no one could misuse them.
Drowning in papers in your field?
Get daily digests of the most novel papers matching your research keywords — with technical summaries, in your language.