Am I affected?

type your erlang.org/otp version to check

Description

Missing Release of Resource after Effective Lifetime vulnerability in Erlang/OTP inets httpd allows an unauthenticated remote attacker to cause denial of service by sending valid request headers with a large Content-Length and then stalling before the body is complete.

httpd_request_handler:handle_info/2 cancels the request timeout as soon as a parse step succeeds, which includes the headers, and the clause that handles a decoder asking for more data re-arms the socket with {active, once} without setting any further timer. httpd_request:whole_body/2 returns such a continuation whenever the bytes received are fewer than the announced Content-Length, so a well-formed request that stops mid-body leaves the worker waiting indefinitely. The periodic byte-rate check that would reclaim it is armed only when minimum_bytes_per_second is configured, which it is not by default. Repeating this across connections occupies every worker permitted by max_clients and denies service to legitimate clients at negligible bandwidth cost.

This issue affects OTP from OTP 17.0 before OTP 27.3.4.17, from OTP 28.0 before OTP 28.5.0.6, and from OTP 29.0 before OTP 29.0.6, corresponding to inets from 5.10 before 9.3.2.7, from 9.4 before 9.6.2.3, and from 9.7 before 9.7.2. Whether OTP before OTP 17.0, corresponding to inets before 5.10, is affected is unknown.

Weaknesses & attack patterns

Weakness

CWE-772 · Missing Release of Resource after Effective Lifetime in catalog → MITRE ↗

Attack patterns

CAPEC-469 · HTTP DoS MITRE ↗

Affected — Erlang

< 17.0 status unknown
17.0 < 27.3.4.17 affected
maint-28 28.0 < 28.5.0.6 affected
maint-29 29.0 < 29.0.6 affected
every other version: unaffected
cpe cpe:2.3:a:erlang:erlang/otp:*:*:*:*:*:*:*:*
modules · source files · routines
modules httpd_request_handler · httpd_request
source files lib/inets/src/http_server/httpd_request_handler.erl · lib/inets/src/http_server/httpd_request.erl
routines httpd_request_handler:handle_info/2 · httpd_request_handler:cancel_request_timeout/1 · httpd_request:whole_body/2

Affected — pkg:otp/inets Repository ↗

< 5.10 status unknown
5.10 < 9.3.2.7 affected
9.4 < 9.6.2.3 affected
9.7 < 9.7.2 affected
every other version: unaffected
cpe cpe:2.3:a:erlang:erlang/otp:*:*:*:*:*:*:*:*
modules · source files · routines
modules httpd_request_handler · httpd_request
source files src/http_server/httpd_request_handler.erl · src/http_server/httpd_request.erl
routines httpd_request_handler:handle_info/2 · httpd_request_handler:cancel_request_timeout/1 · httpd_request:whole_body/2

Affected — GitHub / erlang/otp Repository ↗

84adefa < 81b453a affected
every other version: unaffected
cpe cpe:2.3:a:erlang:erlang/otp:*:*:*:*:*:*:*:*
modules · source files · routines
modules httpd_request_handler · httpd_request
source files lib/inets/src/http_server/httpd_request_handler.erl · lib/inets/src/http_server/httpd_request.erl
routines httpd_request_handler:handle_info/2 · httpd_request_handler:cancel_request_timeout/1 · httpd_request:whole_body/2

Workarounds

  • Set minimum_bytes_per_second in the httpd configuration, for example {minimum_bytes_per_second, 200}. This arms a periodic byte-rate check that terminates a connection which has stopped delivering data, reclaiming the parked worker. The check is disabled by default.
  • Place a reverse proxy in front of httpd that enforces its own body-read timeout, such as client_body_timeout in nginx.
  • Restrict access to the server to trusted clients where the deployment allows it.

References

Credits

Konrad Pietrzak / Ericsson Remediation developer
Lukas Backström / Erlang Solutions Analyst

CVSS breakdown

CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N
« All CVEs