commit dde11b1

grunfink  ·  2026-09-02 07:56:42 +0000 UTC
parent 2085a9e
In activitypub_post_handler(), drop input messages that are too big.
1 files changed,  +6, -0
+6, -0
 1@@ -4110,6 +4110,12 @@ int activitypub_post_handler(const xs_dict *req, const char *q_path,
 2         xs_str_in(i_ctype, "application/ld+json") == -1)
 3         return 0;
 4 
 5+    if (p_size >= 100000) {
 6+        *body  = xs_str_new("too big");
 7+        *ctype = "text/plain";
 8+        return HTTP_STATUS_BAD_REQUEST;
 9+    }
10+
11     /* decode the message */
12     xs *msg = xs_json_loads(payload);
13     const char *id = xs_dict_get(msg, "id");