Update Rust crate diesel to v2.3.8 [SECURITY]#10385
Open
oxide-renovate[bot] wants to merge 1 commit into
Open
Conversation
Collaborator
|
Omicron does not use Diesel's SQLite backend. Dismissed https://github.com/oxidecomputer/omicron/security/dependabot/102. Keeping open in case we want to merge an update anyway. |
10bb4eb to
7a402b0
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR contains the following updates:
2.3.7→2.3.8Diesel's SQLite backend has possible UTF-8 corruption
GHSA-h5x4-m2qf-r4f2
More information
Details
Diesel uses the
sqlite3_value_textfunction to receive strings from SQLite while deserializing query results. We misinterpreted the corresponding SQLite documentation that this function always returns a UTF-8 encoded string values as*const c_char. Based on that we usedstr::from_utf8_uncheckedto construct a Rust string slice without any additional UTF-8 checks in place. It turned out that this function doesn't always return correct UTF-8 strings. For field of the SQLite side storage typeBLOBthis pointer can contain arbitrary bytes, which makes the usage ofstr::from_utf8_uncheckedunsound as this violates the safety contract ofstrto only contain valid UTF-8 encoded Strings.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 correctly checks whether the provides byte buffer is actually valid UTF-8, instead of relying on SQLite's documentation. This fix is included in the
2.3.8release.Severity
CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:H/VA:N/SC:N/SI:N/SA:NReferences
This data is provided by the GitHub Advisory Database (CC-BY 4.0).
Release Notes
diesel-rs/diesel (diesel)
v2.3.8Compare Source
ORDER BYclause without aGROUP BYclause.count()or.select(aggregate_expr)on a query that already has a non-aggregate.order_by()clause now raises a compile-time error instead of generating invalid SQL that would be rejected by the database at runtime (fixes #3815)#[derive(AsChangeset)]infix_operator!()SqliteValue::read_text/FromSql<Text, Sqlite> for StringSqliteConnection::register_functionfor aggregate functionsSqliteConnection::register_functionCOPY FROM/TODebug/Displayimplementation of batchINSERTstatements for SQLiteSqliteValue::read_text/FromSql<Text, Sqlite> for String/SqliteValue::read_blob()/FromSql<Binary, Sqlite> for Vec<u8>FromSql<Binary, _> for Vec<u8>andFromSql<Text, _> for Stringfor third party backends (requires changes to the third party backend as well)Configuration
📅 Schedule: (in timezone America/Los_Angeles)
🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.
♻ Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.
🔕 Ignore: Close this PR and you won't be reminded about this update again.
This PR has been generated by Mend Renovate.