1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
|
load("//bazel:fuzz_target.bzl", "java_fuzz_target_test")
java_fuzz_target_test(
name = "ExampleFuzzer",
srcs = [
"src/main/java/com/example/ExampleFuzzer.java",
"src/main/java/com/example/ExampleFuzzerHooks.java",
],
# Comment out the next line to keep the fuzzer running indefinitely.
hook_classes = ["com.example.ExampleFuzzerHooks"],
target_class = "com.example.ExampleFuzzer",
)
java_fuzz_target_test(
name = "ExampleFuzzerWithNative",
srcs = [
"src/main/java/com/example/ExampleFuzzerWithNative.java",
],
native_libs = ["//examples/src/main/native"],
target_class = "com.example.ExampleFuzzerWithNative",
use_asan = True,
deps = [
"//agent:jazzer_api_deploy.jar",
],
)
java_fuzz_target_test(
name = "ExampleValueProfileFuzzer",
srcs = [
"src/main/java/com/example/ExampleValueProfileFuzzer.java",
],
# Comment out the next line to keep the fuzzer running indefinitely.
fuzzer_args = ["-use_value_profile=1"],
target_class = "com.example.ExampleValueProfileFuzzer",
)
java_fuzz_target_test(
name = "JpegImageParserFuzzer",
srcs = [
"src/main/java/com/example/JpegImageParserFuzzer.java",
],
fuzzer_args = ["-fork=5"],
target_class = "com.example.JpegImageParserFuzzer",
deps = [
"@maven//:org_apache_commons_commons_imaging",
],
)
java_fuzz_target_test(
name = "GifImageParserFuzzer",
srcs = [
"src/main/java/com/example/GifImageParserFuzzer.java",
],
target_class = "com.example.GifImageParserFuzzer",
deps = [
"@maven//:org_apache_commons_commons_imaging",
],
)
java_fuzz_target_test(
name = "TiffImageParserFuzzer",
srcs = [
"src/main/java/com/example/TiffImageParserFuzzer.java",
],
tags = ["manual"],
target_class = "com.example.TiffImageParserFuzzer",
deps = [
"@maven//:org_apache_commons_commons_imaging",
],
)
java_fuzz_target_test(
name = "JsonSanitizerCrashFuzzer",
srcs = [
"src/main/java/com/example/JsonSanitizerCrashFuzzer.java",
],
target_class = "com.example.JsonSanitizerCrashFuzzer",
deps = [
"@maven//:com_mikesamuel_json_sanitizer",
],
)
java_fuzz_target_test(
name = "JsonSanitizerDenylistFuzzer",
srcs = [
"src/main/java/com/example/JsonSanitizerDenylistFuzzer.java",
],
target_class = "com.example.JsonSanitizerDenylistFuzzer",
deps = [
"@maven//:com_mikesamuel_json_sanitizer",
],
)
java_fuzz_target_test(
name = "JsonSanitizerIdempotenceFuzzer",
srcs = [
"src/main/java/com/example/JsonSanitizerIdempotenceFuzzer.java",
],
target_class = "com.example.JsonSanitizerIdempotenceFuzzer",
deps = [
"@maven//:com_mikesamuel_json_sanitizer",
],
)
java_fuzz_target_test(
name = "JsonSanitizerValidJsonFuzzer",
srcs = [
"src/main/java/com/example/JsonSanitizerValidJsonFuzzer.java",
],
target_class = "com.example.JsonSanitizerValidJsonFuzzer",
deps = [
"@maven//:com_google_code_gson_gson",
"@maven//:com_mikesamuel_json_sanitizer",
],
)
java_fuzz_target_test(
name = "JacksonCborFuzzer",
srcs = [
"src/main/java/com/example/JacksonCborFuzzer.java",
],
target_class = "com.example.JacksonCborFuzzer",
deps = [
"@maven//:com_fasterxml_jackson_core_jackson_core",
"@maven//:com_fasterxml_jackson_core_jackson_databind",
"@maven//:com_fasterxml_jackson_dataformat_jackson_dataformat_cbor",
],
)
java_fuzz_target_test(
name = "FastJsonFuzzer",
srcs = [
"src/main/java/com/example/FastJsonFuzzer.java",
],
target_class = "com.example.FastJsonFuzzer",
deps = [
"@maven//:com_alibaba_fastjson",
],
)
java_fuzz_target_test(
name = "TurboJpegFuzzer",
srcs = [
"src/main/java/com/example/TurboJpegFuzzer.java",
],
fuzzer_args = [
"-rss_limit_mb=8196",
],
native_libs = [
"@libjpeg_turbo//:turbojpeg_native",
],
tags = ["manual"],
target_class = "com.example.TurboJpegFuzzer",
use_asan = True,
deps = [
"@libjpeg_turbo//:turbojpeg_java",
],
)
java_binary(
name = "examples",
create_executable = False,
resource_jars = [
":ExampleFuzzer_target_deploy.jar",
":ExampleValueProfileFuzzer_target_deploy.jar",
":FastJsonFuzzer_target_deploy.jar",
":JacksonCborFuzzer_target_deploy.jar",
":JpegImageParserFuzzer_target_deploy.jar",
":JsonSanitizerDenylistFuzzer_target_deploy.jar",
],
visibility = ["//visibility:public"],
)
|