The vulnerability, CVE-2026-50006, is an arbitrary file write in Anyquery's server mode, caused by unrestricted handling of the ATTACH DATABASE SQL command. The root cause is a lack of sandboxing and input validation for SQL queries received over the MySQL-compatible server port.
The analysis of the patch identifies two key functions that were part of the vulnerable execution path:
-
controller.Server: This function starts the Anyquery server. In its vulnerable state, it did not enforce any security restrictions, creating an open environment where malicious SQL could be executed. The patch introduces a sandboxing mechanism at this level by passing Restrictions to the namespace.
-
namespace.Namespace.Register: This function sets up new database connections. The core of the vulnerability lies here, as the vulnerable version did not set a SQLite authorizer on the connection. An authorizer is a callback that can approve or deny SQL operations. Without it, there was no mechanism to prevent the ATTACH DATABASE command from writing to arbitrary paths on the filesystem. The patch remediates this by adding conn.SetAuthorizer(n), which enforces the new sandboxing policy.
During an exploit, a remote attacker would connect to the server and send a crafted SQL query containing ATTACH DATABASE. The controller.Server function would accept this connection, and the namespace.Namespace.Register function would provide an insecure database connection to handle the query, leading to the arbitrary file write.