IP Library › Granted Patent US 10,452,526
Granted Patent B2
US 10,452,526 · App. 15/636,132 · Granted Oct 22, 2019

Machine learning for constrained mutation-based fuzz testing

Inventors: Mohit Rajpal (Bartlett, IL); William Blum (Bellevue, WA); Rishabh Singh (Kirkland, WA)
Assignee: Microsoft Technology Licensing, LLC
G06F11/3692G06F11/3684G06F11/3688G06F21/577G06N5/048G06N20/00G06F11/3676
View Patent ↗
Loading inventors, assignments & file history…
Monitor This Case
Get email alerts when status or documents change.
Order Certified Copies
Most orders are placed with the USPTO same day — all within 24 business hours.
Order via The Patent Place →
Pre-filled with this patent's details
Quick Facts
Patent No.
US 10,452,526
App. No.
15/636,132
Granted
Oct 22, 2019
Kind
B2
Abstract

Techniques for constrained mutation-based fuzzing are described. Machine accesses an input file of code for testing. Machine performs multiple runs of a fuzzing algorithm using the input file and the code. Each run includes: performing a mutation of one or more bytes of the input file and determining which parts of the code were executed when the code was run with the mutated input file. Machine stores, for each run, an indication of whether the mutation caused execution of a portion of the code which was not executed prior to the mutation, Machine generates heatmap of the input file based on the stored indications. The heatmap maps each of the bytes in the input file to a value indicating whether the mutation of the byte caused execution of the portion of the code for testing which was not executed prior to the mutation. Machine tailors fuzzing algorithm based on heatmap.

Claims (55)

1. A system comprising:

one or more processors; and

a memory comprising instructions which, when executed by the one or more processors, cause the one or more processors to perform operations comprising:

accessing an input file of code for testing, the input file comprising a plurality of bytes;

performing a plurality of runs of a fuzzing algorithm using the input file and the code for testing, each run including: performing a mutation of one or more bytes of the input file and determining which parts of the code for testing were executed when the code was run with the mutated input file;

storing, for each run of the plurality of runs of the fuzzing algorithm, an indication of whether the mutation caused execution of a portion of the code for testing which was not executed prior to the mutation;

tailoring the fuzzing algorithm based on the stored indications;

executing the tailored fuzzing algorithm to identify one or more versions of the input file for which the code for testing crashes;

providing, as a digital transmission, indicia of the one or more versions of the input file for which the code for testing crashes; and

generating a heatmap of the input file based on the stored indications, the heatmap mapping each of the plurality of bytes in the input file to a value indicating whether the mutation of the byte caused execution of the portion of the code for testing which was not executed prior to the mutation,

wherein tailoring the fuzzing algorithm based on the stored indications comprises tailoring the fuzzing algorithm based on the heatmap.

2. The system of claim 1 , wherein tailoring the fuzzing algorithm based on the heatmap comprises:

adjusting the fuzzing algorithm to perform mutations only on bytes associated, in the heatmap, with either a value exceeding a threshold, a non-zero value, or a TRUE value.

3. The system of claim 1 , wherein the heatmap comprises a matrix identifying each byte of the input file and the value indicating whether the mutation of that byte caused execution of the portion of the code for testing which was not executed prior to the mutation.

4. The system of claim 1 , wherein generating a heatmap of the input file based on the stored indications comprises:

learning a machine-learned model based on the stored indications, the machine-learned model being for predicting the value indicating whether the mutation of each byte causes execution of the portion of the code for testing which was not executed prior to the mutation; and

generating the heatmap of the input file using the machine-learned model.

5. The system of claim 1 , wherein the fuzzing algorithm mutates one or more bytes in the input file to cause unexpected behavior in an execution of the code for testing.

6. The system of claim 1 , wherein the code for testing is an application for processing files of a type associated with the input file.

7. The system of claim 1 , wherein the value indicating whether the mutation of the byte caused execution of the portion of the code for testing which was not executed prior to the mutation is:

one or TRUE if, in at least one instance, the mutation of the byte caused execution of the portion of the code for testing which was not executed prior to the mutation, and

zero or FALSE otherwise.

8. The system of claim 1 , wherein the value indicating whether the mutation of the byte caused execution of the portion of the code for testing which was not executed prior to the mutation corresponds to a proportion, of runs where the byte had the mutation, which caused execution of the portion of the code for testing which was not executed prior to the mutation.

