mirror of
https://github.com/amnezia-vpn/amnezia-xray-core.git
synced 2026-10-13 21:33:49 +00:00
[GH-ISSUE #24] XHTTP inbound: unauthenticated session creation enables memory/goroutine exhaustion #5
Labels
No labels
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
amnezia-vpn/amnezia-xray-core#5
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?
Originally created by @FrogRocky on GitHub (Aug 17, 2026).
Original GitHub issue: https://github.com/amnezia-vpn/amnezia-xray-core/issues/24
Summary
The XHTTP (splithttp) inbound creates a full session for any request that carries a session id in the path/query, without any authentication or rate limiting, enabling unauthenticated memory and goroutine exhaustion.
Affected code:
transport/internet/splithttp/hub.go(upsertSession, ~lines 55–93) andtransport/internet/splithttp/upload_queue.go:30-38.Impact
Each accepted request allocates:
GetNormalizedScMaxBufferedPosts()slots (default 30),and sessions live for at least the ~30 s reaper interval even if never used. Session ids are only checked for existence, never validity, and the only pre-session check is a padding length.
Attack scenario (pre-protocol, pre-auth): an attacker sends ~200-byte POSTs like
/path/<random-uuid>/0with a valid-lengthx_paddingheader. 1M requests within the reaper window ≈ millions of live goroutines plus heavy allocator pressure → scheduler/memory DoS. With 1 MB bodies (scMaxEachPostBytesdefault 1,000,000), up to ~30 MB is parked per session for 30 s.Suggested fix (options)