[PR #2817] [MERGED] horizon-server: bound HTTP request and header lines #4637

Closed
opened 2026-11-03 05:06:50 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/2817
Author: @sirrayi
Created: 10/27/2026
Status: ✅ Merged
Merged: 10/28/2026
Merged by: @ludovic111

Base: main ← Head: fix/server-http-line-limit


📝 Commits (1)

  • d3be8db horizon-server: bound HTTP request and header lines

📊 Changes

1 file changed (+46 additions, -2 deletions)

View changed files

📝 crates/horizon-server/src/http.rs (+46 -2)

📄 Description

🤖 Opened by sirrayi's AI agent (Devin), not by sirrayi themselves.

What and why

horizon-server's small HTTP server (the control API and the web panel) read the request line and the header lines with BufReader::read_line, which has no length limit. The 10 s read timeout applies per read, so a client that keeps streaming bytes without a newline grows the supervisor's memory without bound. The panel can be bound to a tailnet address.

Request and header lines are now read through take(MAX_LINE + 1). A line over 8 KiB gets 400 line too long.

Vanilla reference

none (Horizon's own server supervisor).

Self-check

  • cargo fmt --all -- --check ✅
  • cargo clippy -p horizon-server --all-targets -- -D warnings ✅
  • cargo test -p horizon-server (51) ✅
  • New test http::tests::a_line_past_the_limit_is_a_400.

Generated with Devin


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/horizon-rust/horizon/pull/2817 **Author:** [@sirrayi](https://github.com/sirrayi) **Created:** 10/27/2026 **Status:** ✅ Merged **Merged:** 10/28/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `fix/server-http-line-limit` --- ### 📝 Commits (1) - [`d3be8db`](https://github.com/horizon-rust/horizon/commit/d3be8dbf054254de72f40563fdd63a6926d67307) horizon-server: bound HTTP request and header lines ### 📊 Changes **1 file changed** (+46 additions, -2 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-server/src/http.rs` (+46 -2) </details> ### 📄 Description > 🤖 Opened by sirrayi's AI agent (Devin), not by sirrayi themselves. ## What and why `horizon-server`'s small HTTP server (the control API and the web panel) read the request line and the header lines with `BufReader::read_line`, which has no length limit. The 10 s read timeout applies per read, so a client that keeps streaming bytes without a newline grows the supervisor's memory without bound. The panel can be bound to a tailnet address. Request and header lines are now read through `take(MAX_LINE + 1)`. A line over 8 KiB gets `400 line too long`. ## Vanilla reference none (Horizon's own server supervisor). ## Self-check - `cargo fmt --all -- --check` ✅ - `cargo clippy -p horizon-server --all-targets -- -D warnings` ✅ - `cargo test -p horizon-server` (51) ✅ - New test `http::tests::a_line_past_the_limit_is_a_400`. Generated with [Devin](https://devin.ai) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-03 05:06:50 +07:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
horizon-rust/horizon#4637
No description provided.