RubySec

Providing security resources for the Ruby community

GHSA-mwm8-39rw-8826 (sqlite3): Use-After-Free in SQLite Aggregate Arguments in Heap-Allocated Argument Array

Use-After-Free in SQLite Aggregate Arguments in Heap-Allocated Argument Array

Published: August 11, 2026

SECURITY IDENTIFIERS

GEM

sqlite3

UNAFFECTED VERSIONS

< 1.4.0

PATCHED VERSIONS

>= 2.9.6

DESCRIPTION

Summary

Using Database#create_aggregate, #create_aggregate_handler, or Database#define_aggregator to define an aggregate function that takes two or more arguments, and then evaluating it over TEXT or BLOB column values, can free the Ruby objects holding those arguments while a later argument is still being converted, during ordinary garbage collection. The aggregate's step method then receives an incorrect object, or the process crashes with a segmentation fault.

Credits

Reported by Jeremy Daer (@jeremy).

RELATED