stability: validate numeric bounds on actions log params #3

Open
opened 2026-05-23 18:30:10 +00:00 by Klaus · 0 comments
Owner

Problem

operation/actions/runs.go accepts max_bytes and tail_lines parameters without bounds. A caller can request multi-GB log payloads or unreasonable line counts, which will exhaust memory in the MCP server process before any response is returned.

Suggested direction

Add explicit caps in the tool handler:

  • max_bytes ≤ ~10 MB (configurable via flag if larger is ever needed)
  • tail_lines ≤ 10_000
  • Reject negatives with a clear error
    Pair with the broader pagination work in the per_page issue.
## Problem `operation/actions/runs.go` accepts `max_bytes` and `tail_lines` parameters without bounds. A caller can request multi-GB log payloads or unreasonable line counts, which will exhaust memory in the MCP server process before any response is returned. ## Suggested direction Add explicit caps in the tool handler: - `max_bytes` ≤ ~10 MB (configurable via flag if larger is ever needed) - `tail_lines` ≤ 10_000 - Reject negatives with a clear error Pair with the broader pagination work in the per_page issue.
Klaus referenced this issue from a commit 2026-05-23 18:47:28 +00:00
Sign in to join this conversation.
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Klaus/gitea-mcp#3