mediumVulnerability

GHSA-mwm8-39rw-8826

## 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. ## Mitigation Upgrade to sqlite3 gem v2.9.6 or later. There is no reliable workaround. If you cannot upgrade, avoid defining aggregate functions that take two or more arguments. Restricting column value sizes is not a mitigation: smaller values make the defect fire less often but do not prevent it. ## Severity The sqlite3-ruby maintainers assess this as Medium severity (CVSS 4.0 score 6.3). It is reached through ordinary garbage collection without any unusual code structuring: an application is exposed whenever it evaluates a multi-argument aggregate over TEXT or BLOB values whose size an attacker can influence. The demonstrated impact is an incorrect value passed to the aggregate's `step` method, or a process crash; no controlled memory write or general denial-of-service exploit has been demonstrated. ## Credits Reported by Jeremy Daer ([@jeremy](https://github.com/jeremy)).

Properties

ghsa_id
GHSA-mwm8-39rw-8826
severity
medium
summary
sqlite3-ruby: Use-After-Free in SQLite Aggregate Arguments in Heap-Allocated Argument Array
last_source
GitHub Advisory Database
cve_id
GHSA-mwm8-39rw-8826
signal_observed_at
2026-10-03T01:59:23+00:00
is_ghsa_only
true
retrieved_at
2026-10-03T18:15:00+00:00
ghsa_published
2026-10-02T23:11:51Z
source_url
https://github.com/advisories/GHSA-mwm8-39rw-8826
ghsa_updated
2026-10-02T23:11:52Z

Related Entities (4)

VULNERABLE_TO (1)

←[Software]rubygems/sqlite3

AFFECTS (1)

→[Software]rubygems/sqlite3

HAS_WEAKNESS (1)

→[Weakness]Use After Free

REPORTED_BY (1)

→[Source]GitHub Advisory Database

Explore deeper with Ninja Signal's threat intelligence graph