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, Mint.HTTP2.decodepushpromiseheadersandaddresponse/5 inserts a :reservedremote entry into conn.streams for every promised stream ID. The neighbouring Mint.HTTP2.assertvalidpromisedstreamid/2 only verifies that the promised ID is even and not already present; clientsettings.maxconcurrentstreams 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 (clientsettings.enablepush 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.
Disable HTTP/2 server push on connections to untrusted servers by passing clientsettings: [enablepush: false] to Mint.HTTP.connect/4. This makes Mint reject any inbound PUSHPROMISE frame with a PROTOCOLERROR before the vulnerable code path is reached.
{
"cpe_ids": [
"cpe:2.3:a:elixir-mint:mint:*:*:*:*:*:*:*:*"
],
"capec_ids": [
"CAPEC-130"
],
"cwe_ids": [
"CWE-770"
]
}