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 poem-derive

No external dependencies! 🙌

Crate poem

Dependencies

(49 total, 7 outdated)

CrateRequiredLatestStatus
 hyper^1.0.01.5.1up to date
 hyper-util^0.1.60.1.10up to date
 http-body-util^0.1.00.1.2up to date
 tokio-util^0.7.00.7.12up to date
 parking_lot^0.12.00.12.3up to date
 pin-project-lite^0.2.70.2.15up to date
 percent-encoding^2.1.02.3.1up to date
 smallvec^1.6.11.13.2up to date
 headers^0.4.00.4.0up to date
 rfc7239^0.1.00.1.1up to date
 wildmatch^22.4.0up to date
 sync_wrapper^1.0.01.0.2up to date
 multer^3.0.03.1.0up to date
 tokio-tungstenite^0.23.10.24.0out of date
 rustls-pemfile^2.0.02.2.0up to date
 async-compression^0.4.00.4.17up to date
 tower^0.4.80.5.1out of date
 time^0.30.3.36up to date
 mime_guess^2.0.32.0.5up to date
 rand^0.8.40.8.5up to date
 redis^0.270.27.5up to date
 cookie^0.180.18.1up to date
 opentelemetry-http^0.13.00.27.0out of date
 opentelemetry-semantic-conventions^0.16.00.27.0out of date
 opentelemetry-prometheus^0.17.00.17.0up to date
 prometheus^0.13.00.13.4up to date
 opentelemetry^0.24.00.27.0out of date
 tempfile^3.2.03.14.0up to date
 priority-queue^2.0.22.1.1up to date
 tokio-native-tls^0.3.00.3.1up to date
 tokio-openssl^0.6.30.6.5up to date
 openssl^0.10.660.10.68up to date
 csrf^0.4.10.4.1up to date
 httpdate^1.0.21.0.3up to date
 sse-codec^0.3.20.3.2up to date
 fluent^0.16.00.16.1up to date
 fluent-langneg^0.13.00.14.1out of date
 fluent-syntax^0.11.00.11.1up to date
 unic-langid^0.9.00.9.5up to date
 intl-memoizer^0.5.10.5.2up to date
 ring^0.17.70.17.8up to date
 rcgen^0.12.00.13.1out of date
 x509-parser^0.16.00.16.0up to date
 tokio-metrics^0.3.00.3.1up to date
 rust-embed^8.08.5.0up to date
 hex^0.40.4.3up to date
 anyhow^1.0.01.0.93up to date
 eyre^0.6.120.6.12up to date
 uuid^1.8.01.11.0up to date

Dev dependencies

(1 total, all up-to-date)

CrateRequiredLatestStatus
 async-stream^0.3.20.3.6up to date

Crate poem-openapi-derive

No external dependencies! 🙌

Crate poem-openapi

Dependencies

(15 total, 1 possibly insecure)

CrateRequiredLatestStatus
 derive_more^1.01.0.0up to date
 num-traits^0.2.140.2.19up to date
 email_address^0.2.10.2.9up to date
 hostname-validator^1.1.01.1.1up to date
 time^0.3.360.3.36up to date
 uuid^1.1.01.11.0up to date
 url^2.2.22.5.3up to date
 bson^2.0.02.13.0up to date
 rust_decimal^1.22.01.36.0up to date
 humantime^2.1.02.1.0up to date
 ipnet^2.7.12.10.1up to date
 prost-wkt-types^0.6.00.6.0up to date
 geo-types^0.7.120.7.14up to date
 geojson^0.24.10.24.1up to date
 sqlx ⚠️^0.8.00.8.2maybe insecure

Crate poem-lambda

Dependencies

(1 total, all up-to-date)

CrateRequiredLatestStatus
 lambda_http^0.13.00.13.0up to date

Crate poem-grpc-build

Dependencies

(2 total, all up-to-date)

CrateRequiredLatestStatus
 prettyplease^0.2.90.2.25up to date
 prost-build^0.13.10.13.3up to date

Crate poem-grpc

Dependencies

(13 total, all up-to-date)

CrateRequiredLatestStatus
 async-stream^0.3.30.3.6up to date
 itoa^1.0.21.0.13up to date
 percent-encoding^2.1.02.3.1up to date
 prost^0.13.10.13.3up to date
 prost-types^0.13.10.13.3up to date
 fastrand^2.0.02.2.0up to date
 hyper^1.0.01.5.1up to date
 hyper-util^0.1.100.1.10up to date
 http-body-util^0.1.00.1.2up to date
 tower-service^0.3.20.3.3up to date
 webpki-roots^0.260.26.6up to date
 async-compression^0.4.00.4.17up to date
 sync_wrapper^1.0.01.0.2up to date

Security Vulnerabilities

sqlx: Binary Protocol Misinterpretation caused by Truncating or Overflowing Casts

RUSTSEC-2024-0363

The following presentation at this year's DEF CON was brought to our attention on the SQLx Discord:

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 SQLx does perform truncating casts in a way that could be problematic, for example: https://github.com/launchbadge/sqlx/blob/6f2905695b9606b5f51b40ce10af63ac9e696bb8/sqlx-postgres/src/arguments.rs#L163

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

Mitigation

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.

Encode::size_hint() can be used for sanity checks, but do not assume that the size returned is accurate. For example, the Json<T> and Text<T> adapters have no reasonable way to predict or estimate the final encoded size, so they just return size_of::<T>() instead.

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

Resolution

sqlx 0.8.1 has been released with the fix: https://github.com/launchbadge/sqlx/blob/main/CHANGELOG.md#081---2024-08-23

Postgres users are advised to upgrade ASAP as a possible exploit has been demonstrated: https://github.com/launchbadge/sqlx/issues/3440#issuecomment-2307956901

MySQL and SQLite do not appear to be exploitable, but upgrading is recommended nonetheless.