Am I affected?

type your mint version to check

Description

Allocation of Resources Without Limits or Throttling vulnerability in elixir-mint Mint allows attacker-controlled HTTP/2 servers to exhaust memory in a Mint client via PUSH_PROMISE flooding.

In lib/mint/http2.ex, 'Elixir.Mint.HTTP2':decode_push_promise_headers_and_add_response/5 inserts a :reserved_remote entry into conn.streams for every promised stream ID. The neighbouring 'Elixir.Mint.HTTP2':assert_valid_promised_stream_id/2 only verifies that the promised ID is even and not already present; client_settings.max_concurrent_streams is not consulted at promise time. The concurrency cap is only checked when the response HEADERS for the promised stream arrive, so a server that emits PUSH_PROMISE frames and withholds the matching HEADERS never trips that check.

HTTP/2 server push is accepted by default (client_settings.enable_push defaults to true). A single long-lived HTTP/2 connection to a hostile server lets that server pin one conn.streams entry per PUSH_PROMISE frame it sends, with no upper bound, until the client process runs out of memory.

This issue affects mint: from 0.2.0 before 1.9.0.

Weaknesses & attack patterns

Weakness

CWE-770 · Allocation of Resources Without Limits or Throttling in catalog → MITRE ↗

Attack patterns

CAPEC-130 · Excessive Allocation MITRE ↗

Affected — Hex / mint Hex.pm ↗ Repository ↗

0.2.0 < 1.9.0 affected
every other version: unaffected
cpe cpe:2.3:a:elixir-mint:mint:*:*:*:*:*:*:*:*
modules · source files · routines
modules 'Elixir.Mint.HTTP2'
source files lib/mint/http2.ex
routines 'Elixir.Mint.HTTP2':handle_push_promise/3 · 'Elixir.Mint.HTTP2':decode_push_promise_headers_and_add_response/5

Affected — GitHub / elixir-mint/mint Repository ↗

65c6394 < 70b97b6 affected
every other version: unaffected
cpe cpe:2.3:a:elixir-mint:mint:*:*:*:*:*:*:*:*
modules · source files · routines
modules 'Elixir.Mint.HTTP2'
source files lib/mint/http2.ex
routines 'Elixir.Mint.HTTP2':handle_push_promise/3 · 'Elixir.Mint.HTTP2':decode_push_promise_headers_and_add_response/5

Workarounds

Disable HTTP/2 server push on connections to untrusted servers by passing client_settings: [enable_push: false] to 'Elixir.Mint.HTTP':connect/4. This makes Mint reject any inbound PUSH_PROMISE frame with a PROTOCOL_ERROR before the vulnerable code path is reached.

References

Credits

Peter Ullrich Finder
Eric Meadows-Jönsson Remediation developer
Jonatan Männchen / EEF Analyst

CVSS breakdown

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