Skip to content

Conversation

@gregw
Copy link
Contributor

@gregw gregw commented Oct 18, 2023

Use only IP tracking for the DosFilter to fix #1256

Use only IP tracking for the DosFilter to fix #1256

Signed-off-by: gregw <[email protected]>
@gregw gregw requested review from lorban and sbordet October 18, 2023 06:50
Copy link
Contributor

@lorban lorban left a comment

Choose a reason for hiding this comment

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

Just a few nits.


// Sets the _prefix_ most significant bits to 1
result[index] = (byte)~((1 << (8 - prefix)) - 1);
result[index] = (byte)-(1 << (8 - prefix));
Copy link
Contributor

Choose a reason for hiding this comment

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

Any reason why you changed the bit manipulation? It looks correct, but it's always hard to review without tests.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

To keep intellij happy

Use only IP tracking for the DosFilter.

Signed-off-by: gregw <[email protected]>
@gregw gregw requested a review from lorban October 18, 2023 13:12
Jetty places throttled requests in a priority queue, giving priority first to authenticated users and users with an HttpSession, then to connections identified by their IP addresses.
Connections with no way to identify them have lowest priority.
To uniquely identify authenticated users, you should implement the The extractUserId(ServletRequest request) function.
Jetty places throttled requests in a queue, and proceed only when there is capacity available.
Copy link
Contributor

Choose a reason for hiding this comment

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

This is the old documentation for Jetty 9.4.x, so leave it unchanged.

@sbordet sbordet self-requested a review October 18, 2023 19:57
@gregw gregw merged commit 168d871 into jetty-10.0.x Oct 18, 2023
gregw added a commit that referenced this pull request Oct 18, 2023
Use only IP tracking for the DosFilter to fix #1256

Signed-off-by: gregw <[email protected]>
@joakime joakime deleted the fix/jetty-10/1256/SimplifyDosFilter branch October 25, 2023 18:02
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.

DoSFilter leaks USER_AUTH entries

4 participants