-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update Rust crate hyper to 0.14 [SECURITY] #92
base: master
Are you sure you want to change the base?
Conversation
⚠ Artifact update problemRenovate failed to update an artifact related to this branch. You probably do not want to merge this PR as-is. ♻ Renovate will retry this branch, including artifacts, only when one of the following happens:
The artifact failure details are included below: File name: Cargo.lock
|
df900ea
to
ae08c61
Compare
ae08c61
to
43eb483
Compare
3aba5cd
to
b9a38a7
Compare
b9a38a7
to
eb103f5
Compare
f72206c
to
7e19e34
Compare
7e19e34
to
6751886
Compare
8eb5c80
to
f75d9dd
Compare
9bdcdd5
to
6a7cecb
Compare
6a7cecb
to
57d5fd8
Compare
57d5fd8
to
6f71f9a
Compare
85a3167
to
522905d
Compare
522905d
to
4352a20
Compare
8bb4e1f
to
4a9dc4d
Compare
71e0f0f
to
4505618
Compare
ae8bd48
to
0f8ce9f
Compare
c06c31b
to
b01053a
Compare
e914f18
to
8504d32
Compare
d044220
to
220af2a
Compare
|
352f082
to
740766b
Compare
740766b
to
5fb5114
Compare
e4d8f70
to
74d5dd6
Compare
65c588d
to
41e3085
Compare
41e3085
to
1a10498
Compare
8641ac3
to
db35bda
Compare
db35bda
to
bb01b08
Compare
727a458
to
98e3f41
Compare
46f747c
to
a4623ca
Compare
a36803f
to
99e2a67
Compare
2866092
to
66fa20a
Compare
66fa20a
to
bb1de21
Compare
bb1de21
to
ae21556
Compare
This PR contains the following updates:
0.10
->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 (hyper)
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)
hyper::client::connect::Destination
should be replaced with
http::Uri
.(319e8aee)
hyper::body::Payload
should be replacedwith
hyper::body::HttpBody
.(c63728eb)
Any type passed to the
executor
builder methods mustnow implement
hyper::rt::Executor
.hyper::rt::spawn
usage should be replaced withtokio::task::spawn
.hyper::rt::run
usage should be replaced with#[tokio::main]
ormanaging a
tokio::runtime::Runtime
manually.(6ae5889f)
The
Resolve
trait is gone. All custom resolvers shouldimplement
tower::Service
instead.The error type of
HttpConnector
has been changed away fromstd::io::Error
.(9d9233ce)
Connect
must insteadimplement
tower::Service<Uri>
.(d67e49f1)
connections when receiving a read EOF. To allow for clients to close
the read half, call
http1_half_close(true)
when configuring aserver.
(7e31fd88)
Stream
toServer::builder
orHttp::serve_incoming
must be changed to pass anAccept
instead. Thestream
optional feature can be enabled, and then a stream can beconverted using
hyper::server::accept::from_stream
.(b3e55062)
send_data
should either be changed toasync/await or use
try_send_data
.(62a96c07)
v0.12.35 (2019-09-13)
Features
v0.12.34 (2019-09-04)
Bug Fixes
v0.12.33 (2019-09-04)
v0.12.32 (2019-07-08)
Features
HttpConnector
: allow to set socket buffer sizes (386109c4)v0.12.31 (2019-06-25)
v0.12.30 (2019-06-14)
Bug Fixes
v0.12.29 (2019-05-16)
Bug Fixes
Features
http_body::Body
forhyper::Body
(2d9f3490)TryFrom
forDestination
(#1810) (d1183a80, closes #1808)v0.12.28 (2019-04-29)
Bug Fixes
Features
v0.12.27 (2019-04-10)
Bug Fixes
v0.12.26 (2019-04-09)
Bug Fixes
Features
Error::source()
for an HTTP2 error code to send in reset (fc18b680)v0.12.25 (2019-03-01)
Bug Fixes
Features
Error::source
when available (4cf22dfa, closes #1768)http2_max_concurrent_streams
builder option (cbae4294, closes #1772)poll_ready
toService
andMakeService
(#1767) (0bf30ccc)FnMut
withservice_fn
(877606d5)v0.12.24 (2019-02-11)
Bug Fixes
Features
http1_max_buf_size
in theserver::Builder
(#1761) (3e9782c2)into_inner
toAddrStream
(#1762) (e52f80df)v0.12.23 (2019-01-24)
Bug Fixes
Features
conn::Builder::max_buf_size()
(078ed82d, closes #1748)v0.12.22 (2019-01-23)
Bug Fixes
v0.12.21 (2019-01-15)
Features
Destination::try_from_uri
constructor (c809542c)v0.12.20 (2019-01-07)
Bug Fixes
v0.12.19 (2018-12-18)
Bug Fixes
v0.12.18 (2018-12-11)
Features
server::conn::AddrIncoming::bind
constructor (2d5eabde)v0.12.17 (2018-12-05)
Features
Error::is_connect
method (01f64983)tcp_sleep_on_accept_errors
builder method (a6fff13a, closes #1713)http1_half_close(bool)
option (73345be6, closes #1716)hyper::service::MakeServiceRef
(a522c315)Performance
v0.12.16 (2018-11-21)
Bug Fixes
Features
http1_read_buf_exact_size
Builder option (2e7250b6)v0.12.15 (2018-11-20)
Features
NewService
toMakeService
with connection context (30870029,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 this update again.
This PR was generated by Mend Renovate. View the repository job log.