{"id":"CVE-2026-54620","aliases":["CVE-2026-54620","GHSA-j7fr-3v8c-3qc3"],"related":[],"kind":"vulnerability","state":"published","title":"sqlite3-ruby has Use-After-Free in SQLite Aggregate Function Callbacks","summary":"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.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"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.","source":"cvelist"},{"lang":"en","text":"## Summary\n\nUsing `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.\n\n## Mitigation\n\nUpgrade to sqlite3 gem v2.9.5 or later.\n\nAs a workaround, avoid using an aggregate function after closing the database.\n\n## Severity\n\nThe 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.","format":"markdown","source":"ghsa"},{"lang":"es","text":"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.","source":"nvd"}],"published":"2026-07-28T16:23:38.389Z","modified":"2026-10-23T23:10:00.157Z","severity":{"scorer":"GitHub_M","scheme":"CVSS:4.0","vector":"CVSS:4.0/AV:L/AC:H/AT:N/PR:L/UI:N/VC:L/VI:L/VA:L/SC:N/SI:N/SA:N","score":2,"rating":"LOW"},"severities":[{"scorer":"GitHub_M","scheme":"CVSS:4.0","vector":"CVSS:4.0/AV:L/AC:H/AT:N/PR:L/UI:N/VC:L/VI:L/VA:L/SC:N/SI:N/SA:N","score":2,"rating":"LOW"},{"scorer":"GitHub","scheme":"CVSS:4.0","vector":"CVSS:4.0/AV:L/AC:H/AT:N/PR:L/UI:N/VC:L/VI:L/VA:L/SC:N/SI:N/SA:N","rating":"LOW"}],"cwes":["CWE-416"],"affected":[{"ranges":[{"version":">= 2.1.0, < 2.9.5","status":"affected"}],"vendor":"sparklemotion","product":"sqlite3-ruby","source":"cvelist"},{"ranges":[{"type":"ecosystem","introduced":"2.1.0","status":"affected","fixed":"2.9.5"}],"ecosystem":"RubyGems","package":"sqlite3-ruby","purl":"pkg:gem/sqlite3-ruby","source":"ghsa"},{"ranges":[{"type":"ecosystem","introduced":"2.1.0","status":"affected","fixed":"2.9.5"}],"ecosystem":"RubyGems","package":"sqlite3","purl":"pkg:gem/sqlite3","source":"ghsa"}],"references":[{"url":"https://github.com/sparklemotion/sqlite3-ruby/security/advisories/GHSA-j7fr-3v8c-3qc3","tags":["web","x-refsource-confirm"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://github.com/sparklemotion/sqlite3-ruby/pull/711","tags":["web","x-refsource-misc"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://github.com/sparklemotion/sqlite3-ruby/commit/b24e1e6076528b7f95f99acf7a81c70d0004c726","tags":["web","x-refsource-misc"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://github.com/sparklemotion/sqlite3-ruby/releases/tag/v2.9.5","tags":["web","x-refsource-misc"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://github.com/rubysec/ruby-advisory-db/blob/master/gems/sqlite3/CVE-2026-54620.yml","tags":["web"],"sources":["ghsa"]},{"url":"https://github.com/sparklemotion/sqlite3-ruby","tags":["package"],"sources":["ghsa"]},{"url":"https://www.cve.org/CVERecord/SearchResults?query=CVE-2026-54620","tags":["web"],"sources":["ghsa"]}],"credits":[],"assigner":"GitHub_M","ssvc":{"scorer":"CISA-ADP","exploitation":"none","automatable":"no","technicalImpact":"partial","date":"2026-07-28T17:26:57.162Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2026-54620","url":"https://www.cve.org/CVERecord?id=CVE-2026-54620","licence":"CVE Terms of Use","modified":"2026-07-28T17:27:04.382Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-j7fr-3v8c-3qc3","url":"https://github.com/advisories/GHSA-j7fr-3v8c-3qc3","licence":"CC-BY-4.0","modified":"2026-07-28T16:35:58.603Z"},{"source":"nvd","name":"NVD","id":"CVE-2026-54620","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-54620","licence":"Public domain","modified":"2026-10-23T23:10:00.157Z"}],"updatedAt":"2026-11-25T22:59:30.356Z","epss":{"score":0.00107,"percentile":0.01222,"date":"2026-12-01T12:00:22.000Z"}}