RUSTSEC-2026-0172: Possible use after free when deserializing a SQLite database via `SqliteConnection::deserialize_readonly_database`

Aperta
#6,619 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
2/5
Tempo stimato
1-3 ore
Idoneità per principianti
45/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Tranquilla
Stack tecnologico
rust, sqlite

Direzione di ricerca

L'issue non indica alcun file di nodi del grafo né alcun test. Inizia controllando le dichiarazioni delle dipendenze del repository per Diesel 2.3.9 e verificando se viene utilizzata la funzionalità SQLite; il lavoro è completo quando Diesel è stato aggiornato alla versione 2.3.10 o successiva e sono stati eseguiti i controlli esistenti pertinenti.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

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.

Lingua principale
Rust
Stelle
3.2k
Fork
1.1k
Merge medio
4g 1h
PR unite (30g)
1

Guida per i contributori

Apri la guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di graphprotocol/graph-node

Tutte le issue di graphprotocol/graph-node

Issue simili

Altre issue su Rust

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.