Intel

AIKIDO-2026-805701

trilogy is vulnerable to File Descriptor Leak

Pre-CVE
Found by Aikido Intel before public disclosure or CVE publication.
Published Jul 6, 2026
July 6, 2026

36

CVE Score

Low

File Descriptor Leak

Are you affected? Scan for Free

TL;DR

The Ruby extension establishes the MySQL connection socket in Ruby and duplicates the underlying file descriptor with dup in contrib/ruby/ext/trilogy-ruby/cext.c before handing it to trilogy_connect_set_fd. The duplicated descriptor did not inherit the FD_CLOEXEC flag, so the live authenticated database socket stayed open across exec. Any child process spawned by the application while a Trilogy connection is open inherited that descriptor and could read from or write to the database connection. The fix reads the original descriptor flags with fcntl(F_GETFD) and reapplies them to the new descriptor with fcntl(F_SETFD) so the socket is closed on exec.

How do I fix this?

Upgrade the trilogy library to the patch version.

Who does this affect?

You are affected if you are using a version that falls within the vulnerable range and your application spawns child processes via exec while a Trilogy connection is open.

Package

Versions

2.11.0 - 2.12.4

Fixed in 2.12.5

Background info

trilogy is vulnerable to File Descriptor Leak in versions 2.11.0 - 2.12.4.

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