{"id":"CVE-2026-54620","aliases":["DEBIAN-CVE-2026-54620","EUVD-2026-49899","GHSA-j7fr-3v8c-3qc3","UBUNTU-CVE-2026-54620"],"status":"published","title":"sqlite3-ruby has Use-After-Free in SQLite Aggregate Function Callbacks","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.","severity":{"version":"4.0","score":2,"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","level":"low","assessor":"cna","from":"cve"},"epss":{"day":"2026-11-12","score":0.00142,"percentile":0.03541,"model":"v2026.06.15"},"facts":{"in_kev":false,"known_exploited":false,"public_exploit":false,"fix_available":true},"cwes":["CWE-416"],"published":"2026-07-28T16:23:38Z","modified":"2026-11-11T02:49:02Z","fixes":[{"ecosystem":"RubyGems","package":"sqlite3-ruby","fixed_in":["2.9.5"],"sources":["ghsa","osv"]},{"ecosystem":"RubyGems","package":"sqlite3","fixed_in":["2.9.5"],"sources":["ghsa","osv"]},{"ecosystem":"Debian:14","package":"ruby-sqlite3","fixed_in":["2.9.5-1"],"sources":["osv"]}],"affected":[{"source":"ghsa","ecosystem":"RubyGems","package":"sqlite3-ruby","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"2.1.0"},{"last_affected":"2.9.4"},{"fixed":"2.9.5"}]}]},{"source":"ghsa","ecosystem":"RubyGems","package":"sqlite3","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"2.1.0"},{"last_affected":"2.9.4"},{"fixed":"2.9.5"}]}]},{"source":"osv","ecosystem":"Debian:12","package":"ruby-sqlite3","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"}]}],"versions":["1.4.2-4","1.6.9-1","1.6.9-2","1.7.3-1","1.7.3-2","2.10.0-1~exp1","2.9.0-1","2.9.1-1","2.9.3-1","2.9.5-1","2.9.5-2","2.9.6-1","2.9.6-2"]},{"source":"osv","ecosystem":"Debian:13","package":"ruby-sqlite3","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"}]}],"versions":["1.7.3-1","1.7.3-2","2.10.0-1~exp1","2.9.0-1","2.9.1-1","2.9.3-1","2.9.5-1","2.9.5-2","2.9.6-1","2.9.6-2"]},{"source":"osv","ecosystem":"Debian:14","package":"ruby-sqlite3","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"2.9.5-1"}]}],"versions":["1.7.3-1","1.7.3-2","2.9.0-1","2.9.1-1","2.9.3-1"]},{"source":"osv","ecosystem":"RubyGems","package":"sqlite3-ruby","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"2.1.0"},{"fixed":"2.9.5"}]}]},{"source":"osv","ecosystem":"RubyGems","package":"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"]},{"source":"osv","ecosystem":"Ubuntu:16.04:LTS","package":"ruby-sqlite3","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"}]}],"versions":["1.3.10-1","1.3.11-1","1.3.11-1build1","1.3.11-2","1.3.11-2build1"]},{"source":"osv","ecosystem":"Ubuntu:18.04:LTS","package":"ruby-sqlite3","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"}]}],"versions":["1.3.13-1","1.3.13-1build1","1.3.13-1build2"]},{"source":"osv","ecosystem":"Ubuntu:20.04:LTS","package":"ruby-sqlite3","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"}]}],"versions":["1.3.13-1build2","1.4.2-2build1"]},{"source":"osv","ecosystem":"Ubuntu:22.04:LTS","package":"ruby-sqlite3","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"}]}],"versions":["1.4.2-3","1.4.2-3build1","1.4.2-4"]},{"source":"osv","ecosystem":"Ubuntu:24.04:LTS","package":"ruby-sqlite3","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"}]}],"versions":["1.4.2-4build2","1.4.2-4build3","1.4.2-4build4"]},{"source":"osv","ecosystem":"Ubuntu:26.10","package":"ruby-sqlite3","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"}]}],"versions":["1.7.3-2","2.9.5-2"]},{"source":"osv","ecosystem":"Ubuntu:26.04:LTS","package":"ruby-sqlite3","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"}]}],"versions":["1.7.3-1","1.7.3-2"]}],"products":[{"vendor":"sparklemotion","product":"sqlite3-ruby"}],"references":[{"url":"https://github.com/sparklemotion/sqlite3-ruby/security/advisories/GHSA-j7fr-3v8c-3qc3","tags":["x_refsource_CONFIRM","advisory","web","report"]},{"url":"https://github.com/sparklemotion/sqlite3-ruby/pull/711","tags":["x_refsource_MISC","fix","web","report"]},{"url":"https://github.com/sparklemotion/sqlite3-ruby/commit/b24e1e6076528b7f95f99acf7a81c70d0004c726","tags":["x_refsource_MISC","fix","web"]},{"url":"https://github.com/sparklemotion/sqlite3-ruby/releases/tag/v2.9.5","tags":["x_refsource_MISC","web"]},{"url":"https://github.com/rubysec/ruby-advisory-db/blob/master/gems/sqlite3/CVE-2026-54620.yml","tags":["web"]},{"url":"https://www.cve.org/CVERecord/SearchResults?query=CVE-2026-54620","tags":["web"]},{"url":"https://github.com/advisories/GHSA-j7fr-3v8c-3qc3"},{"url":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/54xxx/CVE-2026-54620.json","tags":["advisory"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2026-54620","tags":["advisory"]},{"url":"https://security-tracker.debian.org/tracker/CVE-2026-54620","tags":["advisory"]},{"url":"https://github.com/sparklemotion/sqlite3-ruby","tags":["package"]},{"url":"https://ubuntu.com/security/CVE-2026-54620","tags":["report"]},{"url":"https://www.cve.org/CVERecord?id=CVE-2026-54620","tags":["report"]}],"sources":{"cve":[{"id":"CVE-2026-54620","title":"sqlite3-ruby has Use-After-Free in SQLite Aggregate Function Callbacks","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.","status":"published","published":"2026-07-28T16:23:38.389Z","modified":"2026-07-28T17:27:04.382Z","cvss":[{"version":"4.0","score":2,"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","level":"low","assessor":"cna"}],"cwes":["CWE-416"],"updated_at":"2026-11-02T13:38:20.971157Z"}],"euvd":[{"id":"EUVD-2026-49899","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.","status":"published","published":"2026-07-28T16:23:38Z","modified":"2026-07-28T17:27:04Z","cvss":[{"version":"4.0","score":2,"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","level":"low"}],"updated_at":"2026-11-02T18:02:30.949894Z"}],"ghsa":[{"id":"GHSA-j7fr-3v8c-3qc3","title":"sqlite3-ruby has Use-After-Free in SQLite Aggregate Function Callbacks","description":"## 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.","status":"published","published":"2026-07-28T16:23:57Z","modified":"2026-07-28T16:23:59Z","cvss":[{"version":"4.0","score":2,"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","level":"low"}],"cwes":["CWE-416"],"updated_at":"2026-11-02T14:40:53.707378Z"}],"nvd":[{"id":"CVE-2026-54620","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.","status":"published","published":"2026-07-28T17:16:52.79Z","modified":"2026-10-23T23:10:00.157Z","cvss":[{"version":"4.0","score":2,"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/E:X/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X","level":"low","assessor":"secondary"}],"cwes":["CWE-416"],"updated_at":"2026-11-02T14:12:33.249634Z"}],"osv":[{"id":"CVE-2026-54620","title":"sqlite3-ruby has Use-After-Free in SQLite Aggregate Function Callbacks","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.","status":"published","published":"2026-07-28T16:23:38.389Z","modified":"2026-11-11T13:25:16.154039488Z","cvss":[{"version":"4.0","score":2,"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","level":"low"}],"cwes":["CWE-416"],"updated_at":"2026-11-11T03:21:28.618498Z"},{"id":"DEBIAN-CVE-2026-54620","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.","status":"published","published":"2026-07-28T17:16:52.79Z","modified":"2026-10-24T10:01:14.827766295Z","cvss":[{"version":"4.0","score":2,"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/E:X/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X","level":"low"}],"updated_at":"2026-11-02T15:45:57.236551Z"},{"id":"GHSA-j7fr-3v8c-3qc3","title":"sqlite3-ruby has Use-After-Free in SQLite Aggregate Function Callbacks","description":"## 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.","status":"published","published":"2026-07-28T16:23:57Z","modified":"2026-07-28T16:35:58.603828Z","cvss":[{"version":"4.0","score":2,"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","level":"low"}],"cwes":["CWE-416"],"updated_at":"2026-11-02T15:46:49.977351Z"},{"id":"UBUNTU-CVE-2026-54620","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.","status":"published","published":"2026-07-28T17:16:00Z","modified":"2026-10-17T12:59:06.772346702Z","cvss":[{"version":"4.0","score":2,"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","level":"low"}],"updated_at":"2026-11-02T16:56:41.382716Z"}]}}
