neuzz: efficient fuzzing with neural program smoothingneuzz: efficient fuzzing with neural program...

26
NEUZZ: Efficient Fuzzing with Neural Program Smoothing Dongdong She , Kexin Pei, Dave Epstein, Junfeng Yang, Baishakhi Ray, and Suman Jana Columbia University 1

Upload: others

Post on 13-Aug-2020

12 views

Category:

Documents


2 download

TRANSCRIPT

Page 1: NEUZZ: Efficient Fuzzing with Neural Program SmoothingNEUZZ: Efficient Fuzzing with Neural Program Smoothing Dongdong She, Kexin Pei, Dave Epstein, Junfeng Yang, Baishakhi Ray, and

NEUZZ:EfficientFuzzingwithNeuralProgramSmoothing

DongdongShe,KexinPei,DaveEpstein,JunfengYang,BaishakhiRay,andSumanJanaColumbiaUniversity

1

Page 2: NEUZZ: Efficient Fuzzing with Neural Program SmoothingNEUZZ: Efficient Fuzzing with Neural Program Smoothing Dongdong She, Kexin Pei, Dave Epstein, Junfeng Yang, Baishakhi Ray, and

Fuzzing:apopularwaytouncoverbugs

2

[Liang et al. 2019]

Page 3: NEUZZ: Efficient Fuzzing with Neural Program SmoothingNEUZZ: Efficient Fuzzing with Neural Program Smoothing Dongdong She, Kexin Pei, Dave Epstein, Junfeng Yang, Baishakhi Ray, and

EvolutionaryFuzzing

3

Advantage:easytoimplementDisadvantage:inefficient

•  Randommutationsarenoteffective•  Oftengetstuckinlongsequenceof

wastefulmutations

Mutation

Hardtofindscalableandadaptiveheuristicsforguidedmutation

Seed

Children

Grandchildren

Page 4: NEUZZ: Efficient Fuzzing with Neural Program SmoothingNEUZZ: Efficient Fuzzing with Neural Program Smoothing Dongdong She, Kexin Pei, Dave Epstein, Junfeng Yang, Baishakhi Ray, and

Anewapproachtofuzzing

4

Page 5: NEUZZ: Efficient Fuzzing with Neural Program SmoothingNEUZZ: Efficient Fuzzing with Neural Program Smoothing Dongdong She, Kexin Pei, Dave Epstein, Junfeng Yang, Baishakhi Ray, and

Fuzzing:AnOptimizationProblem

5

aprograminput#ofbugsfoundbyinputgenerateKinputsfrominputspace

Maximize

isdiscreteandhardtooptimize

FindC(X)thatcanmaximizetotalno.ofbugs

F (x)C(X) X

x x

x

!

x∈C(X)

F (x)

∈X

F (x)

Page 6: NEUZZ: Efficient Fuzzing with Neural Program SmoothingNEUZZ: Efficient Fuzzing with Neural Program Smoothing Dongdong She, Kexin Pei, Dave Epstein, Junfeng Yang, Baishakhi Ray, and

6

Fuzzing:AnOptimizationProblem

:#ofbugs

Input

Hardtofindinputslikeandamongflatplateaus

F (x)

xx1 x2

x1 x2

Page 7: NEUZZ: Efficient Fuzzing with Neural Program SmoothingNEUZZ: Efficient Fuzzing with Neural Program Smoothing Dongdong She, Kexin Pei, Dave Epstein, Junfeng Yang, Baishakhi Ray, and

Fuzzing:AnOptimizationProblem

7

aprograminputedgecoverageofinput

generateKinputsfrominputspace

Maximize

FindC(X)thatcanmaximizetotalnumberofedges

C(X) X

x x

x

∈X

G(x)

!

x∈C(X)

G(x)

Page 8: NEUZZ: Efficient Fuzzing with Neural Program SmoothingNEUZZ: Efficient Fuzzing with Neural Program Smoothing Dongdong She, Kexin Pei, Dave Epstein, Junfeng Yang, Baishakhi Ray, and

Input

8

