aboutsummaryrefslogtreecommitdiff
path: root/doc/man7/libweb_http.7
diff options
context:
space:
mode:
authorXavier Del Campo Romero <xavi.dcr@tutanota.com>2024-02-19 23:00:56 +0100
committerXavier Del Campo Romero <xavi.dcr@tutanota.com>2024-02-19 23:00:56 +0100
commitafe0681c0b26bb64bad55d7e86770f346cfa043e (patch)
tree420dbf3084332bf1750d0986ea118b427aed7364 /doc/man7/libweb_http.7
parent9d9e0c2979f43297b2ebbf84f14f064f3f9ced0e (diff)
downloadlibweb-afe0681c0b26bb64bad55d7e86770f346cfa043e.tar.gz
Limit maximum multipart/form-data pairs and files
A malicious user could inject an infinite number of empty files or key/value pairs into a request in order to exhaust the device's resources.
Diffstat (limited to 'doc/man7/libweb_http.7')
-rw-r--r--doc/man7/libweb_http.730
1 files changed, 30 insertions, 0 deletions
diff --git a/doc/man7/libweb_http.7 b/doc/man7/libweb_http.7
index 0beb686..de627cb 100644
--- a/doc/man7/libweb_http.7
+++ b/doc/man7/libweb_http.7
@@ -94,6 +94,11 @@ struct http_cfg
const char *\fItmpdir\fP;
void *\fIuser\fP;
size_t \fImax_headers\fP;
+
+ struct http_cfg_post
+ {
+ size_t \fImax_pairs\fP, \fImax_files\fP;
+ } \fIpost\fP;
};
.EE
.in
@@ -221,6 +226,31 @@ Any extra headers sent by the client outside this maximum value shall be
silently ignored by
.IR libweb .
+.I post
+contains configuration parameters specific to
+.B POST
+requests:
+
+.I max_pairs
+refers to the maximum number of key/value pairs that shall be accepted by
+.I libweb
+on
+.B POST
+.IR multipart/form-data -encoded
+requests. If the maximum number of pairs is exceeded by the request,
+.I libweb
+shall terminate the connection.
+
+.I max_files
+refers to the maximum number of files that shall be accepted by
+.I libweb
+on
+.B POST
+.IR multipart/form-data -encoded
+requests. If the maximum number of files is exceeded by the request,
+.I libweb
+shall terminate the connection.
+
.SS HTTP payload
When a client submits a request to the server,