9. A non-transitory machine-readable medium comprising instructions which, when executed by one or more processors of a machine, cause the one or more processors to perform operations comprising:

performing a plurality of runs of a fuzzing algorithm using an input file and code for testing, the input file comprising a plurality of bytes, and each run including: performing a mutation of one or more bytes of the input file and determining which parts of the code for testing were executed when the code was run with the input file;

storing, for each run of the plurality of runs of the fuzzing algorithm, an indication of whether the mutation caused execution of a portion of the code for testing which was not executed prior to the mutation;

generating a heatmap of the input file based on the stored indications, the heatmap mapping each of the plurality of bytes in the input file to a value indicating whether the mutation of the byte caused execution of the portion of the code for testing which was not executed prior to the mutation;

tailoring the fuzzing algorithm based on the heatmap;

executing the tailored fuzzing algorithm to identify one or more versions of the input file for which the code for testing crashes; and

providing, as a digital transmission, indicia of the one or more versions of the input file for which the code for testing crashes.

10. The machine-readable medium of claim 9 , wherein the fuzzing algorithm mutates one or more bytes in the input file to cause unexpected behavior in an execution of the code for testing.

11. The machine-readable medium of claim 9 , wherein the code for testing is an application for processing files of a type associated with the input file.

12. The machine-readable medium of claim 9 , wherein tailoring the fuzzing algorithm based on the heatmap comprises:

adjusting the fuzzing algorithm to perform mutations only on bytes associated, in the heatmap, with either a value exceeding a threshold, a non-zero value, or a TRUE value.

13. The machine-readable medium of claim 9 , wherein the value indicating whether the mutation of the byte caused execution of the portion of the code for testing which was not executed prior to the mutation is:

one or TRUE if, in at least one instance, the mutation of the byte caused execution of the portion of the code for testing which was not executed prior to the mutation, and

zero or FALSE otherwise.

14. The machine-readable medium of claim 9 , wherein the value indicating whether the mutation of the byte caused execution of the portion of the code for testing which was not executed prior to the mutation corresponds to a proportion, of runs where the byte had the mutation, which caused execution of the portion of the code for testing which was not executed prior to the mutation.

15. The machine-readable medium of claim 9 , wherein the heatmap comprises a matrix identifying each byte of the input file and the value indicating whether the mutation of that byte caused execution of the portion of the code for testing which was not executed prior to the mutation.

16. The machine-readable medium of claim 9 , wherein generating a heatmap of the input file based on the stored indications comprises:

learning a machine-learned model based on the stored indications, the machine-learned model being for predicting the value indicating whether the mutation of each byte causes execution of the portion of the code for testing which was not executed prior to the mutation; and

generating the heatmap of the input file using the machine-learned model.

17. A method comprising:

accessing an input file of code for testing, the input file comprising a plurality of bytes;

performing a plurality of runs of a fuzzing algorithm using the input file and the code for testing, each run including:

performing a mutation of one or more bytes of the input file and determining which parts of the code for testing were executed when the code was run with the input file;

storing, for each run of the plurality of runs of the fuzzing algorithm, an indication of whether the mutation caused execution of a portion of the code for testing which was not executed prior to the mutation;

generating a heatmap of the input file based on the stored indications, the heatmap mapping each of the plurality of bytes in the input file to a value indicating whether the mutation of the byte caused execution of the portion of the code for testing which was not executed prior to the mutation;

tailoring the fuzzing algorithm based on the heatmap; and

providing, as a digital transmission, an output of the tailored fuzzing algorithm.

18. The method of claim 17 , further comprising:

executing the tailored fuzzing algorithm to identify one or more versions of the input file for which the code for testing crashes; and

providing, as a digital transmission, indicia of the one or more versions of the input file for which the code for testing crashes.

19. The method of claim 17 , wherein tailoring the fuzzing algorithm based on the heatmap comprises:

adjusting the fuzzing algorithm to perform mutations only on bytes associated, in the heatmap, with either a value exceeding a threshold, a non-zero value, or a TRUE value.

Assignments (1)
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Jul 24, 2017
From: RAJPAL, MOHIT; BLUM, WILLIAM; SINGH, RISHABH
To: MICROSOFT TECHNOLOGY LICENSING, LLC
Reel/Frame 043081/0506 →
Continuity (2)
Provisional Application 62520173 · Jun 15, 2017
Related Publication 20180365139A1 · Dec 20, 2018
Cited By (4)
US 12,271,484 US 12,346,839 US 12,407,708 US 12,572,782