mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2026-12-03 21:18:19 +07:00
[PR #5361] [MERGED] fix(runtime): cap remote node response size to bound master memory #5856
Labels
No labels
backlog
bug
clarification needed
documentation
duplicate
enhancement
github_actions
good first issue
invalid
javascript
New Feature
PR welcomed
pull-request
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
MHSanaei/3x-ui#5856
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/MHSanaei/3x-ui/pull/5361
Author: @n0ctal
Created: 6/15/2026
Status: ✅ Merged
Merged: 6/19/2026
Merged by: @MHSanaei
Base:
main← Head:pr-remote-response-cap📝 Commits (1)
4856c9bfix(runtime): cap remote node response size to bound master memory📊 Changes
2 files changed (+152 additions, -4 deletions)
View changed files
📝
internal/web/runtime/remote.go(+56 -4)📝
internal/web/runtime/remote_test.go(+96 -0)📄 Description
Summary
Caps the size of a remote node's HTTP response that the master will buffer.
Why
Remote node responses were read with an unbounded
io.ReadAll, so a broken or hostile node could force the master panel to buffer an arbitrarily large body (memory-exhaustion). All node calls funnel through a singleRemote.domethod.Scope
Content-Lengthio.LimitReadercap (64 MiB), returning a typed oversize errorValidation
cap+1boundary, an oversize streamed body, a normal envelope, and non-OK status precedencego test -racepassesRisk
Low–Medium. Touches the shared node-RPC path, but behavior is preserved for normal responses and the change is test-backed.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.