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 webserver

Dependencies

(50 total, 22 outdated, 4 possibly insecure)

CrateRequiredLatestStatus
 serde^11.0.219up to date
 serde_derive^11.0.219up to date
 serde_json^11.0.140up to date
 git2^0.130.20.1out of date
 anyhow^11.0.97up to date
 libflate^12.1.0out of date
 xz2^0.10.1.7up to date
 sodiumoxide^0.20.2.7up to date
 dotenv^0.150.15.0up to date
 lazy_static^11.5.0up to date
 if_chain^11.0.2up to date
 unicode-segmentation^11.12.0up to date
 toml^0.50.8.20out of date
 ipnetwork^0.180.21.1out of date
 r2d2^0.80.8.10up to date
 r2d2_redis^0.140.14.0up to date
 sidekiq^0.90.12.0out of date
 unicode_categories^0.10.1.1up to date
 tera^0.111.20.0out of date
 ammonia^34.0.0out of date
 html5ever^0.250.30.0out of date
 markup5ever_rcdom^0.10.3.0out of date
 url^22.5.4up to date
 unicase^22.8.1up to date
 one-time^0.10.1.0up to date
 mime^0.30.3.17up to date
 hmac^0.110.12.1out of date
 sha-1^0.90.10.1out of date
 md-5^0.90.10.6out of date
 rand^0.80.9.0out of date
 sha2^0.90.10.8out of date
 csv^11.3.1up to date
 unic-langid^0.90.9.5up to date
 fluent-bundle^0.150.15.3up to date
 fluent-syntax^0.110.11.1up to date
 intl-memoizer^0.50.5.2up to date
 data-encoding^22.8.0up to date
 image^0.230.25.5out of date
 libwebp-sys ⚠️^0.40.12.1out of date
 regex ⚠️^11.11.1maybe insecure
 serde_regex^11.1.0up to date
 rocket^0.40.5.1out of date
 rocket_contrib^0.40.4.11up to date
 uuid^0.81.16.0out of date
 diesel ⚠️^12.2.8out of date
 chrono ⚠️^0.40.4.40maybe insecure
 comrak^0.120.36.0out of date
 multipart^0.180.18.0up to date
 parking_lot^0.110.12.3out of date
 reqwest^0.110.12.15out of date

Build dependencies

(6 total, 2 outdated)

CrateRequiredLatestStatus
 git2^0.130.20.1out of date
 serde^11.0.219up to date
 serde_derive^11.0.219up to date
 serde_json^11.0.140up to date
 toml^0.50.8.20out of date
 tera^11.20.0up to date

Crate worker_delete_directory

No external dependencies! 🙌

Crate worker_email

Dependencies

(3 total, 1 outdated)

CrateRequiredLatestStatus
 serde^11.0.219up to date
 serde_derive^11.0.219up to date
 toml^0.50.8.20out of date

Crate worker_expire_paste

Dependencies

(5 total, 2 outdated, 2 possibly insecure)

CrateRequiredLatestStatus
 anyhow^11.0.97up to date
 chrono ⚠️^0.40.4.40maybe insecure
 dotenv^0.150.15.0up to date
 uuid^0.81.16.0out of date
 diesel ⚠️^12.2.8out of date

Security Vulnerabilities

chrono: Potential segfault in `localtime_r` invocations

RUSTSEC-2020-0159

Impact

Unix-like operating systems may segfault due to dereferencing a dangling pointer in specific circumstances. This requires an environment variable to be set in a different thread than the affected functions. This may occur without the user's knowledge, notably in a third-party library.

Workarounds

No workarounds are known.

References

regex: Regexes with large repetitions on empty sub-expressions take a very long time to parse

RUSTSEC-2022-0013

The Rust Security Response WG was notified that the regex crate did not properly limit the complexity of the regular expressions (regex) it parses. An attacker could use this security issue to perform a denial of service, by sending a specially crafted regex to a service accepting untrusted regexes. No known vulnerability is present when parsing untrusted input with trusted regexes.

This issue has been assigned CVE-2022-24713. The severity of this vulnerability is "high" when the regex crate is used to parse untrusted regexes. Other uses of the regex crate are not affected by this vulnerability.

Overview

The regex crate features built-in mitigations to prevent denial of service attacks caused by untrusted regexes, or untrusted input matched by trusted regexes. Those (tunable) mitigations already provide sane defaults to prevent attacks. This guarantee is documented and it's considered part of the crate's API.

Unfortunately a bug was discovered in the mitigations designed to prevent untrusted regexes to take an arbitrary amount of time during parsing, and it's possible to craft regexes that bypass such mitigations. This makes it possible to perform denial of service attacks by sending specially crafted regexes to services accepting user-controlled, untrusted regexes.

Affected versions

All versions of the regex crate before or equal to 1.5.4 are affected by this issue. The fix is include starting from regex 1.5.5.

Mitigations

We recommend everyone accepting user-controlled regexes to upgrade immediately to the latest version of the regex crate.

Unfortunately there is no fixed set of problematic regexes, as there are practically infinite regexes that could be crafted to exploit this vulnerability. Because of this, we do not recommend denying known problematic regexes.

Acknowledgements

We want to thank Addison Crump for responsibly disclosing this to us according to the Rust security policy, and for helping review the fix.

We also want to thank Andrew Gallant for developing the fix, and Pietro Albini for coordinating the disclosure and writing this advisory.

libwebp-sys: libwebp: OOB write in BuildHuffmanTable

RUSTSEC-2023-0061

Google and Mozilla have released security advisories for RCE due to heap overflow in libwebp. Google warns the vulnerability has been exploited in the wild.

libwebp needs to be updated to 1.3.2 to include a patch for "OOB write in BuildHuffmanTable".

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.