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 a request with a chunked body whose chunk-size line is not a hexadecimal number. The worker serving the connection is never released and no timeout reclaims it, so repeating the request across connections occupies every available worker and denies service to legitimate clients. No authentication is required and the default configuration is affected.

The chunk-size line must arrive in a write separate from the headers. When the body accompanies the headers, httpd_request_handler:handle_body/3 calls http_chunk:decode/3 inside a try ... catch throw:Error, so the {error, {chunk_size, _}} thrown by http_chunk:decode_size/4 is answered with 400 Bad Request. When the chunk size arrives later, the decoder is resumed through a bare catch in httpd_request_handler:handle_info/2, which converts the throw into a return value rather than raising it; the resulting error tuple is then treated as the next decoder continuation, the socket is re-armed, and the worker waits for data that never comes. The request timeout has already been cancelled at the point the headers were accepted, and the periodic byte-rate check is only armed when minimum_bytes_per_second is configured, which it is not by default.

This issue affects OTP from OTP 18.1.4 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 6.0.3 before 9.3.2.7, from 9.4 before 9.6.2.3, and from 9.7 before 9.7.2.

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

18.1.4 < 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 http_chunk · httpd_request_handler
source files lib/inets/src/http_lib/http_chunk.erl · lib/inets/src/http_server/httpd_request_handler.erl
routines http_chunk:decode_size/4 · httpd_request_handler:handle_info/2 · httpd_request_handler:handle_body/3

Affected — pkg:otp/inets Repository ↗

6.0.3 < 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 http_chunk · httpd_request_handler
source files src/http_lib/http_chunk.erl · src/http_server/httpd_request_handler.erl
routines http_chunk:decode_size/4 · httpd_request_handler:handle_info/2 · httpd_request_handler:handle_body/3

Affected — GitHub / erlang/otp Repository ↗

77acb47 and up affected
a3adf63 not affected
df1a9ca not affected
bd4e743 not affected
every other version: unaffected
cpe cpe:2.3:a:erlang:erlang/otp:*:*:*:*:*:*:*:*
modules · source files · routines
modules http_chunk · httpd_request_handler
source files lib/inets/src/http_lib/http_chunk.erl · lib/inets/src/http_server/httpd_request_handler.erl
routines http_chunk:decode_size/4 · httpd_request_handler:handle_info/2 · httpd_request_handler:handle_body/3

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 within a few seconds. The check is disabled by default, and any positive value suffices because an affected connection delivers no further data at all.
  • Place a reverse proxy in front of httpd that validates chunked transfer encoding and rejects malformed chunk framing before it reaches httpd.
  • Restrict access to the server to trusted clients where the deployment allows it.

References

Credits

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

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