Intel

AIKIDO-2026-919123

trilogy is vulnerable to SQL Injection

GHSA-744p-w4gc-m3ghPublished Oct 29, 2026
October 29, 2026

93

CVE Score

Critical

SQL Injection

Are you affected? Scan for Free

TL;DR

Affected versions of this package are vulnerable to SQL injection because Trilogy#escape produces unsafe output for Strings in multibyte encodings such as Shift_JIS, Windows-31J, Big5, GBK or GB18030. In these encodings the continuation byte of a multibyte character can fall in the ASCII range, but escape assumed a strict ASCII superset and did not handle this correctly. An unauthenticated attacker who can influence the encoding or content of a String that is escaped can break out of the quoted string and inject arbitrary SQL. The fix additionally makes connections configured with sjis, cp932, big5, gbk or gb18030 raise an ArgumentError, as those connection encodings never worked correctly.

How do I fix this?

Upgrade the trilogy library to the patch version. If you cannot upgrade, enforce the encoding of all Strings passed to Trilogy#escape and Trilogy#query.

Who does this affect?

You are affected if you are using a version that falls within the vulnerable range and you pass attacker-influenced Strings to Trilogy#escape (including via Ruby on Rails or Rack applications using the Trilogy adapter), where the attacker can control the String's encoding, or if the connection is configured with encoding: sjis, cp932, big5, gbk or gb18030.

Package

Versions

0.0.1 - 2.13.1

Fixed in 2.13.2

Background info

trilogy is vulnerable to SQL Injection in versions 0.0.1 - 2.13.1.

Get secure today,
quickly and for free.

Secure your code, cloud, and runtime in one central system. Connect a repo to discover what the reasoning agents find in your codebase.

No credit card required | Scan results in 32 seconds.

Trusted by 150k+ orgs
  • Revolut
  • n8n
  • Lovable
  • Deel
  • Prove
  • Omnea