Watch
0
0
Fork
You've already forked hyperhive
0
hyperhive/hive-c0re/src/socket_server
Repository files (latest commit first)
Filename Latest commit message Latest commit date
atlas 65a1f8d902 hive-c0re: bound request lines on the agent and manager sockets
serve() read each request with read_line into an unbounded String, so
size checks such as the 4 KiB Send body limit ran only after the whole
line was buffered. Any process in an agent container can write to
/run/hive/mcp.sock, and one stream with no newline grew hive-c0re's heap
until the host OOM-killed it.

Read at most 16 MiB per line. The largest request a client sends is an
OperatorMsg from the agent web UI's /send, whose body axum's default
limit caps at 2 MiB (the gateway's nginx admits 10 MiB); JSON escaping
can roughly double that, and the cap is 4x the result. A longer line
gets a Response::Err, the same shape as the parse-error path, and the
connection is closed because the rest of the line is still unread.

The line is read as bytes and parsed with serde_json::from_slice, so a
line with invalid UTF-8 now gets a parse-error response instead of the
connection being dropped.

Closes #4718
2026-09-27 03:48:56 +02:00
..
config_approvals.rs remove the list_containers and request_update_meta_inputs MCP tools 2026-09-20 22:47:46 +02:00
mod.rs hive-c0re: bound request lines on the agent and manager sockets 2026-09-27 03:48:56 +02:00
schedules.rs hive-c0re: bound request lines on the agent and manager sockets 2026-09-27 03:48:56 +02:00