chore(deps): update [mix] hackney (~> 1.18 → ~> 4.0) [security]#193
Open
wttj-bot[bot] wants to merge 1 commit into
Open
chore(deps): update [mix] hackney (~> 1.18 → ~> 4.0) [security]#193wttj-bot[bot] wants to merge 1 commit into
wttj-bot[bot] wants to merge 1 commit into
Conversation
4e9ec8f to
3dd1a26
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR contains the following updates:
~> 1.18→~> 4.0CRLF injection in cookie domain/path options in hackney
CVE-2026-47069 / EEF-CVE-2026-47069 / GHSA-mp55-p8c9-rfw2
More information
Details
Summary
Improper Neutralization of CRLF Sequences ('CRLF Injection') vulnerability in benoitc hackney allows HTTP Response Splitting. The hackney_cookie:setcookie/3 function in src/hackney_cookie.erl validates the Name and Value arguments against CRLF and control characters, but concatenates the domain and path options verbatim into the output iolist with no equivalent check. An attacker who controls either option — for example by supplying a Host header value forwarded as the cookie domain, or a request path forwarded as the cookie path — can inject a literal CRLF sequence and arbitrary additional Set-Cookie headers into the HTTP response.
This issue affects hackney: from 0.9.0 before 4.0.1.
Severity
CVSS:4.0/AV:L/AC:L/AT:P/PR:N/UI:N/VC:N/VI:L/VA:N/SC:N/SI:L/SA:NReferences
This data is provided by OSV.
CR/LF injection in query parameter in hackney
CVE-2026-47075 / EEF-CVE-2026-47075 / GHSA-j9wq-vxxc-94wf
More information
Details
Summary
Improper Neutralization of CRLF Sequences vulnerability in benoitc hackney allows HTTP Request Splitting. hackney does not percent-encode carriage return (\r) or line feed (\n) characters in the URL query component before constructing the HTTP/1.1 request target. Characters outside the grammar defined in RFC 3986 Section 3.4 must be percent-encoded, but hackney_url:make_url/3 passes the query binary directly without validation or escaping. An attacker who can control all or part of a URL passed to hackney can inject raw CRLF sequences into the query string, which are then sent as HTTP line breaks in the request target. This enables injection of arbitrary HTTP headers or splitting of the HTTP request.
This issue affects hackney: from 0 before 4.0.1.
Severity
CVSS:4.0/AV:L/AC:L/AT:P/PR:N/UI:A/VC:N/VI:H/VA:N/SC:N/SI:H/SA:NReferences
This data is provided by OSV.
SOCKS5 TLS upgrade ignores caller timeout in hackney
CVE-2026-47071 / EEF-CVE-2026-47071 / GHSA-gp9c-pm5m-5cxr
More information
Details
Summary
Uncontrolled Resource Consumption vulnerability in benoitc hackney allows Flooding. The SOCKS5 transport in src/hackney_socks5.erl correctly applies the caller-supplied timeout to the SOCKS5 negotiation phase, but then upgrades the connection to TLS using the two-argument form ssl:connect/2, which defaults to an infinite timeout. The Timeout value is in scope at the call site but is not forwarded. A hostile SOCKS5 proxy that completes the SOCKS5 handshake normally and then goes silent (or sends a partial TLS ServerHello and stalls) will cause the connecting process to block indefinitely, regardless of the connect_timeout or recv_timeout options supplied by the caller.
This issue affects hackney: from 0.10.0 before 4.0.1.
Severity
CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:N/VC:N/VI:N/VA:H/SC:N/SI:N/SA:NReferences
This data is provided by OSV.
SSRF allowlist bypass via percent-encoded host in hackney
CVE-2026-47076 / EEF-CVE-2026-47076 / GHSA-pj7v-xfvx-wmjq
More information
Details
Summary
Interpretation Conflict vulnerability in benoitc hackney allows Server Side Request Forgery. hackney_url:normalize/2 URL-decodes the host component after the URL has been parsed into a #hackney_url{} record. OTP's uri_string:parse/1 and inet:parse_address/1 do not decode percent-escapes in the host, so a URL such as http://%31%32%37%2E%30%2E%30%2E%31/ is seen by a caller's allowlist validator with host %31%32%37%2E%30%2E%30%2E%31 (not an IP address), which passes the allowlist check. hackney's normalizer then decodes the host to 127.0.0.1 and opens a TCP connection to loopback. Because hackney:request/5 always calls hackney_url:normalize/2 with no opt-out, every request that takes a binary or list URL is affected. The same technique reaches cloud instance metadata services (169.254.169.254), RFC1918 networks, and any admin interface listening on localhost.
This issue affects hackney: from 0.13.0 before 4.0.1.
Severity
CVSS:4.0/AV:L/AC:L/AT:P/PR:N/UI:N/VC:H/VI:N/VA:N/SC:H/SI:N/SA:NReferences
This data is provided by OSV.
Release Notes
benoitc/hackney (hackney)
v4.0.1: hackney 4.0.1Compare Source
Security release. Fixes 9 reported vulnerabilities (4 high, 4 medium, 1 low) plus one hardening change across the HTTP/1.1, HTTP/2, HTTP/3, WebSocket, cookie and URL handling code. No API changes, so it is a drop-in upgrade from 4.0.0.
If you use hackney directly or through a library (HTTPoison, Tesla's hackney adapter, ExAws, and others), please upgrade.
Security
High
Medium
Low
Hardening
to_atom/1no longer falls back tolist_to_atom/1, removing an atom-leak path (GHSA-6rmf, no CVE assigned).Dependencies
Credits
Thanks to PJUllrich, Ganbagana and tepel-chen for the reports, and to maennchen for coordinating disclosure.
Full changelog: https://github.com/benoitc/hackney/blob/master/NEWS.md
v4.0.0: hackney 4.0.0Compare Source
Hackney 4 trims the client down. The HTTP/2 and HTTP/3 stacks are now delegated to erlang_h2 and erlang_quic, so hackney no longer ships its own framing, HPACK / QPACK codecs, control streams or state machines. The HTTP/3 path is fully RFC 9114 compliant via
quic_h3, with ALPN negotiation, Alt-Svc discovery (RFC 7838), and the samehackney:request/5API as HTTP/1.1.The bundled metrics subsystem is gone. In its place a Go-style middleware chain runs around
hackney:request/1..5, configured per request with{middleware, [Fun, ...]}or globally viaapplication:set_env(hackney, middleware, [...]). Users plug in prometheus, telemetry or anything else without hackney owning the policy. See the Middleware Guide and the HTTP/3 Guide.Breaking
hackney_metrics,hackney_metrics_backend,hackney_metrics_prometheus,hackney_metrics_dummy. Themetrics_backendapp env is no longer read. Migration recipes for prometheus and telemetry are inguides/middleware.md. Pool state is still observable throughhackney_pool:get_stats/1.hackney:request/5API is unchanged.What's new
hackney_middleware): outermost-first composition, request rewrite, response rewrite, short-circuit, per-request or global config.quic_h3: pure Erlang QUIC stack, no NIFs. ALPN-negotiated, opt-in with{protocols, [http3, http2, http1]}orapplication:set_env(hackney, default_protocols, [http3, http2, http1]).Alt-Svcheaders are now parsed and cached on every response (HTTP/1.1, HTTP/2 and HTTP/3), so subsequent requests can upgrade to HTTP/3 transparently. Honorsclearand merges multipleAlt-Svcheaders per RFC 7230 §3.2.2.Deps
h20.4.0quic1.0.0Full changelog: https://github.com/benoitc/hackney/blob/4.0.0/NEWS.md
v3.2.1Compare Source
Bug Fixes
recv_timeoutoption being ignored for pooled connections (#832)handle_h2_frame/2for HTTP/2 window updates (#829)v3.2.0Compare Source
Refactor
src/libs/directory (all modules moved tosrc/)Performance
rand:bytes/1instead ofcrypto:strong_rand_bytes/1for mask keysAdded
h2spec_server.erl: Minimal HTTP/2 server for compliance testingh2spec_SUITE.erl: CT suite for running h2spec testsmake h2spec-testhackney_http3_e2e_SUITE.erl: Tests against Cloudflare, Google, quic.techmake http3-e2e-test,make all-e2e-testhackney_http2_machine_bench.erl)Bug Fixes
send_or_queue_data/4)donemessagev3.1.2Compare Source
Dependencies
quicdependency to 0.10.1v3.1.1Compare Source
Bug Fixes
quicdependency to 0.7.1 (fixes packet number reconstruction)Added
hackney_quic(verify, cacerts, cacertfile, SNI)hackney_h3(follow_redirect, max_redirect options)v3.1.0Compare Source
Refactor
rebar3 compile.Removed
Added
hackney_qpack.erlfor QPACK header compression (RFC 9204)Changed
hackney_quic:is_available/0now always returnstrue(pure Erlang is always available)Dependencies
quic~>0.5.1 (pure Erlang QUIC implementation)v3.0.3Compare Source
Bug Fixes
send_body/2now work correctly for iterative body streaming, supporting both statelessfun() -> {ok, Data} | eofand statefulfun(State) -> {ok, Data, NewState} | eofforms.CI
v3.0.2Compare Source
Bug Fixes
Content-Type: application/octet-streamheader when sending a body without explicit Content-Type (#823). This restores 1.x behavior and follows RFC 7231 recommendations.Dependencies
certifito 2.16.0 (#824)v3.0.1Compare Source
v3.0.0Compare Source
v2.0.1Compare Source
v2.0.0Compare Source
Configuration
📅 Schedule: Branch creation - "" (UTC), Automerge - At any time (no schedule defined).
🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.
♻ Rebasing: Never, or you tick the rebase/retry checkbox.
🔕 Ignore: Close this PR and you won't be reminded about this update again.
This PR has been generated by Renovate Bot.