{"id":"GHSA-j7fr-3v8c-3qc3","summary":"sqlite3-ruby has Use-After-Free in SQLite Aggregate Function Callbacks","details":"## 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.","aliases":["CVE-2026-54620"],"modified":"2026-07-28T16:35:58.603828Z","published":"2026-07-28T16:23:57Z","database_specific":{"github_reviewed":true,"github_reviewed_at":"2026-07-28T16:23:57Z","nvd_published_at":null,"cwe_ids":["CWE-416"],"severity":"LOW"},"references":[{"type":"WEB","url":"https://github.com/sparklemotion/sqlite3-ruby/security/advisories/GHSA-j7fr-3v8c-3qc3"},{"type":"WEB","url":"https://github.com/sparklemotion/sqlite3-ruby/pull/711"},{"type":"WEB","url":"https://github.com/sparklemotion/sqlite3-ruby/commit/b24e1e6076528b7f95f99acf7a81c70d0004c726"},{"type":"WEB","url":"https://github.com/rubysec/ruby-advisory-db/blob/master/gems/sqlite3/CVE-2026-54620.yml"},{"type":"PACKAGE","url":"https://github.com/sparklemotion/sqlite3-ruby"},{"type":"WEB","url":"https://github.com/sparklemotion/sqlite3-ruby/releases/tag/v2.9.5"},{"type":"WEB","url":"https://www.cve.org/CVERecord/SearchResults?query=CVE-2026-54620"}],"affected":[{"package":{"name":"sqlite3-ruby","ecosystem":"RubyGems","purl":"pkg:gem/sqlite3-ruby"},"ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"2.1.0"},{"fixed":"2.9.5"}]}],"database_specific":{"last_known_affected_version_range":"\u003c= 2.9.4","source":"https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2026/07/GHSA-j7fr-3v8c-3qc3/GHSA-j7fr-3v8c-3qc3.json"}},{"package":{"name":"sqlite3","ecosystem":"RubyGems","purl":"pkg:gem/sqlite3"},"ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"2.1.0"},{"fixed":"2.9.5"}]}],"versions":["2.1.0","2.1.1","2.2.0","2.3.0","2.3.1","2.4.0","2.4.1","2.5.0","2.5.0.rc1","2.6.0","2.7.0","2.7.1","2.7.2","2.7.3","2.7.4","2.8.0","2.8.1","2.9.0","2.9.1","2.9.2","2.9.2.rc2","2.9.3","2.9.4"],"database_specific":{"source":"https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2026/07/GHSA-j7fr-3v8c-3qc3/GHSA-j7fr-3v8c-3qc3.json","last_known_affected_version_range":"\u003c= 2.9.4"}}],"schema_version":"1.9.0","severity":[{"type":"CVSS_V4","score":"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"}]}