Fuzzing:AnOptimizationProblem

:#ofedges

x

G(x)

Page 9: NEUZZ: Efficient Fuzzing with Neural Program SmoothingNEUZZ: Efficient Fuzzing with Neural Program Smoothing Dongdong She, Kexin Pei, Dave Epstein, Junfeng Yang, Baishakhi Ray, and

Input

9

Evolutionaryoptimization

x

1

2

3

4

5

Randommutationisnotefficient

:#ofedgesG(x)

Page 10: NEUZZ: Efficient Fuzzing with Neural Program SmoothingNEUZZ: Efficient Fuzzing with Neural Program Smoothing Dongdong She, Kexin Pei, Dave Epstein, Junfeng Yang, Baishakhi Ray, and

Input

10

Gradient-guidedOptimization

:#ofedges

x

SmoothApproximation+Gradient-guidedMutation

G(x)H(x):smoothapproximationofG(x)

Page 11: NEUZZ: Efficient Fuzzing with Neural Program SmoothingNEUZZ: Efficient Fuzzing with Neural Program Smoothing Dongdong She, Kexin Pei, Dave Epstein, Junfeng Yang, Baishakhi Ray, and

:smoothapproximationof

Input

11

Gradient-guidedOptimization

x

SmoothApproximation+Gradient-guidedMutation

H(x) G(x)

1

2

3

4 5

Page 12: NEUZZ: Efficient Fuzzing with Neural Program SmoothingNEUZZ: Efficient Fuzzing with Neural Program Smoothing Dongdong She, Kexin Pei, Dave Epstein, Junfeng Yang, Baishakhi Ray, and

SmoothApproximation

Problem:HowtosmoothlyapproximateG(x)?

NeuzzSolution:UseaNNtolearnasmoothH(x)

UniversalApproximationTheorem:ANNcanapproximateanycontinuousfunction

12

Page 13: NEUZZ: Efficient Fuzzing with Neural Program SmoothingNEUZZ: Efficient Fuzzing with Neural Program Smoothing Dongdong She, Kexin Pei, Dave Epstein, Junfeng Yang, Baishakhi Ray, and

Gradient-guidedMutation

13

Whygradientguidance?Gradientindicatescriticalpartsofinput

Whatarecriticalpartsoftheinput?Criticalpartsofinputaffectprogrambranches

Howgradient-guidedmutationworks?Focusmutationsonthecriticalpartsoftheinput

Page 14: NEUZZ: Efficient Fuzzing with Neural Program SmoothingNEUZZ: Efficient Fuzzing with Neural Program Smoothing Dongdong She, Kexin Pei, Dave Epstein, Junfeng Yang, Baishakhi Ray, and

MainIdeabehindNeuzz

14

Input Branching Behaviors

Program

NN

Gradient-guided mutation Smooth

Surrogate

Input Branching Behaviors

Page 15: NEUZZ: Efficient Fuzzing with Neural Program SmoothingNEUZZ: Efficient Fuzzing with Neural Program Smoothing Dongdong She, Kexin Pei, Dave Epstein, Junfeng Yang, Baishakhi Ray, and

APeekIntoNNModel

15

Page 16: NEUZZ: Efficient Fuzzing with Neural Program SmoothingNEUZZ: Efficient Fuzzing with Neural Program Smoothing Dongdong She, Kexin Pei, Dave Epstein, Junfeng Yang, Baishakhi Ray, and

GeneralizationtoUnseenbranches

Observations:-  Realworldprograminputshavecriticalparts-  MostofbranchesareaffectedbythecriticalpartsNeuzzSolution:-  Identifycriticalpartsbasedonobservedbranches-  Performmoremutationsonthecriticalpartof

inputstoexploreunseenbranches

16

Page 17: NEUZZ: Efficient Fuzzing with Neural Program SmoothingNEUZZ: Efficient Fuzzing with Neural Program Smoothing Dongdong She, Kexin Pei, Dave Epstein, Junfeng Yang, Baishakhi Ray, and

DesignofNEUZZ

17

