This project might be open to known security vulnerabilities, which can be prevented by tightening the version range of affected dependencies. Find detailed information at the bottom.

Crate toshi-server

Dependencies

(28 total, 10 outdated, 2 possibly insecure)

CrateRequiredLatestStatus
 http^0.21.2.0out of date
 bytes^11.9.0up to date
 hyper ⚠️^0.141.5.2out of date
 serde_json^1.01.0.134up to date
 serde_urlencoded^0.70.7.1up to date
 futures^0.30.3.31up to date
 tower-util^0.30.3.1up to date
 tantivy^0.190.22.0out of date
 tokio ⚠️^11.42.0maybe insecure
 async-trait^0.10.1.83up to date
 config^0.130.15.4out of date
 structopt^0.30.3.26up to date
 thiserror^1.02.0.9out of date
 anyhow^1.01.0.94up to date
 dashmap^56.1.0out of date
 serde^1.01.0.216up to date
 clap^44.5.23up to date
 slog^2.72.7.0up to date
 slog-stdlog^4.04.1.1up to date
 slog-scope^4.34.4.0up to date
 log*0.4.22up to date
 sloggers^22.2.0up to date
 toml^0.50.8.19out of date
 flume^0.100.11.1out of date
 itertools^0.100.13.0out of date
 tokio-stream^0.10.1.17up to date
 tokio-util^0.70.7.13up to date
 cang-jie^0.140.18.0out of date

Dev dependencies

(3 total, 1 outdated, 1 possibly insecure)

CrateRequiredLatestStatus
 remove_dir_all ⚠️^0.71.0.0out of date
 pretty_assertions^11.4.1up to date
 tokio-test^0.40.4.4up to date

Crate toshi

Dependencies

(12 total, 6 outdated, 2 possibly insecure)

CrateRequiredLatestStatus
 async-trait^0.10.1.83up to date
 http^0.21.2.0out of date
 thiserror^1.02.0.9out of date
 serde^1.01.0.216up to date
 serde_json^1.01.0.134up to date
 tantivy^0.190.22.0out of date
 tokio ⚠️^1.131.42.0maybe insecure
 bytes^11.9.0up to date
 isahc^11.7.2up to date
 hyper ⚠️^0.141.5.2out of date
 hyper-tls^0.50.6.0out of date
 hyper-rustls^0.230.27.5out of date

Dev dependencies

(1 total, 1 possibly insecure)

CrateRequiredLatestStatus
 tokio ⚠️^11.42.0maybe insecure

Crate toshi-types

Dependencies

(12 total, 6 outdated, 2 possibly insecure)

CrateRequiredLatestStatus
 http^0.21.2.0out of date
 thiserror^1.02.0.9out of date
 anyhow^1.01.0.94up to date
 serde^1.01.0.216up to date
 serde_json^1.01.0.134up to date
 tantivy^0.190.22.0out of date
 async-trait^0.10.1.83up to date
 dashmap^56.1.0out of date
 slog^2.72.7.0up to date
 tokio ⚠️^1.131.42.0maybe insecure
 toml^0.50.8.19out of date
 hyper ⚠️^0.141.5.2out of date

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.

tokio: reject_remote_clients Configuration corruption

RUSTSEC-2023-0001

On Windows, configuring a named pipe server with pipe_mode will force ServerOptions::reject_remote_clients as false.

This drops any intended explicit configuration for the reject_remote_clients that may have been set as true previously.

The default setting of reject_remote_clients is normally true meaning the default is also overridden as false.

Workarounds

Ensure that pipe_mode is set first after initializing a ServerOptions. For example:

let mut opts = ServerOptions::new();
opts.pipe_mode(PipeMode::Message);
opts.reject_remote_clients(true);

remove_dir_all: Race Condition Enabling Link Following and Time-of-check Time-of-use (TOCTOU)

RUSTSEC-2023-0018

The remove_dir_all crate is a Rust library that offers additional features over the Rust standard library fs::remove_dir_all function.

It was possible to trick a privileged process doing a recursive delete in an attacker controlled directory into deleting privileged files, on all operating systems.

For instance, consider deleting a tree called 'etc' in a parent directory called 'p'. Between calling remove_dir_all("a") and remove_dir_all("a") actually starting its work, the attacker can move 'p' to 'p-prime', and replace 'p' with a symlink to '/'. Then the privileged process deletes 'p/etc' which is actually /etc, and now your system is broken. There are some mitigations for this exact scenario, such as CWD relative file lookup, but they are not guaranteed - any code using absolute paths will not have that protection in place.

The same attack could be performed at any point in the directory tree being deleted: if 'a' contains a child directory called 'etc', attacking the deletion by replacing 'a' with a link is possible.

The new code in this release mitigates the attack within the directory tree being deleted by using file-handle relative operations: to open 'a/etc', the path 'etc' relative to 'a' is opened, where 'a' is represented by a file descriptor (Unix) or handle (Windows). With the exception of the entry points into the directory deletion logic, this is robust against manipulation of the directory hierarchy, and remove_dir_all will only delete files and directories contained in the tree it is deleting.

The entry path however is a challenge - as described above, there are some potential mitigations, but since using them must be done by the calling code, it is hard to be confident about the security properties of the path based interface.

The new extension trait RemoveDir provides an interface where it is much harder to get it wrong.

somedir.remove_dir_contents("name-of-child").

Callers can then make their own security evaluation about how to securely get a directory handle. That is still not particularly obvious, and we're going to follow up with a helper of some sort (probably in the fs_at crate). Once that is available, the path based entry points will get deprecated.

In the interim, processes that might run with elevated privileges should figure out how to securely identify the directory they are going to delete, to avoid the initial race. Pragmatically, other processes should be fine with the path based entry points : this is the same interface std::fs::remove_dir_all offers, and an unprivileged process running in an attacker controlled directory can't do anything that the attacker can't already do.