mirror of
https://github.com/yhirose/cpp-httplib.git
synced 2026-12-04 22:08:23 +00:00
Add chunked_decoder_fuzzer and a seed corpus for multipart_parser_fuzzer (#2706)
* Add chunked_decoder_fuzzer and a seed corpus for multipart_parser_fuzzer * Apply clang-format to chunked_decoder_fuzzer.cc * Simplify chunked_decoder_fuzzer and tidy the seed corpora read_content_chunked() only touches the trailers and headers, which Request and Response share, so decoding into both ran the same code. Decode into a Response only. Drop the SIZE_MAX limit as well: fuzz inputs never get near the 100MB default, so both take the same branches. Adjust the first byte of the chunked seeds to the new selector, and remove the seed for SIZE_MAX. Drop the duplicated number prefixes from the multipart seed names, run both new corpora from the "all" target, and keep the fuzzer rules in the order of FUZZERS. --------- Co-authored-by: Sai Viswas Basetti <saiviswasbasettitw@gmail.com> Co-authored-by: yhirose <yuji.hirose.bug@gmail.com>
This commit is contained in:
37 files changed
+227
-1
No files matched your search
Binary file not shown.
Binary file not shown.
@@ -0,0 +1,5 @@
|
||||
1234567890123456--1234567890123456
|
||||
Content-Disposition: form-data; name="f"
|
||||
|
||||
v
|
||||
--1234567890123456--
|
||||
Binary file not shown.
@@ -0,0 +1,5 @@
|
||||
BOUND--BOUND
|
||||
Content-Disposition: form-data; name="a"
|
||||
|
||||
text contains --BOUND here
|
||||
--BOUND--
|
||||
@@ -0,0 +1,13 @@
|
||||
XYZ123--XYZ123
|
||||
Content-Disposition: form-data; name="t"
|
||||
|
||||
--XYZ123 not after CRLF
|
||||
|
||||
--XYZ12
|
||||
|
||||
-XYZ123
|
||||
|
||||
--xyz123
|
||||
|
||||
--XYZ_123␍ tail
|
||||
--XYZ123--
|
||||
@@ -0,0 +1,13 @@
|
||||
cdBad--cdBad
|
||||
Content-Disposition: form-data; filename="noname.txt"
|
||||
|
||||
missing name
|
||||
--cdBad
|
||||
Content-Disposition: form-data; name="x"; filename*=ISO-8859-1''abc
|
||||
|
||||
bad charset
|
||||
--cdBad
|
||||
Bad Header Without Colon
|
||||
|
||||
z
|
||||
--cdBad--
|
||||
@@ -0,0 +1,22 @@
|
||||
cdVar--cdVar
|
||||
content-disposition:FORM-DATA;name=bare
|
||||
|
||||
1
|
||||
--cdVar
|
||||
Content-Disposition: form-data; name="semi;colon"; filename="a\"b.txt"
|
||||
|
||||
2
|
||||
--cdVar
|
||||
Content-Disposition: form-data; name="u"; filename="x.txt"; filename*=UTF-8''%E2%82%AC%20rates.txt
|
||||
|
||||
3
|
||||
--cdVar
|
||||
Content-Disposition: form-data; name="dup"; name="dup"; name="other"
|
||||
|
||||
4
|
||||
--cdVar
|
||||
Content-Disposition: attachment; name="ignored"
|
||||
CONTENT-TYPE: text/html
|
||||
|
||||
5
|
||||
--cdVar--
|
||||
@@ -0,0 +1,11 @@
|
||||
empty--empty
|
||||
|
||||
|
||||
--empty
|
||||
Content-Disposition: form-data; name="e"
|
||||
|
||||
|
||||
--empty
|
||||
|
||||
|
||||
--empty--
|
||||
@@ -0,0 +1,6 @@
|
||||
BOUND--BOUND
|
||||
Content-Disposition: form-data; name="a"
|
||||
X-Custom: test
|
||||
|
||||
val
|
||||
--BOUND--
|
||||
Binary file not shown.
@@ -0,0 +1,9 @@
|
||||
pad--pad
|
||||
Content-Disposition: form-data; name="a"
|
||||
|
||||
ok
|
||||
--pad
|
||||
Content-Disposition: form-data; name="b"
|
||||
|
||||
x
|
||||
--pad--
|
||||
@@ -0,0 +1,6 @@
|
||||
BOUND
|
||||
--BOUND
|
||||
Content-Disposition: form-data; name="a"
|
||||
|
||||
val
|
||||
--BOUND--
|
||||
@@ -0,0 +1,9 @@
|
||||
unclosed--unclosed
|
||||
Content-Disposition: form-data; name="a"
|
||||
|
||||
first
|
||||
--unclosed
|
||||
Content-Disposition: form-data; name="b"
|
||||
|
||||
truncated content with no final delimiter
|
||||
--unclo
|
||||
@@ -0,0 +1,5 @@
|
||||
BOUND--BOUND
|
||||
Content-Disposition: form-data; name="a"
|
||||
|
||||
val
|
||||
--BOUND--
|
||||
@@ -0,0 +1,4 @@
|
||||
nocrlf--nocrlfContent-Disposition: form-data; name="x"
|
||||
|
||||
data
|
||||
--nocrlf--
|
||||
@@ -0,0 +1,4 @@
|
||||
hdrEnd--hdrEnd
|
||||
Content-Disposition: form-data; name="h"
|
||||
Content-Type: text/plain
|
||||
content right after headers--hdrEnd--
|
||||
@@ -0,0 +1,9 @@
|
||||
BOUND--BOUND
|
||||
Content-Disposition: form-data; name="a"
|
||||
|
||||
1
|
||||
--BOUND
|
||||
Content-Disposition: form-data; name="b"
|
||||
|
||||
2
|
||||
--BOUND--
|
||||
@@ -0,0 +1,5 @@
|
||||
BOUND--BOUND
|
||||
Content-Type: text/plain
|
||||
|
||||
orphaned data
|
||||
--BOUND--
|
||||
@@ -0,0 +1,15 @@
|
||||
sev3ral--sev3ral
|
||||
Content-Disposition: form-data; name="a"
|
||||
|
||||
alpha
|
||||
--sev3ral
|
||||
Content-Disposition: form-data; name="b"
|
||||
|
||||
bravo
|
||||
second line
|
||||
--sev3ral
|
||||
Content-Disposition: form-data; name="c"
|
||||
Content-Type: application/json
|
||||
|
||||
{"k":[1,2,3]}
|
||||
--sev3ral--
|
||||
@@ -0,0 +1,5 @@
|
||||
AaB03x--AaB03x
|
||||
Content-Disposition: form-data; name="field1"
|
||||
|
||||
value1
|
||||
--AaB03x--
|
||||
@@ -0,0 +1,5 @@
|
||||
BOUND--BOUND
|
||||
Content-Disposition: form-data; name="user"
|
||||
|
||||
Alice
|
||||
--BOUND--
|
||||
@@ -0,0 +1,5 @@
|
||||
BOUND--BOUND
|
||||
Content-Disposition : form-data ; name = "a"
|
||||
|
||||
val
|
||||
--BOUND--
|
||||
Reference in new issue
Block a user