Update Rust crate hyper to 0.14 [SECURITY] - abandoned #44
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:
0.12
->0.14
0.12
->0.14
GitHub Vulnerability Alerts
CVE-2021-32715
Summary
hyper's HTTP/1 server code had a flaw that incorrectly parses and accepts requests with a
Content-Length
header with a prefixed plus sign, when it should have been rejected as illegal. This combined with an upstream HTTP proxy that doesn't parse suchContent-Length
headers, but forwards them, can result in "request smuggling" or "desync attacks".Vulnerability
The flaw exists in all prior versions of hyper, if built with
rustc
v1.5.0 or newer.Example:
This request gets accepted and hyper reads the body as abc. The request should be rejected, according to RFC 7230, since the ABNF for
Content-Length
only allows forDIGIT
s. This is due to using theFromStr
implementation foru64
in the standard library. By differing from the spec, it is possible to send requests like these to endpoints that have different HTTP implementations, with different interpretations of the payload semantics, and cause "desync attacks".In this particular case, an upstream proxy would need to error when parsing the
Content-Length
, but not reject the request (swallowing its own error), and forwarding the request as-is with theContent-Length
still included. Then the upstream proxy and hyper would disagree on the length of the request body. The combination of these factors would be extremely rare.Read more about desync attacks: https://portswigger.net/research/http-desync-attacks-request-smuggling-reborn
Impact
To determine if vulnerable, all these things must be true:
Content-Length
header, OR can parse the length with the plus sign, the desync attack cannot succeed.Patches
We have released the following patch versions:
Workarounds
Besides upgrading hyper, you can take the following options:
Content-Length
header.Content-Length
headers with a plus sign prefix.Credits
This issue was initially reported by Mattias Grenfeldt and Asta Olofsson.
CVE-2021-32714
Summary
hyper's HTTP server and client code had a flaw that could trigger an integer overflow when decoding chunk sizes that are too big. This allows possible data loss, or if combined with an upstream HTTP proxy that allows chunk sizes larger than hyper does, can result in "request smuggling" or "desync attacks".
Vulnerability
Example:
hyper only reads the rightmost 64-bit integer as the chunk size. So it reads
f0000000000000003
as3
. A loss of data can occur since hyper would then read only 3 bytes of the body. Additionally, an HTTP request smuggling vulnerability would occur if using a proxy which instead has prefix truncation in the chunk size, or that understands larger than 64-bit chunk sizes.Read more about desync attacks: https://portswigger.net/research/http-desync-attacks-request-smuggling-reborn
Impact
To determine if vulnerable to data loss, these things must be true:
To determine if vulnerable to desync attacks, these things must be true:
Patches
We have released the following patch versions:
Workarounds
Besides upgrading hyper, you can take the following options:
Transfer-Encoding
header.Transfer-Encoding
chunk sizes greater than what fits in 64-bit unsigned integers.Credits
This issue was initially reported by Mattias Grenfeldt and Asta Olofsson.
GHSA-f67m-9j94-qv9j
Affected versions of this crate called
mem::uninitialized()
in the HTTP1 parser to create values of typehttparse::Header
(from thehttparse
crate).This is unsound, since
Header
contains references and thus must be non-null.The flaw was corrected by avoiding the use of
mem::uninitialized()
, usingMaybeUninit
instead.Release Notes
hyperium/hyper
v0.14.25
Compare Source
Features
client::conn
types (#3156) (0ced15d3)client::connect::capture_connection()
(#3144) (c8493399)poison
toConnected
(#3145) (37ed5a2e)Unpin
and'static
constraints (#3119) (0368a41a)New Contributors
v0.14.24
Compare Source
Bug Fixes
to_bytes
(4d89adce)Features
http2_max_header_list_size
tohyper::server::Builder
(#3006) (031425f0)New Contributors
v0.14.23
Compare Source
Bug Fixes
socket2
dependency.New Contributors
v0.14.22
Compare Source
Bug Fixes
v0.14.21
Compare Source
Bug Fixes
http1_header_read_timeout
to use same future (#2891) (c5a14e7c)Features
Server::tcp_keepalive_interval
andServer::tcp_keepalive_retries
(#2991) (287d7124)New Contributors
v0.14.20
Compare Source
Bug Fixes
http1_header_read_timeout
to use same future (#2891) (c5a14e7c)Features
New Contributors
v0.14.19
Compare Source
Bug Fixes
Features
Connection::http2_max_header_list_size
option (#2828) (a32658c1, closes #2826)AddrStream::local_addr()
(#2816) (ffbf610b, closes #2773)Breaking Changes
hyper_clientconn_options_new
no longer sets thehttp1_preserve_header_case
connection option by default.Users should now call
hyper_clientconn_options_set_preserve_header_case
if they desire that functionality. (78de8914)v0.14.18
Compare Source
Bug Fixes
Features
HttpInfo::local_addr()
method (055b4e7e, closes #2767)v0.14.17
Compare Source
Bug Fixes
Instant
(#2746) (dcdd6d10)Features
Error::message
(#2737) (6932896a, closes #2732)v0.14.16
Compare Source
Bug Fixes
Body::size_hint()
now return 0 if implicitly empty (#2715) (84b78b6c)Features
http2_max_send_buf_size
option to client and server (bff977b7)v0.14.15
Compare Source
Bug Fixes
GaiFuture
is dropped (174b553dFeatures
http1_writev(bool)
options to Client and Server builders, to allow forcing vectored writes (80627141)v0.14.14
Compare Source
Bug Fixes
Features
v0.14.13
Compare Source
Bug Fixes
Features
v0.14.12
Compare Source
Bug Fixes
Upgraded
stream shutdown (#2622) (be08648e)Features
client::conn::Builder
(#2611) (73bff4e9, closes #2461)v0.14.11
Compare Source
Bug Fixes
proxy-authenticate
andproxy-authorization
headers (#2597) (52435701)Features
v0.14.10
Compare Source
Bug Fixes
Features
v0.14.9
Compare Source
Bug Fixes
v0.14.8
Compare Source
Features
Error::is_parse_too_large
andError::is_parse_status
methods (#2538) (960a69a5)Performance
v0.14.7
Compare Source
Bug Fixes
Features
v0.14.6
Compare Source
Features
v0.14.5
Compare Source
Bug Fixes
Features
AddrIncoming::from_listener
constructor (#2439) (4c946af4)v0.14.4
Compare Source
Bug Fixes
http1
feature was enabled.v0.14.3
Compare Source
Bug Fixes
Features
hyper::body::SizeHint
(#2404) (9956587f)send_trailers
to Body channel'sSender
(#2387) (bf8d74ad, closes #2260)v0.14.2
Compare Source
Features
connect
types without proto feature (#2377) (73a59e5f)Accept
without httpX features (#2382) (a6d4fcbe)v0.14.1
Compare Source
Bug Fixes
Features
Connection::http2_max_header_list_size
option (#2828) (a32658c1, closes #2826)AddrStream::local_addr()
(#2816) (ffbf610b, closes #2773)Breaking Changes
hyper_clientconn_options_new
no longer sets thehttp1_preserve_header_case
connection option by default.Users should now call
hyper_clientconn_options_set_preserve_header_case
if they desire that functionality. (78de8914)v0.14.0
Compare Source
Bug Fixes
Features
client
an optional feature (4e55583d)tracing
'slog
feature (#2342) (db32e105, closes #2326)server
code an optional feature (#2334) (bdb5e5d6)Body
to a new API (#2337) (121c3313, closes #2086)Breaking Changes
hyper depends on
tokio
v1 andbytes
v1.Custom resolvers used with
HttpConnector
must changeto resolving to an iterator of
SocketAddr
s instead ofIpAddr
s.(b4e24332)
hyper no longer emits
log
records automatically.If you need hyper to integrate with a
log
logger (as opposed totracing
),you can add
tracing = { version = "0.1", features = ["log"] }
to activate them.(db32e105)
Removed
http1_writev
methods fromclient::Builder
,client::conn::Builder
,server::Builder
, andserver::conn::Builder
.Vectored writes are now enabled based on whether the
AsyncWrite
implementation in use supports them, rather than though adaptive
detection. To explicitly disable vectored writes, users may wrap the IO
in a newtype that implements
AsyncRead
andAsyncWrite
and returnsfalse
from itsAsyncWrite::is_write_vectored
method.(d6aadb83)
The method
Body::on_upgrade()
is gone. It isessentially replaced with
hyper::upgrade::on(msg)
.(121c3313)
All optional features have been disabled by default.
(ed2b22a7)
The HTTP server code is now an optional feature. To
enable the server, add
features = ["server"]
to the dependency inyour
Cargo.toml
.(bdb5e5d6)
The HTTP client of hyper is now an optional feature. To
enable the client, add
features = ["client"]
to the dependency inyour
Cargo.toml
.(4e55583d)
This puts all HTTP/1 methods and support behind an
http1
cargo feature, which will not be enabled by default. To useHTTP/1, add
features = ["http1"]
to the hyper dependency in yourCargo.toml
.(2a19ab74)
http2
cargo feature, which will not be enabled by default. To useHTTP/2, add
features = ["http2"]
to the hyper dependency in yourCargo.toml
.(b819b428)
v0.13.9 (2020-11-02)
Bug Fixes
Features
HttpConnector::set_local_addresses
to set both IPv6 and IPv4 local addrs ( (fb19f3a8)Connected
fields (#2290) (2dc9768d)v0.13.8 (2020-09-18)
Bug Fixes
Features
http1_writev(true)
will now force writev queue usage (187c22af, closes #2282)AsRawFd
forAddrStream
(#2246) (b5d5e214, closes #2245)v0.13.7 (2020-07-13)
Bug Fixes
Features
log
totracing
in a backwards-compatible way (#2204) (9832aef9)v0.13.6 (2020-05-29)
Features
v0.13.5 (2020-04-17)
Bug Fixes
v0.13.4 (2020-03-20)
Bug Fixes
Features
v0.13.3 (2020-03-03)
Features
client::Builder
pool options (#2142) (a82fd6c9)poll_peek
toAddrStream
(#2127) (24d53d3f)v0.13.2 (2020-01-29)
Bug Fixes
100 Continue
if request body is polled (c4bb4db5)Features
v0.13.1 (2019-12-13)
Bug Fixes
Features
HttpBody
forRequest
andResponse
(4b6099c7, closes #2067)hyper::client::connect::Connect
trait alias (2553ea1a)v0.13.10
Compare Source
Bug Fixes
http1: fix server misinterpretting multiple Transfer-Encoding headers (6d9e5f9f)
See GHSA-6hfq-h8hq-87mf
v0.13.9
Compare Source
Bug Fixes
Features
HttpConnector::set_local_addresses
to set both IPv6 and IPv4 local addrs ( (fb19f3a8)Connected
fields (#2290) (2dc9768d)v0.13.8
Compare Source
Bug Fixes
Features
http1_writev(true)
will now force writev queue usage (187c22af, closes #2282)AsRawFd
forAddrStream
(#2246) (b5d5e214, closes #2245)v0.13.7
Compare Source
Bug Fixes
Features
log
totracing
in a backwards-compatible way (#2204) (9832aef9)v0.13.6
Compare Source
Features
v0.13.5
Compare Source
Bug Fixes
v0.13.4
Compare Source
Bug Fixes
Features
v0.13.3
Compare Source
Features
client::Builder
pool options (#2142) (a82fd6c9)poll_peek
toAddrStream
(#2127) (24d53d3f)v0.13.2
Compare Source
Bug Fixes
100 Continue
if request body is polled (c4bb4db5)Features
v0.13.1
Compare Source
Bug Fixes
Features
HttpBody
forRequest
andResponse
(4b6099c7, closes #2067)hyper::client::connect::Connect
trait alias (2553ea1a)v0.13.0
Compare Source
Bug Fixes
Builder
window size methods to be by-value (a22dabd0, closes #1814)'static
bound ofService
onConnection
(#1971) (4d147126)Features
Sender::send_data
to anasync fn
. (62a96c07)Sync
when wrapping a dynamicStream
(44413721)body::aggregate
andbody::to_bytes
functions (8ba9a8d2)Chunk
type withBytes
(5a598757, closes #1931)Payload
trait withHttpBody
(c63728eb)impl Connection
(4d7a2266)Destination
forhttp::Uri
in connectors (319e8aee)Resolve
to beService<Name>
(9d9233ce, closes #1903)Connect
trait into an alias forService
(d67e49f1, closes #1902)GaiResolver
to use a global blocking threadpool (049b5132)std::future::Future
(8f4b05ae)tcp
feature, split fromruntime
(5b348b82)Stream
trait usage optional behind thestream
feature, enabled by default (0b03b730, closes #2034)rt::Executor
trait (6ae5889f, closes #1944)Accept
trait (b3e55062)Server::local_addr
a more general type (3cc93e79)http1_half_close
option default to disabled (7e31fd88)Service
toHttpService
, re-exporttower::Service
(4f274399, closes #1959)Breaking Changes
Future
,Stream
,AsyncRead
,AsyncWrite
, etc) are updated to newer versions.(8f4b05ae)
hyper::Chunk
should be replaced withbytes::Bytes
(orhyper::body::Bytes
).(5a598757)
Body
as aStream
, and constructing one viaBody::wrap_stream
, require enabling thestream
feature.(511ea388)
GaiResolver::new
andHttpConnector::new
nolonger should pass an integer argument for the number of threads.
(049b5132)
(T, Connected)
, but a singleT: Connection
.(4d7a2266)
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: Whenever PR is behind base branch, or you tick the rebase/retry checkbox.
🔕 Ignore: Close this PR and you won't be reminded about these updates again.
This PR has been generated by Mend Renovate. View repository job log here.