Skip to content

Security: add flags for TCP connection limits and timeouts#7518

Open
SungJin1212 wants to merge 7 commits into
cortexproject:masterfrom
SungJin1212:feat/memberlist-tcp-security-limits
Open

Security: add flags for TCP connection limits and timeouts#7518
SungJin1212 wants to merge 7 commits into
cortexproject:masterfrom
SungJin1212:feat/memberlist-tcp-security-limits

Conversation

@SungJin1212
Copy link
Copy Markdown
Member

@SungJin1212 SungJin1212 commented May 14, 2026

This PR adds TCP connection flags to address the security issues.

-memberlist.packet-read-timeout: Read deadline applied to every inbound packet connection. Connections that do not complete within this window are closed.
-memberlist.max-packet-size: Maximum size of a single inbound gossip packet. Enforced via io.LimitReader before io.ReadAll, preventing heap exhaustion from oversized payloads. Applies to packet-type messages only.
-memberlist.max-concurrent-connections: Maximum number of concurrent inbound TCP connections. Connections exceeding this limit are rejected immediately.

Which issue(s) this PR fixes:
Fixes #

Checklist

  • Tests updated
  • Documentation added
  • CHANGELOG.md updated - the order of entries should be [CHANGE], [FEATURE], [ENHANCEMENT], [BUGFIX]
  • docs/configuration/v1-guarantees.md updated if this PR introduces experimental flags

@SungJin1212 SungJin1212 force-pushed the feat/memberlist-tcp-security-limits branch 2 times, most recently from 6c101cc to ac76ac2 Compare May 14, 2026 12:23
friedrichg

This comment was marked as resolved.

@SungJin1212
Copy link
Copy Markdown
Member Author

@friedrichg
Thanks for the review. I fixed these to the latest commit.

Copy link
Copy Markdown
Member

@friedrichg friedrichg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just one more nit. Pre-approved!

Comment thread pkg/ring/kv/memberlist/tcp_transport.go Outdated
@dosubot dosubot Bot added the lgtm This PR has been approved by a maintainer label May 15, 2026
Comment thread pkg/ring/kv/memberlist/tcp_transport.go
Signed-off-by: SungJin1212 <tjdwls1201@gmail.com>
Signed-off-by: SungJin1212 <tjdwls1201@gmail.com>
Signed-off-by: SungJin1212 <tjdwls1201@gmail.com>
Signed-off-by: SungJin1212 <tjdwls1201@gmail.com>
@SungJin1212 SungJin1212 force-pushed the feat/memberlist-tcp-security-limits branch 2 times, most recently from 96de558 to 33dca62 Compare May 17, 2026 23:33
Signed-off-by: SungJin1212 <tjdwls1201@gmail.com>
@SungJin1212 SungJin1212 force-pushed the feat/memberlist-tcp-security-limits branch from 33dca62 to 6974569 Compare May 17, 2026 23:50
Comment thread pkg/ring/kv/memberlist/tcp_transport.go Outdated
Comment thread pkg/ring/kv/memberlist/tcp_transport.go
Signed-off-by: SungJin1212 <tjdwls1201@gmail.com>
Signed-off-by: SungJin1212 <tjdwls1201@gmail.com>
@SungJin1212 SungJin1212 requested a review from danielblando May 19, 2026 04:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

component/memberlist lgtm This PR has been approved by a maintainer size/XL type/security

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants