This project contains known security vulnerabilities. Find detailed information at the bottom.

Crate cargo-web

Dependencies

(41 total, 26 outdated, 2 insecure)

CrateRequiredLatestStatus
 ansi_term^0.110.12.1out of date
 atty^0.20.2.14up to date
 base-x^0.20.3.0out of date
 cargo_metadata^0.60.23.1out of date
 clap^24.6.7out of date
 digest^0.80.11.3out of date
 directories^26.0.0out of date
 env_logger^0.60.11.11out of date
 failure^0.10.1.8up to date
 futures^0.1.170.3.34out of date
 handlebars^16.4.4out of date
 http^0.1.131.5.0out of date
 hyper ⚠️^0.12.121.11.1insecure
 indexmap^12.14.2out of date
 lazy_static^11.5.0up to date
 libflate^0.12.3.2out of date
 log^0.40.4.34up to date
 memmap^0.70.7.0up to date
 mime_guess^12.0.5out of date
 notify^48.2.0out of date
 open^15.4.4out of date
 openssl-sys=0.9.450.9.117out of date
 parity-wasm^0.350.45.0out of date
 pbr^11.1.1up to date
 percent-encoding^12.3.2out of date
 regex^11.13.1up to date
 reqwest^0.90.13.5out of date
 rustc-demangle^0.1.50.1.28up to date
 semver^0.91.0.28out of date
 serde^11.0.229up to date
 serde_derive^11.0.229up to date
 serde_json^11.0.151up to date
 sha1^0.60.11.0out of date
 sha2^0.80.11.0out of date
 structopt^0.2.140.3.26out of date
 tar^0.40.4.46up to date
 tempfile^33.27.0up to date
 toml^0.41.1.6+spec-1.1.0out of date
 unicode_categories^0.1.10.1.1up to date
 walkdir^22.5.0up to date
 websocket ⚠️^0.210.27.1insecure

Security Vulnerabilities

hyper: Lenient `hyper` header parsing of `Content-Length` could allow request smuggling

RUSTSEC-2021-0078

hyper's HTTP header parser accepted, according to RFC 7230, illegal contents inside Content-Length headers. Due to this, upstream HTTP proxies that ignore the header may still forward them along if it chooses to ignore the error.

To be vulnerable, hyper must be used as an HTTP/1 server and using an HTTP proxy upstream that ignores the header's contents but still forwards it. Due to all the factors that must line up, an attack exploiting this vulnerability is unlikely.

hyper: Integer overflow in `hyper`'s parsing of the `Transfer-Encoding` header leads to data loss

RUSTSEC-2021-0079

When decoding chunk sizes that are too large, hyper's code would encounter an integer overflow. Depending on the situation, this could lead to data loss from an incorrect total size, or in rarer cases, a request smuggling attack.

To be vulnerable, you must be using hyper for any HTTP/1 purpose, including as a client or server, and consumers must send requests or responses that specify a chunk size greater than 18 exabytes. For a possible request smuggling attack to be possible, any upstream proxies must accept a chunk size greater than 64 bits.

websocket: Unbounded memory allocation based on untrusted length

RUSTSEC-2022-0035

Impact

Untrusted websocket connections can cause an out-of-memory (OOM) process abort in a client or a server. The root cause of the issue is during dataframe parsing. Affected versions would allocate a buffer based on the declared dataframe size, which may come from an untrusted source. When Vec::with_capacity fails to allocate, the default Rust allocator will abort the current process, killing all threads. This affects only sync (non-Tokio) implementation. Async version also does not limit memory, but does not use with_capacity, so DoS can happen only when bytes for oversized dataframe or message actually got delivered by the attacker.

This is a security concern for you, if

  • your server application handles untrusted websocket connections
  • OR your client application connects to untrusted websocket servers

Patches

The crashes are fixed in version 0.26.5 by imposing default dataframe size limits. Affected users are advised to update to this version.

Note that default memory limits are rather large (100MB dataframes and 200 MB messages), so they can still cause DoS in some environments (i.e. 32-bit). New API has been added to fine tune those limits for specific applications.

Workarounds

  • Migrate your project to another, maintained Websocket library like Tungstenite.
  • Accept only trusted WebSocket traffic.
  • Filter the WebSocket traffic though some kind of proxy that ensures sanity limits on messages.
  • Handle process aborts gracefully and limit process memory using OS tools.

Credits

This issue was reported by Evan Richter at ForAllSecure and found with Mayhem and Cargo Fuzz.