Miggo Logo

CVE-2025-3864:
Hackney fails to properly release HTTP connections to the pool

2.3

CVSS Score
4.0

Basic Information

EPSS Score
0.43867%
Published
5/28/2025
Updated
5/28/2025
KEV Status
No
Technology
TechnologyErlang

Technical Details

CVSS Vector
CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:P/VC:N/VI:N/VA:L/SC:N/SI:N/SA:N/E:X/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X
Package NameEcosystemVulnerable VersionsFirst Patched Version
hackneyerlang< 1.24.01.24.0

Vulnerability Intelligence
Miggo AIMiggo AI

Miggo AIRoot Cause Analysis

The vulnerability CVE-2025-3864 in Hackney arises from the improper release of HTTP connections to the pool after handling 307 Temporary Redirect responses (and other redirect statuses like 301, 302, 303, 308). This can lead to connection pool exhaustion and a denial-of-service.

The analysis of the provided patch (commit 8f13ddac50d1626f8b9a47a08bd599e4efe1773d) pinpoints the hackney:reply_response/2 function in src/hackney.erl as the location of the vulnerability and its fix.

Before the patch, when reply_response/2 handled a response where the body was not expected to be streamed by the client (NState#client.with_body is false), it would proceed to update the state via hackney_manager:update_state/1. However, for redirect responses in conjunction with a connection pool, merely updating the state was insufficient. The connection would not be returned to the pool because the (potentially empty) body of the redirect response was not explicitly skipped or consumed. This is a necessary step for the hackney_pool mechanism to consider the connection free.

The patch rectifies this by introducing a specific check within reply_response/2. It now determines if the response is a redirect (IsRedirect) and if a connection pool is being used (IsPool). If both conditions are true, it explicitly calls hackney_response:skip_body(NState). This action ensures that the connection is properly processed and made available for release back to the pool, thus preventing exhaustion.

Therefore, hackney:reply_response/2 is the key function that, in its vulnerable state, contained the flawed logic. During exploitation (repeated 307 redirects to an application using Hackney with a connection pool), this function would be invoked, and its failure to release connections would manifest as the denial of service.

Vulnerable functions

Only Mi**o us*rs **n s** t*is s**tion

WAF Protection Rules

WAF Rule

***kn*y **ils to prop*rly r*l**s* *TTP *onn**tions to t** pool **t*r **n*lin* *** T*mpor*ry R**ir**t r*spons*s. R*mot* *tt**k*rs **n *xploit t*is to *x**ust *onn**tion pools, **usin* **ni*l o* s*rvi** in *ppli**tions usin* t** li*r*ry. *ix *or t*is i

Reasoning

T** vuln*r**ility *V*-****-**** in ***kn*y *ris*s *rom t** improp*r r*l**s* o* *TTP *onn**tions to t** pool **t*r **n*lin* *** T*mpor*ry R**ir**t r*spons*s (*n* ot**r r**ir**t st*tus*s lik* ***, ***, ***, ***). T*is **n l*** to *onn**tion pool *x**us