monkey: upgrade 1.8.4 -> 1.8.7
PATCH 1/2 monkey: upgrade 1.8.4 -> 1.8.7
Shortlog:
https://github.com/monkey/monkey/compare/v1.8.4...v1.8.7
---
.../monkey/{monkey_1.8.4.bb => monkey_1.8.7.bb} | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
rename meta-webserver/recipes-httpd/monkey/{monkey_1.8.4.bb => monkey_1.8.7.bb} (92%)meta-webserver/recipes-httpd/monkey/monkey_1.8.7.bb renamed from meta-webserver/recipes-httpd/monkey/monkey_1.8.4.bb +6 -2
@@ -7,13 +7,13 @@ LIC_FILES_CHKSUM = "file://LICENSE;md5=2ee41112a44fe7014dce33e26468ba93" SECTION = "net" -SRC_URI = "git://github.com/monkey/monkey;branch=master;protocol=https \ +SRC_URI = "git://github.com/monkey/monkey;branch=master;protocol=https;tag=v${PV} \ file://0001-fastcgi-Use-value-instead-of-address-of-sin6_port.patch \ file://0001-include-Fix-location-of-mk_core.h-etal.patch \ file://monkey.service \ file://monkey.init" -SRCREV = "94af273244369e1a8426d0d1f6376475aff90db9" +SRCREV = "0fd3bbd657c6d6339315709ef068493c572b973c" UPSTREAM_CHECK_COMMITS = "1"
@@ -51,6 +51,10 @@ do_install:append() { if ${@bb.utils.contains('DISTRO_FEATURES','systemd','true','false',d)}; then install -Dm 644 ${UNPACKDIR}/monkey.service ${D}/${systemd_unitdir}/system/monkey.service fi + + # QA Issue: monkey installs files in /var/volatile, but it is expected to be empty [empty-dirs] + # these folders are supposed to be recreated at runtime + find ${D}/var -type d -empty -delete } INITSCRIPT_NAME = "monkey"
PATCH 2/2 monkey: patch CVEs
These patches are about a number of CVEs files against the application:
CVE-2025-63649, CVE-2025-63650, CVE-2025-63651, CVE-2025-63652, CVE-2025-63653, CVE-2025-63655, CVE-2025-63656, CVE-2025-63657 and CVE-2025-63658.
These patches are taken from a pull request[1] that is referenced in the relevant bug report[2]. The patches don't target specific CVEs on separately, but they fix a number of CVEs altogether.
Based on upstream analysis (in the linked issue) a number of these CVEs are duplicates of each other and/or not exploitable. The valid CVEs are fixed by these patches.
I haven't added specific CVE info to the patches, one hand because of the above, it is hard to separate the patches by CVE, and secondarily because NVD tracks these CVEs with incorrect version
info: NVD considers 1.8.6 fully fixed, even though the patches are only in the master branch, untagged at this time. After updating the recipe to 1.8.6+, the vulnerabilites will disappear from the CVE report due to this.
[1]: https://github.com/monkey/monkey/pull/434
[2]: https://github.com/monkey/monkey/issues/426
--- ...tp-fix-malformed-request-crash-paths.patch | 160 ++++++++++++++++++ ...eduler-guard-protocol-close-callback.patch | 51 ++++++ ...server-parser-harden-boundary-checks.patch | 108 ++++++++++++ .../recipes-httpd/monkey/monkey_1.8.7.bb | 6 +- 4 files changed, 324 insertions(+), 1 deletion(-) create mode 100644 meta-webserver/recipes-httpd/monkey/files/0001-server-http-fix-malformed-request-crash-paths.patch create mode 100644 meta-webserver/recipes-httpd/monkey/files/0002-server-scheduler-guard-protocol-close-callback.patch create mode 100644 meta-webserver/recipes-httpd/monkey/files/0003-server-parser-harden-boundary-checks.patch
meta-webserver/recipes-httpd/monkey/files/0001-server-http-fix-malformed-request-crash-paths.patch new file +160 -0
@@ -0,0 +1,160 @@ +From 839620179e2b4e5982c53d8956d92e690d82960c Mon Sep 17 00:00:00 2001 +From: Eduardo Silva <[email protected]> +Date: Thu, 9 Apr 2026 12:11:52 -0600 +Subject: [PATCH] server: http: fix malformed request crash paths + +Fix the reproducible malformed-request crash paths in the HTTP +request lifecycle. + +Handle missing Host data in directory redirects, reject malformed +range delimiters before substring parsing, and avoid reusing invalid +request state while advancing pipelined requests. + +Verified by rebuilding with cmake --build build and replaying the +reported crash-inducing request fixtures against build/bin/monkey. + +Signed-off-by: Eduardo Silva <[email protected]> + +This patch is part of https://github.com/monkey/monkey/pull/434, +containing assorted CVE fixes. + +Upstream-Status: Backport [https://github.com/monkey/monkey/commit/1570f41231888ae8c7fbd719704e2486a952e45d] +Signed-off-by: Gyorgy Sarvari <[email protected]> +--- + mk_core/mk_memory.c | 10 ++++++++++ + mk_server/mk_http.c | 46 +++++++++++++++++++++++++++++++++++++++++---- + 2 files changed, 52 insertions(+), 4 deletions(-) + +diff --git a/mk_core/mk_memory.c b/mk_core/mk_memory.c +index c4073e23..008f7ac6 100644 +--- a/mk_core/mk_memory.c ++++ b/mk_core/mk_memory.c +@@ -52,6 +52,16 @@ char *mk_ptr_to_buf(mk_ptr_t p) + { + char *buf; + ++ if (!p.data || p.len == 0) { ++ buf = mk_mem_alloc(1); ++ if (!buf) { ++ return NULL; ++ } ++ ++ buf[0] = '\0'; ++ return buf; ++ } ++ + buf = mk_mem_alloc(p.len + 1); + if (!buf) return NULL; + +diff --git a/mk_server/mk_http.c b/mk_server/mk_http.c +index ad12a74a..f2f12554 100644 +--- a/mk_server/mk_http.c ++++ b/mk_server/mk_http.c +@@ -457,6 +457,10 @@ static int mk_http_range_parse(struct mk_http_request *sr) + if ((sep_pos = mk_string_char_search(sr->range.data, '-', sr->range.len)) < 0) + return -1; + ++ if (sep_pos < eq_pos) { ++ return -1; ++ } ++ + len = sr->range.len; + sh = &sr->headers; + +@@ -476,10 +480,16 @@ static int mk_http_range_parse(struct mk_http_request *sr) + /* =yyy-xxx */ + if ((eq_pos + 1 != sep_pos) && (len > sep_pos + 1)) { + buffer = mk_string_copy_substr(sr->range.data, eq_pos + 1, sep_pos); ++ if (!buffer) { ++ return -1; ++ } + sh->ranges[0] = (unsigned long) atol(buffer); + mk_mem_free(buffer); + + buffer = mk_string_copy_substr(sr->range.data, sep_pos + 1, len); ++ if (!buffer) { ++ return -1; ++ } + sh->ranges[1] = (unsigned long) atol(buffer); + mk_mem_free(buffer); + +@@ -493,6 +503,9 @@ static int mk_http_range_parse(struct mk_http_request *sr) + /* =yyy- */ + if ((eq_pos + 1 != sep_pos) && (len == sep_pos + 1)) { + buffer = mk_string_copy_substr(sr->range.data, eq_pos + 1, len); ++ if (!buffer) { ++ return -1; ++ } + sr->headers.ranges[0] = (unsigned long) atol(buffer); + mk_mem_free(buffer); + +@@ -522,7 +535,16 @@ static int mk_http_directory_redirect_check(struct mk_http_session *cs, + return 0; + } + ++ if (!sr->host.data || sr->host.len <= 0) { ++ mk_http_error(MK_CLIENT_BAD_REQUEST, cs, sr, server); ++ return -1; ++ } ++ + host = mk_ptr_to_buf(sr->host); ++ if (!host) { ++ mk_http_error(MK_CLIENT_BAD_REQUEST, cs, sr, server); ++ return -1; ++ } + + /* + * Add ending slash to the location string +@@ -588,6 +610,9 @@ static inline char *mk_http_index_lookup(mk_ptr_t *path_base, + } + + off = path_base->len; ++ if ((size_t) off >= buf_size) { ++ return NULL; ++ } + memcpy(buf, path_base->data, off); + + mk_list_foreach(head, server->index_files) { +@@ -1138,15 +1163,27 @@ int mk_http_request_end(struct mk_http_session *cs, struct mk_server *server) + ret = mk_http_parser_more(&cs->parser, cs->body_length); + if (ret == MK_TRUE) { + /* Our pipeline request limit is the same that our keepalive limit */ ++ if (cs->parser.i < 0 || ++ (unsigned int) (cs->parser.i + 1) >= cs->body_length) { ++ goto shutdown; ++ } ++ + cs->counter_connections++; + len = (cs->body_length - cs->parser.i) -1; ++ if (len <= 0) { ++ goto shutdown; ++ } + memmove(cs->body, + cs->body + cs->parser.i + 1, + len); + cs->body_length = len; + + /* Prepare for next one */ +- sr = mk_list_entry_first(&cs->request_list, struct mk_http_request, _head); ++ if (mk_list_is_empty(&cs->request_list) == 0) { ++ cs->close_now = MK_TRUE; ++ goto shutdown; ++ } ++ sr = &cs->sr_fixed; + mk_http_request_free(sr, server); + mk_http_request_init(cs, sr, server); + mk_http_parser_init(&cs->parser); +@@ -1626,9 +1663,10 @@ int mk_http_sched_done(struct mk_sched_conn *conn, + struct mk_http_request *sr; + + session = mk_http_session_get(conn); +- sr = mk_list_entry_first(&session->request_list, +- struct mk_http_request, _head); +- mk_plugin_stage_run_40(session, sr, server); ++ if (mk_list_is_empty(&session->request_list) != 0) { ++ sr = &session->sr_fixed; ++ mk_plugin_stage_run_40(session, sr, server); ++ } + + return mk_http_request_end(session, server); + }
meta-webserver/recipes-httpd/monkey/files/0002-server-scheduler-guard-protocol-close-callback.patch new file +51 -0
51 lines not on this page · raw message
meta-webserver/recipes-httpd/monkey/files/0003-server-parser-harden-boundary-checks.patch new file +108 -0
108 lines not on this page · raw message
meta-webserver/recipes-httpd/monkey/monkey_1.8.7.bb +5 -1
@@ -11,7 +11,11 @@ SRC_URI = "git://github.com/monkey/monkey;branch=master;protocol=https;tag=v${PV file://0001-fastcgi-Use-value-instead-of-address-of-sin6_port.patch \ file://0001-include-Fix-location-of-mk_core.h-etal.patch \ file://monkey.service \ - file://monkey.init" + file://monkey.init \ + file://0001-server-http-fix-malformed-request-crash-paths.patch \ + file://0002-server-scheduler-guard-protocol-close-callback.patch \ + file://0003-server-parser-harden-boundary-checks.patch \ + " SRCREV = "0fd3bbd657c6d6339315709ef068493c572b973c"