Intel

AIKIDO-2026-11127

sqlite3 is vulnerable to Use After Free

Use After FreeGHSA-28hh-pr2h-2w89 Published 2 days ago

37

Low Risk

This Affects:

RUBYsqlite3
0.0.1 - 2.9.4
Fixed in 2.9.5
Are you affected? Scan for Free

TL;DR

The sqlite3 Ruby gem registers user-defined SQLite functions through C extension callbacks that hold pointers to Ruby blocks. Redefining the same function name with a different arity replaces the stored block while SQLite may still reference the prior callback, and garbage collection can then trigger an invalid memory read and segmentation fault. Affected applications using create_function or define_function with duplicate names and varying argument counts can crash the Ruby process. Version 2.9.5 retains all function blocks for the database object lifetime instead of overwriting them in a name-keyed collection.

Who does this affect?

You are affected if you are using a version that falls within the vulnerable range.

Background info

sqlite3 is vulnerable to Use After Free in versions 0.0.1 - 2.9.4.

How to fix this

Upgrade the sqlite3 and/or the sqlite3-ruby library to the patch version.