Skip to content
DoS Disclosed report Intermediate CVE-2024-2511

Unbounded memory growth with session handling in TLSv1.3

A non-default TLS server configuration using the SSL_OP_NO_TICKET option can cause the session cache to fail to flush properly, leading to unbounded memory growth. A malicious client could deliberately trigger this to cause a denial of service.

manishpatidar Follow

Originally disclosed on HackerOne

Bounty$497 Low View original
  • Triaged in 21 hours
  • Fixed in 30 days
  • Paid in 30 days
  • Disclosed after 2 months

Summary by the program

OpenSSL Security Advisory: https://www.openssl.org/news/secadv/20240408.txt CVE-2024-2511

The report

Some non-default TLS server configurations can cause unbounded memory growth when processing TLSv1.3 sessions

This problem can occur in TLSv1.3 if the non-default SSL_OP_NO_TICKET option is being used (but not if early_data support is also configured and the default anti-replay protection is in use). In this case, under certain conditions when multiple Client connect to server, the session cache can get into an incorrect state and it will fail to flush properly as it fills. The session cache will continue to grow in an unbounded manner. A malicious client could deliberately create the scenario for this failure to force a Denial of Service.

Steps to reproduce:

  1. Multiple browser connecting to webserver and sending continuous connection request
  2. Session cache limit is set to 20 and with SSL_OP_NO_TICKET option.
  3. Initial few minutes cache size is ok ( within 20) but after that cache is increasing continuously and consuming all the heap memory available.

• When new Session is added , OpenSSL is trying to reduce the cache size but remove_session_lock (ssl_update_cache -> SSL_CTX_add_session ->remove_session_lock) not able to remove the entries from cache • ctx->session_cache_tail passed to remove_session_lock having session_id_length as zero and there is a check in remove_session_lock that only non zero session_id_length are deleted. After that no old session are deleted from cache and new session are added to cache and keep increasing the cache.

image.png
image.png From the original on HackerOne

Reason:session was added to cache but later session_id_length was update as zero. After that cache tail have session_id_length as zero and no entry is deleted after that.

image_(1).png
image_(1).png From the original on HackerOne
image_(2).png
image_(2).png

Impact

An attacker may exploit certain server configurations to trigger unbounded memory growth that would lead to a Denial of Service. This issue only affects TLS servers supporting TLSv1.3. It does not affect TLS clients.

The original report as published on HackerOne, by manishpatidar. Images and videos are our own copies; raw HTML is shown as text. View it on HackerOne.

Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.

How it worked

Root cause

Likely a session was added to the cache but its session_id_length was later set to zero, and the removal function only deletes entries with a non-zero session_id_length, so the cache tail entry is never removed and the cache grows without bound.

Impact

An attacker may exploit certain server configurations to trigger unbounded memory growth that would lead to a Denial of Service.

What the attacker needed

TLS server supporting TLSv1.3; SSL_OP_NO_TICKET option enabled; early_data not configured with anti-replay

How it was found

  1. Multiple browsers connect to the web server and send continuous connection requests.
  2. The session cache limit is set to 20 and the SSL_OP_NO_TICKET option is enabled.
  3. Initially the cache size stays within the limit, but after a few minutes it increases continuously and consumes all available heap memory.

Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.

Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.

When a server handles many secure connections, it keeps a small cache of session information to speed up reconnections. In this bug, under a specific non-default setting, the cache stops removing old entries and keeps growing until the server runs out of memory. An attacker could exploit this to make the server crash or become unresponsive.

What is DoS?

A request that exhausts resources or crashes a component. Many programs forbid testing it; reports usually show it from code, not by attacking.

More from Internet Bug Bounty

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Denial of service

The lesson behind this report.

A request that exhausts resources or crashes a component. Many programs forbid testing it; reports usually show it from code, not by attacking.