Neural Network Grammar Generation for Automated Fuzzing

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Existing grammar-based fuzzing techniques require manual input grammars, which are laborious, time-consuming, and error-prone, especially for complex formats like PDF, and are not fully automatic, limiting their effectiveness in finding security vulnerabilities in applications with structured input formats.

Innovation Solution

The use of machine-learning techniques, specifically neural networks, to automatically generate input grammars for grammar-based fuzzing by learning a generative model of complex structured inputs, allowing for the intelligent generation of fuzzing inputs that maximize parser-code coverage while injecting ill-formed parts to exercise unexpected code paths.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Reliability

If manual grammar writing is used for grammar-based fuzzing, then fuzzing effectiveness for complex structured inputs is improved, but labor time and error rate increase significantly

Engineering Contradiction:
Improvefuzzing effectivenessVSAvoidlabor time for grammar writing
Core Design Contradiction:
ReliabilityVSLoss of time

Solution Approach 1:

The system performs self-service by automatically learning input grammars from sample inputs using machine learning techniques, eliminating the need for manual grammar specification. The learning module autonomously analyzes sample inputs and generates grammars that capture the structure and patterns of complex formatted inputs, thereby reducing labor time while maintaining fuzzing effectiveness.

Inventive Principle:
Principle #25Self-service

Solution Approach 2:

The patent replaces the mechanical process of manual grammar writing with an automated machine learning system. Instead of manually specifying grammar rules, the system uses neural networks and probabilistic models to learn grammars from data, substituting human effort with computational processes that scale efficiently to complex formats.

Inventive Principle:
Principle #28Mechanics substitution (Replace mechanical system)

2Adaptability or versatility

If manual grammar specification is used, then grammar-based fuzzing can handle complex structured inputs, but the process becomes error-prone and not fully automatic

Engineering Contradiction:
Improveability to handle complex structured inputsVSAvoidautomation level of fuzzing process
Core Design Contradiction:
Adaptability or versatilityVSExtent of automation

Solution Approach 1:

The system achieves full automation by implementing self-service grammar learning. The learning module automatically processes sample inputs, extracts structural patterns, and generates grammars without human intervention. This eliminates errors associated with manual grammar writing while maintaining the ability to handle complex structured inputs like PDF, HTML, and JSON.

Inventive Principle:
Principle #25Self-service

Solution Approach 2:

The system performs preliminary action by learning grammars from sample inputs before the actual fuzzing process begins. This pre-learning phase captures the essential structure and constraints of the input format, enabling the fuzzing engine to generate valid test cases that conform to the learned grammar, thereby achieving both adaptability and full automation.

Inventive Principle:
Principle #10Preliminary action

3Extent of automation

If blackbox random fuzzing is used, then full automation is achieved, but effectiveness in finding vulnerabilities in structured input parsers decreases

Engineering Contradiction:
Improveautomation levelVSAvoidvulnerability detection effectiveness
Core Design Contradiction:
Extent of automationVSReliability

Solution Approach 1:

The patent introduces an intermediary learned grammar as a bridge between blackbox random fuzzing and whitebox constraint-based fuzzing. The grammar learning module acts as a mediator that automatically discovers structural constraints from samples, which then guide the fuzzing process to generate more targeted and effective test inputs while maintaining full automation, thereby improving vulnerability detection effectiveness.

Inventive Principle:
Principle #24Intermediary (Mediator)

Solution Approach 2:

The system implements feedback by using the learned grammar to guide and constrain the random fuzzing process. The grammar provides feedback on what constitutes valid input structure, allowing the fuzzing engine to generate inputs that are both random enough for automation and structured enough to effectively exercise parser code paths, thus improving detection effectiveness while maintaining automation.

Inventive Principle:
Principle #23Feedback

Data Source

PatentUS10983853B2Machine learning for input fuzzing
Publication Date: 2021.04.20 MICROSOFT TECHNOLOGY LICENSING LLC
  • US10983853B2 patent drawing
  • US10983853B2 patent drawing
  • US10983853B2 patent drawing

AI summary

Provided are methods and systems for automatically generating input grammars for grammar-based fuzzing by utilizing machine-learning techniques and sample inputs. Neural-network-based statistical learning techniques are used for the automatic generation of input grammars. Recurrent neural networks are used for learning a statistical input model that is also generative in that the model is used to generate new inputs based on the probability distribution of the learnt model.