Skip to content

fix: wildcard server sends interactions to all clients#1339

Open
dogancanbakir wants to merge 1 commit intodevfrom
fix/wildcard-multi-client-poll
Open

fix: wildcard server sends interactions to all clients#1339
dogancanbakir wants to merge 1 commit intodevfrom
fix/wildcard-multi-client-poll

Conversation

@dogancanbakir
Copy link
Member

Summary

  • In wildcard mode (-wc), GetInteractionsWithId clears data on the first client's poll, starving all other clients
  • Add per-consumer read offsets (GetInteractionsWithIdForConsumer) so each client independently tracks its position in the shared data buffer
  • Clean up consumer offsets on deregister, evict stale consumers lazily, enforce configurable max buffer cap (INTERACTSH_MAX_SHARED_INTERACTIONS, default 10000)

Fixes #1296

In wildcard mode, GetInteractionsWithId clears data on first poll,
starving subsequent clients. Use per-consumer read offsets so each
client independently tracks its position in the shared data buffer.

Buffer cap is configurable via INTERACTSH_MAX_SHARED_INTERACTIONS
env var (default 10000).
@neo-by-projectdiscovery-dev
Copy link

neo-by-projectdiscovery-dev bot commented Feb 25, 2026

Neo - PR Security Review

No security issues found

Highlights

  • Implements per-consumer read offsets for wildcard mode to fix multi-client polling starvation
  • Adds buffer cap enforcement (INTERACTSH_MAX_SHARED_INTERACTIONS, default 10000) to prevent unbounded memory growth
  • Includes consumer cleanup on deregister and stale consumer eviction based on EvictionTTL
Hardening Notes
  • Consider adding rate limiting on the /poll endpoint to prevent abuse from authenticated clients making excessive polling requests
  • Add logging/metrics for buffer cap enforcement events in enforceMaxBuffer (storagedb.go:367) to monitor when the limit is reached and data is being trimmed
  • Consider adding a configurable maximum number of concurrent consumers per wildcard ID to prevent resource exhaustion from a single attacker registering many clients

Comment @neo help for available commands. · Open in Neo

@coderabbitai
Copy link

coderabbitai bot commented Feb 25, 2026

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix/wildcard-multi-client-poll

Comment @coderabbitai help to get the list of available commands and usage tips.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Wildcard server only sends interactions to one connected client, instead of all of them

1 participant