Telegram (ask questions / claim the issue here first): https://t.me/+DOylgFv1jyJlNzM0
Why this matters
sse.controller.ts:15-26 getClientIp reads req.headers['x-forwarded-for'] unconditionally and returns its first entry as sourceIp; that value feeds sseService.checkCapacity(sourceIp) and addClient(...,sourceIp). Express never sets trust proxy, so this header is fully attacker-controlled - a client rotating a fake X-Forwarded-For per request opens unlimited SSE connections, defeating the per-IP connection cap and exhausting connection slots.
Acceptance criteria
Files to touch
backend/src/controllers/sse.controller.ts
backend/src/services/sse.service.ts
Out of scope
- Changing the per-IP limit value
- Redis-backed SSE fan-out
Why this matters
sse.controller.ts:15-26 getClientIp reads req.headers['x-forwarded-for'] unconditionally and returns its first entry as sourceIp; that value feeds sseService.checkCapacity(sourceIp) and addClient(...,sourceIp). Express never sets trust proxy, so this header is fully attacker-controlled - a client rotating a fake X-Forwarded-For per request opens unlimited SSE connections, defeating the per-IP connection cap and exhausting connection slots.
Acceptance criteria
Files to touch
backend/src/controllers/sse.controller.tsbackend/src/services/sse.service.tsOut of scope