Home Knowledge Base Fuzzing with LLMs

Fuzzing with LLMs combines fuzz testing (automated test input generation) with large language models to generate diverse, semantically meaningful test inputs that explore program behavior and uncover bugs — leveraging LLMs' understanding of code structure, input formats, and common bug patterns to create more effective fuzzing campaigns.

What Is Fuzzing?

Why Combine LLMs with Fuzzing?

How LLM-Based Fuzzing Works

1. Code Analysis: LLM analyzes the target program to understand input format and expected behavior.

2. Seed Generation: LLM generates initial test inputs based on code understanding. ```python # Target function: def parse_json_config(json_str): config = json.loads(json_str) return config["database"]["host"]

# LLM-generated seeds: '{"database": {"host": "localhost"}}' # Valid '{"database": {}}' # Missing "host" key '{"database": null}' # Null database '{}' # Missing "database" key 'invalid json' # Malformed JSON ```

3. Mutation: LLM mutates seeds to create variations — adding edge cases, boundary values, malicious patterns.

4. Execution: Run program with generated inputs, monitor for crashes or errors.

5. Feedback Loop: Use execution results to guide further generation — focus on inputs that trigger new code paths or interesting behavior.

LLM Fuzzing Strategies

Example: SQL Injection Fuzzing

# Target: Web application with SQL query
def search_users(username):
    query = f"SELECT * FROM users WHERE name = '{username}'"
    return execute_query(query)

# LLM-generated fuzz inputs:
"admin"  # Normal input
"admin' OR '1'='1"  # SQL injection attempt
"admin'; DROP TABLE users; --"  # Destructive injection
"admin' UNION SELECT password FROM users --"  # Data exfiltration
"admin' AND SLEEP(10) --"  # Time-based blind injection

# Fuzzer detects: SQL injection vulnerability!

Applications

LLM Advantages Over Traditional Fuzzing

Challenges

Hybrid Approaches

Tools and Frameworks

Evaluation Metrics

Benefits

Fuzzing with LLMs represents the next generation of automated testing — combining the thoroughness of fuzz testing with the intelligence of language models to find bugs more effectively.

fuzzing with llmssoftware testing

Explore 500+ Semiconductor & AI Topics

From EUV lithography to CUDA optimization — search the full knowledge base or chat with our AI assistant.