CVE-2026-54619: Sqlite3 ruby Sqlite3-ruby Has Use-After-Free When Redefining Vulnerability

LOW
Advisory Identifier: GHSA-28hh-pr2h-2w89
CWE-416
Published
Advisory Summary

CVE-2026-54619 is a LOW sqlite3-ruby has use-after-free when redefining vulnerability (CWE-416: Use After Free) affecting Sqlite3 ruby libraries in the RubyGems ecosystem. The issue involves sqlite3-ruby has use-after-free when redefining sqlite functions with different arity. Remediation is available by upgrading affected packages to version 2.9.5.

CVE-2026-54619 at a Glance

CVE Identifier CVE-2026-54619
GHSA Identifier GHSA-28hh-pr2h-2w89
Severity LOW
CVSS v3.1 Base Score N/A
CWE Classification CWE-416: Use After Free
Affected Product Sqlite3 ruby
Package Ecosystem RubyGems
Published Date
Last Updated

How to Fix CVE-2026-54619

To remediate this vulnerability, upgrade all affected Sqlite3 ruby dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

sqlite3-ruby fixed: 2.9.5
Upgrade sqlite3-ruby to 2.9.5
sqlite3 fixed: 2.9.5
Upgrade sqlite3 to 2.9.5
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

inspect dependencies for sqlite3-ruby

How to Check if You Are Affected

To determine whether your application is affected by CVE-2026-54619, inspect your project dependencies for Sqlite3 ruby:

inspect dependencies for sqlite3-ruby

Analyze the terminal output to locate any version of Sqlite3 ruby in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 2.9.5), your application is affected.

Note: Verify declared build manifests and deployed runtime container environments.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-416: Use After Free, where the product reuses or references memory after it has been freed. at some point afterward, the memory may be allocated again and saved in another pointer, while the original pointer references a location somewhere within the new allocation. any operations using the original pointer are no longer valid because the memory "belongs" to the code that operates on the new pointer. In Sqlite3 ruby, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

## Summary Using `Database#create_function` or `Database#define_function` to define the same function name more than once with different numbers of arguments ("arity") or text encodings will result in a invalid memory read and a segmentation fault. ## Mitigation Upgrade to sqlite3 gem v2.9.5 or later. As a workaround, avoid defining multiple custom functions with the same name (varying numbers of arguments or encoding). ## 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.

CVE-2026-54619 Affected Sqlite3 ruby Versions

2 component(s)
Fixed Versions:
2.9.5
Product / Package Ecosystem Affected Versions Fixed Version
sqlite3-ruby
RubyGems
< 2.9.5
2.9.5
sqlite3
RubyGems
< 2.9.5
2.9.5

References

Frequently Asked Questions

What is CVE-2026-54619?
CVE-2026-54619 is a security vulnerability in Sqlite3 ruby involving sqlite3-ruby has Use-After-Free When Redefining SQLite Functions with Different Arity under CWE-416: Use After Free.
Which Sqlite3 ruby versions are affected?
Affected versions include releases prior to 2.9.5 across affected packages: sqlite3-ruby, sqlite3.
What version fixes CVE-2026-54619?
Upgrading to 2.9.5 (or the latest patched release for your respective branch) resolves the vulnerability.
Is sqlite3-ruby affected?
Yes, sqlite3-ruby is affected in releases prior to 2.9.5. Upgrade your dependency to 2.9.5 or later.
Is sqlite3 affected?
Yes, sqlite3 is affected in releases prior to 2.9.5. Upgrade your dependency to 2.9.5 or later.
What CWE is associated with CVE-2026-54619?
CVE-2026-54619 is classified under CWE-416: Use After Free (The product reuses or references memory after it has been freed. At some point afterward, the memory may be allocated again and saved in another pointer, while the original pointer references a location somewhere within the new allocation. Any operations using the original pointer are no longer valid because the memory "belongs" to the code that operates on the new pointer.).
How can I check RubyGems dependencies for CVE-2026-54619?
Run the dependency tree command: 'inspect dependencies for sqlite3-ruby'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-28hh-pr2h-2w89",
  "modified" : "2026-07-28T16:21:31Z",
  "published" : "2026-07-28T16:21:31Z",
  "aliases" : [ "CVE-2026-54619" ],
  "summary" : "sqlite3-ruby has Use-After-Free When Redefining SQLite Functions with Different Arity",
  "details" : "## Summary\n\nUsing `Database#create_function` or `Database#define_function` to define the same function name more than once with different numbers of arguments (\"arity\") or text encodings will result in a 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 defining multiple custom functions with the same name (varying numbers of arguments or encoding).\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.",
  "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"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "RubyGems",
      "name" : "sqlite3-ruby"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "2.9.5"
      } ]
    } ],
    "database_specific" : {
      "last_known_affected_version_range" : "<= 2.9.4"
    }
  }, {
    "package" : {
      "ecosystem" : "RubyGems",
      "name" : "sqlite3"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "2.9.5"
      } ]
    } ],
    "database_specific" : {
      "last_known_affected_version_range" : "<= 2.9.4"
    }
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/sparklemotion/sqlite3-ruby/security/advisories/GHSA-28hh-pr2h-2w89"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/sparklemotion/sqlite3-ruby/pull/710"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/sparklemotion/sqlite3-ruby/commit/2bd436d17f77cdd4c31b00fe9d50b0d21cbaf033"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/rubysec/ruby-advisory-db/blob/master/gems/sqlite3/CVE-2026-54619.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-54619"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-416" ],
    "severity" : "LOW",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-07-28T16:21:31Z",
    "nvd_published_at" : null
  }
}