Skip to content

test OOM by slow read attack#618

Open
kingluo wants to merge 7 commits intomasterfrom
jinhua/fix-1346-slow-read
Open

test OOM by slow read attack#618
kingluo wants to merge 7 commits intomasterfrom
jinhua/fix-1346-slow-read

Conversation

@kingluo
Copy link
Copy Markdown
Contributor

@kingluo kingluo commented Apr 25, 2024

part of #612

CVE-2019-9511 “Data Dribble”
CVE-2019-9517 “Internal Data Buffering”

Both attacks accumulate big responses from the backend which causes OOM.

The strange thing is, keepalive_timeout does not help, it does not reset or fin the TCP connection. For example, in “Internal Data Buffering”, the keepalive timer only stops the TCP retransmits from tempesta but does not reset the connection. I need to look into this more.

@kingluo
Copy link
Copy Markdown
Contributor Author

kingluo commented Apr 26, 2024

There are two workarounds for this issue:

  1. keepalive_timeout will send a FIN, so the downstream connection will be closed after the timeout, and the large response body received from the upstream will be discarded, so OOM is avoided.

  2. set http_body_len frang limit.

But IMO, the perfect solution may be to support buffering: tempesta-tech/tempesta#498

I think it also fixes #1715.

@kingluo kingluo marked this pull request as ready for review May 6, 2024 13:12
@RomanBelozerov
Copy link
Copy Markdown
Contributor

@kingluo @krizhanovsky @const-t We should not use keepalive_timeout and http_body_len:

  1. http_body_len - an attacker can just request a resource with a body less then http_body_len and create a lot of streams/connections. And we cannot set a small value for this directive + it work for a response/request at the same time.
  2. I think keepalive_timeout also won't help from these attacks. The attacker can consume a lot of memory in a few seconds in a lot of connections/streams. And we cannot set a small value for keepalive_timeout, right?

I think we should wait for #498 issue or make a temporary workaround.

@kingluo kingluo linked an issue Aug 12, 2024 that may be closed by this pull request
6 tasks
@RomanBelozerov RomanBelozerov marked this pull request as draft December 20, 2024 13:28
@RomanBelozerov RomanBelozerov self-assigned this Mar 11, 2026
@RomanBelozerov RomanBelozerov requested review from RomanBelozerov and removed request for RomanBelozerov March 11, 2026 13:27
@RomanBelozerov RomanBelozerov force-pushed the jinhua/fix-1346-slow-read branch from d3f7ce4 to f484e7e Compare March 11, 2026 13:29
@RomanBelozerov RomanBelozerov marked this pull request as ready for review March 11, 2026 13:29
@RomanBelozerov RomanBelozerov force-pushed the jinhua/fix-1346-slow-read branch from c28e670 to 36e9d6f Compare March 19, 2026 12:03
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.

http2: tests for CVE-2019-9512/9517

3 participants