-
Notifications
You must be signed in to change notification settings - Fork 1
Update Rust crate hyper to 0.14 [SECURITY] #92
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
Open
renovate
wants to merge
1
commit into
master
Choose a base branch
from
renovate/crate-hyper-vulnerability
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
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
Contributor
Author
⚠ 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
a722f7c to
7c19253
Compare
2e73c48 to
eb501b0
Compare
eb501b0 to
c6ac6db
Compare
c6ac6db to
26b4ba2
Compare
d040cba to
e17ed12
Compare
e17ed12 to
3e59fad
Compare
99f3eb4 to
d4b1229
Compare
d4b1229 to
aca4d9e
Compare
89c45e9 to
b16a48b
Compare
980b29d to
63c3671
Compare
63c3671 to
35bdedd
Compare
35bdedd to
c02ad1b
Compare
9c01e02 to
586f3ed
Compare
586f3ed to
615ae98
Compare
32ca24a to
f9d97aa
Compare
aeba84a to
56e0fcf
Compare
56e0fcf to
0f9a75b
Compare
0f9a75b to
c009919
Compare
c009919 to
7fd1549
Compare
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:
0.10→0.14GitHub Vulnerability Alerts
CVE-2021-32715
Summary
hyper's HTTP/1 server code had a flaw that incorrectly parses and accepts requests with a
Content-Lengthheader 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-Lengthheaders, but forwards them, can result in "request smuggling" or "desync attacks".Vulnerability
The flaw exists in all prior versions of hyper, if built with
rustcv1.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-Lengthonly allows forDIGITs. This is due to using theFromStrimplementation foru64in 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-Lengthstill 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-Lengthheader, 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-Lengthheader.Content-Lengthheaders 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
f0000000000000003as3. 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-Encodingheader.Transfer-Encodingchunk 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 thehttparsecrate).This is unsound, since
Headercontains references and thus must be non-null.The flaw was corrected by avoiding the use of
mem::uninitialized(), usingMaybeUninitinstead.Release Notes
hyperium/hyper (hyper)
v0.14.12Compare Source
Bug Fixes
Upgradedstream shutdown (#2622) (be08648e)Features
client::conn::Builder(#2611) (73bff4e9, closes #2461)v0.14.11Compare Source
Bug Fixes
proxy-authenticateandproxy-authorizationheaders (#2597) (52435701)Features
v0.14.10Compare Source
Bug Fixes
Features
v0.14.9Compare Source
Bug Fixes
v0.14.8Compare Source
Features
Error::is_parse_too_largeandError::is_parse_statusmethods (#2538) (960a69a5)Performance
v0.14.7Compare Source
Bug Fixes
Features
v0.14.6Compare Source
Features
v0.14.5Compare Source
Bug Fixes
Features
AddrIncoming::from_listenerconstructor (#2439) (4c946af4)v0.14.4Compare Source
Bug Fixes
http1feature was enabled.v0.14.3Compare Source
Bug Fixes
Features
hyper::body::SizeHint(#2404) (9956587f)send_trailersto Body channel'sSender(#2387) (bf8d74ad, closes #2260)v0.14.2Compare Source
Features
connecttypes without proto feature (#2377) (73a59e5f)Acceptwithout httpX features (#2382) (a6d4fcbe)v0.14.1Compare Source
Bug Fixes
Features
Connection::http2_max_header_list_sizeoption (#2828) (a32658c1, closes #2826)AddrStream::local_addr()(#2816) (ffbf610b, closes #2773)Breaking Changes
hyper_clientconn_options_newno longer sets thehttp1_preserve_header_caseconnection option by default.Users should now call
hyper_clientconn_options_set_preserve_header_caseif they desire that functionality. (78de8914)v0.14.0Compare Source
Bug Fixes
Features
clientan optional feature (4e55583d)tracing'slogfeature (#2342) (db32e105, closes #2326)servercode an optional feature (#2334) (bdb5e5d6)Bodyto a new API (#2337) (121c3313, closes #2086)Breaking Changes
hyper depends on
tokiov1 andbytesv1.Custom resolvers used with
HttpConnectormust changeto resolving to an iterator of
SocketAddrs instead ofIpAddrs.(b4e24332)
hyper no longer emits
logrecords automatically.If you need hyper to integrate with a
loglogger (as opposed totracing),you can add
tracing = { version = "0.1", features = ["log"] }to activate them.(db32e105)
Removed
http1_writevmethods fromclient::Builder,client::conn::Builder,server::Builder, andserver::conn::Builder.Vectored writes are now enabled based on whether the
AsyncWriteimplementation in use supports them, rather than though adaptive
detection. To explicitly disable vectored writes, users may wrap the IO
in a newtype that implements
AsyncReadandAsyncWriteand returnsfalsefrom itsAsyncWrite::is_write_vectoredmethod.(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
http1cargo feature, which will not be enabled by default. To useHTTP/1, add
features = ["http1"]to the hyper dependency in yourCargo.toml.(2a19ab74)
http2cargo 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_addressesto set both IPv6 and IPv4 local addrs ( (fb19f3a8)Connectedfields (#2290) (2dc9768d)v0.13.8 (2020-09-18)
Bug Fixes
Features
http1_writev(true)will now force writev queue usage (187c22af, closes #2282)AsRawFdforAddrStream(#2246) (b5d5e214, closes #2245)v0.13.7 (2020-07-13)
Bug Fixes
Features
logtotracingin 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::Builderpool options (#2142) (a82fd6c9)poll_peektoAddrStream(#2127) (24d53d3f)v0.13.2 (2020-01-29)
Bug Fixes
100 Continueif request body is polled (c4bb4db5)Features
v0.13.1 (2019-12-13)
Bug Fixes
Features
HttpBodyforRequestandResponse(4b6099c7, closes #2067)hyper::client::connect::Connecttrait alias (2553ea1a)v0.13.10Compare Source
Bug Fixes
http1: fix server misinterpretting multiple Transfer-Encoding headers (6d9e5f9f)
See GHSA-6hfq-h8hq-87mf
v0.13.9Compare Source
Bug Fixes
Features
HttpConnector::set_local_addressesto set both IPv6 and IPv4 local addrs ( (fb19f3a8)Connectedfields (#2290) (2dc9768d)v0.13.8Compare Source
Bug Fixes
Features
http1_writev(true)will now force writev queue usage (187c22af, closes #2282)AsRawFdforAddrStream(#2246) (b5d5e214, closes #2245)v0.13.7Compare Source
Bug Fixes
Features
logtotracingin a backwards-compatible way (#2204) (9832aef9)v0.13.6Compare Source
Features
v0.13.5Compare Source
Bug Fixes
v0.13.4Compare Source
Bug Fixes
Features
v0.13.3Compare Source
Features
client::Builderpool options (#2142) (a82fd6c9)poll_peektoAddrStream(#2127) (24d53d3f)v0.13.2Compare Source
Bug Fixes
100 Continueif request body is polled (c4bb4db5)Features
v0.13.1Compare Source
Bug Fixes
Features
HttpBodyforRequestandResponse(4b6099c7, closes #2067)hyper::client::connect::Connecttrait alias (2553ea1a)v0.13.0Compare Source
Bug Fixes
Builderwindow size methods to be by-value (a22dabd0, closes #1814)'staticbound ofServiceonConnection(#1971) (4d147126)Features
Sender::send_datato anasync fn. (62a96c07)Syncwhen wrapping a dynamicStream(44413721)body::aggregateandbody::to_bytesfunctions (8ba9a8d2)Chunktype withBytes(5a598757, closes #1931)Payloadtrait withHttpBody(c63728eb)impl Connection(4d7a2266)Destinationforhttp::Uriin connectors (319e8aee)Resolveto beService<Name>(9d9233ce, closes #1903)Connecttrait into an alias forService(d67e49f1, closes #1902)GaiResolverto use a global blocking threadpool (049b5132)std::future::Future(8f4b05ae)tcpfeature, split fromruntime(5b348b82)Streamtrait usage optional behind thestreamfeature, enabled by default (0b03b730, closes #2034)rt::Executortrait (6ae5889f, closes #1944)Accepttrait (b3e55062)Server::local_addra more general type (3cc93e79)http1_half_closeoption default to disabled (7e31fd88)ServicetoHttpService, re-exporttower::Service(4f274399, closes #1959)Breaking Changes
Future,Stream,AsyncRead,AsyncWrite, etc) are updated to newer versions.(8f4b05ae)
hyper::Chunkshould be replaced withbytes::Bytes(orhyper::body::Bytes).(5a598757)
Bodyas aStream, and constructing one viaBody::wrap_stream, require enabling thestreamfeature.(511ea388)
GaiResolver::newandHttpConnector::newnolonger should pass an integer argument for the number of threads.
(049b5132)
(T, Connected), but a singleT: Connection.(4d7a2266)
hyper::client::connect::Destinationshould be replaced with
http::Uri.(319e8aee)
hyper::body::Payloadshould be replacedwith
hyper::body::HttpBody.(c63728eb)
Any type passed to the
executorbuilder methods mustnow implement
hyper::rt::Executor.hyper::rt::spawnusage should be replaced withtokio::task::spawn.hyper::rt::runusage should be replaced with#[tokio::main]ormanaging a
tokio::runtime::Runtimemanually.(6ae5889f)
The
Resolvetrait is gone. All custom resolvers shouldimplement
tower::Serviceinstead.The error type of
HttpConnectorhas been changed away fromstd::io::Error.(9d9233ce)
Connectmust 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)
StreamtoServer::builderorHttp::serve_incomingmust be changed to pass anAcceptinstead. Thestreamoptional feature can be enabled, and then a stream can beconverted using
hyper::server::accept::from_stream.(b3e55062)
send_datashould 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::Bodyforhyper::Body(2d9f3490)TryFromforDestination(#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::sourcewhen available (4cf22dfa, closes #1768)http2_max_concurrent_streamsbuilder option (cbae4294, closes #1772)poll_readytoServiceandMakeService(#1767) (0bf30ccc)FnMutwithservice_fn(877606d5)v0.12.24 (2019-02-11)
Bug Fixes
Features
http1_max_buf_sizein theserver::Builder(#1761) (3e9782c2)into_innertoAddrStream(#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_uriconstructor (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::bindconstructor (2d5eabde)v0.12.17 (2018-12-05)
Features
Error::is_connectmethod (01f64983)tcp_sleep_on_accept_errorsbuilder method (a6fff13a, closes #1713)http1_half_close(bool)option (73345be6, closes [#1716](https://redirect.github.com/hConfiguration
📅 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.