Page 18: NEUZZ: Efficient Fuzzing with Neural Program SmoothingNEUZZ: Efficient Fuzzing with Neural Program Smoothing Dongdong She, Kexin Pei, Dave Epstein, Junfeng Yang, Baishakhi Ray, and

Evaluation

Ø  10realworldprogramsØ  Lava-MandDARPACGCdatasetsØ  ComparisonwithRNN-basedfuzzersØ  Performanceofdifferentmodelchoices

18

Page 19: NEUZZ: Efficient Fuzzing with Neural Program SmoothingNEUZZ: Efficient Fuzzing with Neural Program Smoothing Dongdong She, Kexin Pei, Dave Epstein, Junfeng Yang, Baishakhi Ray, and

Evaluations:EdgeCoverageNEUZZvs.state-of-the-artfuzzers 10realworldapplicationsfor24hours

NEUZZachievesonaverage3xmoreedgecoveragethanotherfuzzers

19

Page 20: NEUZZ: Efficient Fuzzing with Neural Program SmoothingNEUZZ: Efficient Fuzzing with Neural Program Smoothing Dongdong She, Kexin Pei, Dave Epstein, Junfeng Yang, Baishakhi Ray, and

Evaluations:BugFindingNEUZZvs.state-of-the-artfuzzers

NEUZZfindsthemostnumberofbugsandall5bugtypesincludingtwo

newCVEs

20

Page 21: NEUZZ: Efficient Fuzzing with Neural Program SmoothingNEUZZ: Efficient Fuzzing with Neural Program Smoothing Dongdong She, Kexin Pei, Dave Epstein, Junfeng Yang, Baishakhi Ray, and

Evaluations:Lava-MandCGC

21

NEUZZoutperformsstate-of-the-artfuzzersonLAVA-MandCGC

Lava-Mdataset DARPACGCdataset

Page 22: NEUZZ: Efficient Fuzzing with Neural Program SmoothingNEUZZ: Efficient Fuzzing with Neural Program Smoothing Dongdong She, Kexin Pei, Dave Epstein, Junfeng Yang, Baishakhi Ray, and

Evaluations:NEUZZvs.RNN-basedFuzzer

NEUZZachieves6xmoreedgecoverageand20xlesstrainingtime

22

Page 23: NEUZZ: Efficient Fuzzing with Neural Program SmoothingNEUZZ: Efficient Fuzzing with Neural Program Smoothing Dongdong She, Kexin Pei, Dave Epstein, Junfeng Yang, Baishakhi Ray, and

Evaluations:EffectofDifferentNNs

23

NEUZZachievesbestperformancewithNN+Incremetallearning

Edgecoveragefor1Mmutations

Page 24: NEUZZ: Efficient Fuzzing with Neural Program SmoothingNEUZZ: Efficient Fuzzing with Neural Program Smoothing Dongdong She, Kexin Pei, Dave Epstein, Junfeng Yang, Baishakhi Ray, and

KeyTakeawaysofNEUZZ

●  UseNNgradientstoidentifythecriticallocationsofprograminputs

●  Focusmutationsonthecriticallocations●  Minimizeruntimeoverheadbyusingsimplefeed-forward

neuralnetworks●  Retrainthenetworkincrementallytofindnewcritical

locations

24

Page 25: NEUZZ: Efficient Fuzzing with Neural Program SmoothingNEUZZ: Efficient Fuzzing with Neural Program Smoothing Dongdong She, Kexin Pei, Dave Epstein, Junfeng Yang, Baishakhi Ray, and

GithubRepo

NEUZZisavailableathttps://github.com/Dongdongshe/neuzz

25

Page 26: NEUZZ: Efficient Fuzzing with Neural Program SmoothingNEUZZ: Efficient Fuzzing with Neural Program Smoothing Dongdong She, Kexin Pei, Dave Epstein, Junfeng Yang, Baishakhi Ray, and

NEUZZ:EfficientFuzzingwithNeuralProgramSmoothing

DongdongShe,KexinPei,DaveEpstein,JunfengYang,BaishakhiRay,andSumanJanaColumbiaUniversity

26