Skip to main content

CVE-2026-54620 — sqlite3-ruby has Use-After-Free in sqlite3-ruby

LOW

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

Published July 28, 2026Updated July 28, 2026Source: OSV

What Should I Do?

Address in Next Maintenance Window

Low exploitation probability (0.14%). Schedule for your next planned update.

Does your project use an affected sqlite3-ruby version?

Paste your Gemfile.lock to check it for CVE-2026-54620 and every other known vulnerability, with CISA KEV and EPSS on each finding. Free with no signup for up to 10 packages, or up to 500 per scan with a free account, which also keeps up to 200 packages in saved projects.

Check my Gemfile.lock

Summary

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.

Advisory Timeline

  • First published July 28, 2026 (121 days ago).
  • Last revised July 28, 2026 — 0 days after initial publication.

Remediation

Upgrade to the fixed version using your package manager.

Bundler
Update sqlite3-ruby to 2.9.5 or later
gem install sqlite3-ruby -v 2.9.5
Bundler
Update sqlite3 to 2.9.5 or later
gem install sqlite3 -v 2.9.5

After upgrading, scan your dependencies again to confirm the vulnerability is resolved.

Affected Packages (2)

Affects 1 ecosystem: RubyGems (2).

PackageFixed In
sqlite3-ruby RubyGems · Affected: All versions2.9.5
sqlite3 RubyGems · Affected: 2.1.0, 2.1.1, 2.2.0, 2.3.0 (+19 more)2.9.5

Vulnerability Classification

Common Weakness Enumeration (CWE) identifiers for this vulnerability type.

CVSS Score Breakdown

What the CVSS (Common Vulnerability Scoring System) 4.5 score means for each attack dimension.

Attack Vector
Local
Attack Complexity
High
Privileges Required
Low
User Interaction
None
Scope
—
Confidentiality
—
Integrity
—
Availability
—

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

Frequently Asked Questions

What is CVE-2026-54620?
sqlite3-ruby has Use-After-Free in SQLite Aggregate Function Callbacks. This vulnerability has been assigned a severity rating of LOW (CVSS score: 4.5/10).
How do I check if my project is affected by CVE-2026-54620?
CVE-2026-54620 affects sqlite3-ruby and sqlite3. It has a 0.1% probability of exploitation within 30 days (EPSS score). Use GeekWala's free vulnerability scanner to check your dependencies against CVE-2026-54620 and 200,000+ other known vulnerabilities.

Severity & Exploitability

CVSS Score
4.5

Exploitation requires specific conditions, or the impact is limited.

EPSS Score (30-day exploit probability)
0.14%
EPSS percentile: 1.8

This is a below-median EPSS score — only 1.8% of tracked vulnerabilities score at or below it, so most tracked vulnerabilities are considered more likely to be exploited than this one.

Also Known As

GHSA-j7fr-3v8c-3qc3

Related CVEs

  • CVE-2026-128084
    MEDIUM

    sqlite3-ruby: Possible SQL query truncation when a string is 4 GiB or larger

  • GHSA-mwm8-39rw-8826
    MEDIUM

    sqlite3-ruby: Use-After-Free in SQLite Aggregate Arguments in Heap-Allocated Argument Array

  • CVE-2026-54619
    LOW

    sqlite3-ruby has Use-After-Free When Redefining SQLite Functions with Different Arity

  • CVE-2026-126063
    LOW

    Nokogiri: Mutation XSS through `noscript` content in Nokogiri's HTML5 serializer

  • CVE-2026-73492
    LOW

    Loofah `allowed_uri?` does not detect `javascript:` URIs split by numeric character references without semicolons

Check your own dependencies

Free, with no signup for up to 10 packages.

Check my Gemfile.lock