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

Crate sn0int

Dependencies

(48 total, 31 outdated, 3 insecure)

CrateRequiredLatestStatus
 atty^0.20.2.14up to date
 base64^0.100.23.1out of date
 bufstream^0.1.40.1.4up to date
 caps^0.30.5.6out of date
 chrono^0.40.4.45up to date
 chrootable-https^0.90.16.0out of date
 colored^1.63.1.1out of date
 crossbeam-channel^0.30.5.17out of date
 ctrlc^3.13.5.2up to date
 der-parser^1.1.010.0.0out of date
 diesel ⚠️^1.0.02.3.13insecure
 diesel_migrations^1.3.02.3.2out of date
 dirs^1.07.0.0out of date
 env_logger^0.60.11.11out of date
 failure^0.10.1.8up to date
 hlua-badtouch^0.40.4.2up to date
 kuchiki^0.7.20.8.1out of date
 lazy_static^1.01.5.0up to date
 libflate^0.1.142.3.2out of date
 log^0.40.4.34up to date
 maplit^1.0.11.0.2up to date
 maxminddb ⚠️^0.130.32.0insecure
 nix^0.130.31.3out of date
 nom^4.1.18.0.0out of date
 opener^0.3.00.8.5out of date
 pledge^0.3.10.4.2out of date
 publicsuffix^1.52.3.0out of date
 rand^0.60.10.3out of date
 regex^1.01.13.1up to date
 rustyline^318.0.1out of date
 semver^0.91.0.28out of date
 separator^0.40.4.1up to date
 serde^1.01.0.229up to date
 serde_derive^1.01.0.229up to date
 serde_json^1.01.0.151up to date
 serde_urlencoded^0.50.7.1out of date
 shellwords^1.01.1.0up to date
 sloppy-rfc4880^0.1.20.2.0out of date
 sn0int-common^0.5.00.14.0out of date
 structopt^0.20.3.26out of date
 syscallz^0.110.17.0out of date
 tar^0.4.170.4.46up to date
 threadpool^1.71.8.1up to date
 tokio ⚠️^0.1.141.53.1insecure
 toml^0.41.1.6+spec-1.1.0out of date
 unveil^0.2.00.3.2out of date
 url^1.72.5.8out of date
 x509-parser^0.4.00.18.1out of date

Dev dependencies

(1 total, 1 outdated)

CrateRequiredLatestStatus
 boxxy^0.90.14.0out of date

Security Vulnerabilities

tokio: Data race when sending and receiving after closing a `oneshot` channel

RUSTSEC-2021-0124

If a tokio::sync::oneshot channel is closed (via the oneshot::Receiver::close method), a data race may occur if the oneshot::Sender::send method is called while the corresponding oneshot::Receiver is awaited or calling try_recv.

When these methods are called concurrently on a closed channel, the two halves of the channel can concurrently access a shared memory location, resulting in a data race. This has been observed to cause memory corruption.

Note that the race only occurs when both halves of the channel are used after the Receiver half has called close. Code where close is not used, or where the Receiver is not awaited and try_recv is not called after calling close, is not affected.

See tokio#4225 for more details.

diesel: Binary Protocol Misinterpretation caused by Truncating or Overflowing Casts

RUSTSEC-2024-0365

The following presentation at this year's DEF CON was brought to our attention on the Diesel Gitter Channel:

SQL Injection isn't Dead: Smuggling Queries at the Protocol Level
http://web.archive.org/web/20240812130923/https://media.defcon.org/DEF%20CON%2032/DEF%20CON%2032%20presentations/DEF%20CON%2032%20-%20Paul%20Gerste%20-%20SQL%20Injection%20Isn't%20Dead%20Smuggling%20Queries%20at%20the%20Protocol%20Level.pdf
(Archive link for posterity.) Essentially, encoding a value larger than 4GiB can cause the length prefix in the protocol to overflow, causing the server to interpret the rest of the string as binary protocol commands or other data.

It appears Diesel does perform truncating casts in a way that could be problematic, for example: https://github.com/diesel-rs/diesel/blob/ae82c4a5a133db65612b7436356f549bfecda1c7/diesel/src/pg/connection/stmt/mod.rs#L36

This code has existed essentially since the beginning, so it is reasonable to assume that all published versions <= 2.2.2 are affected.

Mitigation

The prefered migration to the outlined problem is to update to a Diesel version newer than 2.2.2, which includes fixes for the problem.

As always, you should make sure your application is validating untrustworthy user input. Reject any input over 4 GiB, or any input that could encode to a string longer than 4 GiB. Dynamically built queries are also potentially problematic if it pushes the message size over this 4 GiB bound.

For web application backends, consider adding some middleware that limits the size of request bodies by default.

Resolution

Diesel now uses #[deny] directives for the following Clippy lints:

to prevent casts that will lead to precision loss or other trunctations. Additionally we performed an audit of the relevant code.

A fix is included in the 2.2.3 release.

maxminddb: `Reader::open_mmap` unsoundly marks unsafe memmap operation as safe

RUSTSEC-2025-0132

maxminddb prior to version 0.27 declared Reader::open_mmap as safe despite wrapping an inherently unsafe memmap2 operation with no extra step done to guarantee safety. This could have led to undefined behaviour if the file were to be modified on disk while the memory map was still active.

diesel: Command injection in Diesel's implementation of `COPY FROM`/`COPY TO`

RUSTSEC-2026-0136

Diesel allows users to configure various options for PostgreSQL's COPY FROM and COPY TO statements. These configurations are partially provided as strings or characters.

Diesel did not check if any these user-provided options contain a quote character ', which can lead to the injection of additional options in the current COPY FROM/COPY TO statement.

This vulnerability affects any user of COPY FROM/COPY TO that passes user-provided input to any of the affected functions. It can result in modifications of options in the current statement, but it is not possible inject additional statements.

Mitigation

The preferred mitigation to the outlined problem is to update to Diesel version 2.3.8 or newer, which includes fixes for the problem.

Resolution

Diesel now correctly escapes any quotes contained in the provided arguments.

diesel: Possible unaligned data access for implementations of `SqliteAggregate`

RUSTSEC-2026-0137

Diesel allows to register custom aggregate SQL functions for SQLite via the SqliteAggregate interface.

To store an instance of the custom aggregate processor Diesel relied on the sqlite3_aggregate_context function provided by sqlite. This function doesn't provide any guarantees about alignment of the returned allocation, which in turn can lead to problems if the type implementing requires a special alignment, e.g. via a custom #[align(x)] attribute on the type implementing this trait. This affects any user of SqliteAggregate that registers the custom aggregate function with an SQLite connection, while using a non-standard alignment on the type implementing this trait.

Mitigation

The preferred mitigation to the outlined problem is to update to a Diesel version 2.3.8 or newer, which includes fixes for the problem.

Resolution

Diesel now allocates the corresponding memory on Rust side to get a correctly aligned allocation.