CVE-2026-54620
JSON

2.0low

sqlite3-ruby has Use-After-Free in SQLite Aggregate Function Callbacks

Severity
2.0low CVSS:4.0 by GitHub_M
Exploit likelihood
0.11% (higher than 1% of CVEs; EPSS, by FIRST)
Published
Last changed
Assigned by
GitHub_M
Also known as
GHSA-j7fr-3v8c-3qc3

Description

sqlite3 provides Ruby bindings for the SQLite3 embedded database. From 2.1.0 to 2.9.4, the callbacks used for SQLite aggregate functions can be freed while still referenced during aggregation, resulting in a use-after-free. This issue is fixed in version 2.9.5.

Affected

Product or packageVersionsReported by
sparklemotion sqlite3-ruby>= 2.1.0, < 2.9.5CVE List
sqlite3-ruby (RubyGems)from 2.1.0 before 2.9.5GitHub Advisory Database
sqlite3 (RubyGems)from 2.1.0 before 2.9.5GitHub Advisory Database

All scores

GitHub_M2.0low CVSS:4.0CVSS:4.0/AV:L/AC:H/AT:N/PR:L/UI:N/VC:L/VI:L/VA:L/SC:N/SI:N/SA:N
GitHublow CVSS:4.0CVSS:4.0/AV:L/AC:H/AT:N/PR:L/UI:N/VC:L/VI:L/VA:L/SC:N/SI:N/SA:N

Classification

CWE-416

SSVC (CISA-ADP): exploitation none, automatable no, technical impact partial.

What each source says

CVE List

sqlite3 provides Ruby bindings for the SQLite3 embedded database. From 2.1.0 to 2.9.4, the callbacks used for SQLite aggregate functions can be freed while still referenced during aggregation, resulting in a use-after-free. This issue is fixed in version 2.9.5.

GitHub Advisory Database

Summary

Using Database#create_aggregate, #create_aggregate_handler, or Database#define_aggregator to define an aggregate function, and then using an open statement calling that function after the database has been explicitly closed will result in an invalid memory read and a segmentation fault.

Mitigation

Upgrade to sqlite3 gem v2.9.5 or later.

As a workaround, avoid using an aggregate function after closing the database.

Severity

The sqlite3-ruby maintainers assess this as Low severity. It is reliably triggered after GC when code is structured in a particular way. There is no known general exploit that could be used as a denial of service attack.

NVD (es)

sqlite3 proporciona enlaces Ruby para la base de datos incrustada SQLite3. De 2.1.0 a 2.9.4, las devoluciones de llamada utilizadas para las funciones agregadas de SQLite pueden ser liberadas mientras aún están referenciadas durante la agregación, lo que resulta en un uso después de liberación. Este problema está solucionado en la versión 2.9.5.

References

Sources

SourceRecordLicence
CVE ListCVE-2026-54620 changed 2026-07-28CVE Terms of Use
GitHub Advisory DatabaseGHSA-j7fr-3v8c-3qc3 changed 2026-07-28CC-BY-4.0
NVDCVE-2026-54620 changed 2026-10-23Public domain