graphprotocol / graphprotocol/graph-node
RUSTSEC-2026-0172: Possible use after free when deserializing a SQLite database via `SqliteConnection::deserialize_readonly_database`
Dieses Issue hat noch niemand übernommen.
- Vorherrschende Sprache
- Rust
- Sterne
- 3.2k
- Forks
- 1.1k
- Ø Merge
- 4 T. 1 Std.
- Gemergte PRs (30 T.)
- 1
Beschreibung
Possible use after free when deserializing a SQLite database via
SqliteConnection::deserialize_readonly_database
| Details | |
|---|---|
| Status | unsound |
| Package | diesel |
| Version | 2.3.9 |
| URL | https://github.com/diesel-rs/diesel/commit/1bc2ea46d9840e8d9af844239d3c84f37fe7d84b |
| Date | 2026-06-05 |
Diesel allows loading a SQLite database from a byte buffer, represented as &[u8], at runtime via the SqliteConnection::deserialize_readonly_database function. In previous versions of Diesel, this buffer was passed directly to libsqlite3. Since libsqlite3 requires the buffer to remain alive for as long as the database connection is open and Diesel did not ensure this as part of its safe API, callers of SqliteConnection::deserialize_readonly_database could drop the buffer prematurely. This prematurely drop caused libsqlite3 to operate on freed memory.
This vulnerability affects users of SqliteConnection::deserialize_readonly_database who drop the buffer passed to the function before they drop the database connection.
Mitigation
The preferred mitigation to the outlined problem is to update to Diesel version 2.3.10 or newer, which includes a fix for the problem. Alternatively users need to take to keep the buffer alive until the connection is dropped.
Resolution
Diesel now stores a copy of the buffer inside of the SqliteConnection object itself to keep it alive as long as the underlying libsqlite3 connection exists.
See advisory page for additional details.
Beitragsleitfaden
Erste Schritte
- Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
- Forke das Repository und arbeite in einem Branch.
- Öffne einen Pull Request, der die Issue-Nummer nennt.
Rechercherichtung
Das Issue nennt weder eine Graph-Knotendatei noch einen Test. Beginne damit, die Abhängigkeitsdeklarationen des Repositorys auf Diesel 2.3.9 zu prüfen und festzustellen, ob die SQLite-Funktionalität verwendet wird; als erledigt gilt dies, wenn Diesel auf 2.3.10 oder neuer aktualisiert und die relevanten vorhandenen Prüfungen ausgeführt wurden.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- rust, sqlite
- Bereich
- backend, databases, security
- Issue-Typ
- Bug
- Schwierigkeit
- 2/5
- Geschätzter Aufwand
- 1-3 Stunden
- Aktivitätsstatus
- Ruhig
- Klarheit
- Größtenteils klar
- Anfängerfreundlichkeit
- 45/100