eclipse-ee4j / eclipse-ee4j/tyrus

How to prevent DoS through Ping/Pong protocol

Open
#954 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Java
Stars
128
Forks
49
PR merge metrics
No merged PRs in 30d

Description

I am currently designing Tyrus-based WebSocket server. As part of the task, I am trying to make sure that single malicious (or buggy) client won't be able to saturate my server bandwidth.

For regular string or binary frames, I am able to decide upon each received frame whether the particular WebSocket consumption meets the policy I have defined and when I see too much data on particular session, I am able to close it.

Does Tyrus WebSocket API allow me to prevent a "ping flooding" attack? If my understanding is correct, Tyrus will automatically respond to Ping with corresponding Pong frame. While the maximum size of ping message is relatively small (125 bytes), the client might be able to transmit these with sufficiently high frequency. Since there is no "PingMessage" handler possible with Tyrus, I won't be able to ever see this ping-pong traffic when evaluating the fair-use policy for this particular client session.

Is there anything I can do to prevent such unexpected Ping behaviour when using Tyrus on the server-side?

Contributor guide

Open the contributing guide

Research direction

The issue names no source files, tests, or entry points. Start by reading the Tyrus server-side WebSocket API and its Ping/Pong handling, then determine whether control-frame frequency can be observed or limited. Done means an authoritative answer or an agreed implementation path for mitigating ping flooding, backed by a reproducible test if code changes are needed.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
backend, security
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
20/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.