mirror of
https://github.com/yhirose/cpp-httplib.git
synced 2026-11-13 17:00:40 +00:00
Add server_mount_fuzzer for static file serving (#2666)
Fuzz Server::handle_file_request through a mount point backed by a temporary directory that holds symlinks escaping the mount root, one of them into a sibling directory sharing its name prefix. Abort if a token stored outside the root appears in a response. The seeds are based on those of #2661. Move FuzzedStream into fuzzed_stream.h so that both server fuzzers share it, and add FuzzableServer::MarkAsRunning(), without which a server that is not listening writes no file.
This commit is contained in:
1 parent
53a7f4964e
commit
546e821c65
17 files changed
+272
-78
No files matched your search
@@ -0,0 +1,3 @@
|
||||
HEAD /mnt/a.txt HTTP/1.1
|
||||
Host: x
|
||||
|
||||
@@ -0,0 +1,4 @@
|
||||
GET /mnt/a.txt HTTP/1.1
|
||||
Host: x
|
||||
If-Modified-Since: Mon, 01 Jan 2024 00:00:00 GMT
|
||||
|
||||
@@ -0,0 +1,3 @@
|
||||
GET /mnt/index.html HTTP/1.1
|
||||
Host: x
|
||||
|
||||
@@ -0,0 +1,4 @@
|
||||
GET /mnt/index.html HTTP/1.1
|
||||
Host: x
|
||||
If-None-Match: W/"bogusetag"
|
||||
|
||||
@@ -0,0 +1,3 @@
|
||||
GET /mnt/link-in.txt HTTP/1.1
|
||||
Host: x
|
||||
|
||||
@@ -0,0 +1,3 @@
|
||||
GET /mnt/link-out.txt HTTP/1.1
|
||||
Host: x
|
||||
|
||||
@@ -0,0 +1,3 @@
|
||||
GET /mnt/link-sibling.txt HTTP/1.1
|
||||
Host: x
|
||||
|
||||
@@ -0,0 +1,3 @@
|
||||
GET /mnt/missing.txt HTTP/1.1
|
||||
Host: x
|
||||
|
||||
@@ -0,0 +1,4 @@
|
||||
GET /mnt/a.txt HTTP/1.1
|
||||
Host: x
|
||||
Range: bytes=0-3
|
||||
|
||||
@@ -0,0 +1,3 @@
|
||||
GET /mnt/sub/ HTTP/1.1
|
||||
Host: x
|
||||
|
||||
@@ -0,0 +1,3 @@
|
||||
GET /mnt/../../../../etc/passwd HTTP/1.1
|
||||
Host: x
|
||||
|
||||
@@ -0,0 +1,3 @@
|
||||
GET /mnt/%2e%2e/secret.txt HTTP/1.1
|
||||
Host: x
|
||||
|
||||
Reference in new issue
Block a user