{"id":"CVE-2026-54628","aliases":["CVE-2026-54628","GHSA-hwrq-8wxh-q4xv","GO-2026-5988"],"related":[],"kind":"vulnerability","state":"published","title":"Anyquery: Server-Side Request Forgery (SSRF) via Unrestricted SQLite Virtual Table Modules in Server Mode","summary":"Anyquery is an SQL query engine built on top of SQLite. Prior to 0.4.5, anyquery server exposes URL-capable SQLite virtual table modules such as json_reader and log_reader through its unauthenticated MySQL-compatible server port without restricting outbound destinations. A remote attacker can provide a loopback, private-network, or link-local cloud metadata URL, causing go-getter in the Anyquery server process to fetch the selected resource and expose its response as queryable table data. This permits internal network probing, access to internal APIs, and disclosure of cloud credentials; low-integrity impact is possible when a reached internal API performs state-changing actions. This issue is fixed in version 0.4.5.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"Anyquery is an SQL query engine built on top of SQLite. Prior to 0.4.5, anyquery server exposes URL-capable SQLite virtual table modules such as json_reader and log_reader through its unauthenticated MySQL-compatible server port without restricting outbound destinations. A remote attacker can provide a loopback, private-network, or link-local cloud metadata URL, causing go-getter in the Anyquery server process to fetch the selected resource and expose its response as queryable table data. This permits internal network probing, access to internal APIs, and disclosure of cloud credentials; low-integrity impact is possible when a reached internal API performs state-changing actions. This issue is fixed in version 0.4.5.","source":"cvelist"},{"lang":"en","text":"## Summary\nAnyquery's `server` mode does not restrict outbound HTTP requests initiated by its built-in SQLite virtual table modules (e.g., `json_reader`, `log_reader`). Unauthenticated attackers connecting to the MySQL-compatible server port can create virtual tables pointing to internal network endpoints or Cloud Metadata IPs (e.g., `http://169.254.169.254/latest/meta-data/`). This allows attackers to perform Server-Side Request Forgery (SSRF), bypassing external firewalls to scan internal ports and exfiltrate cloud credentials.\n\n## Details\nWhen Anyquery is launched in **Server Mode** (`anyquery server`), it binds to a TCP port and accepts MySQL protocol connections. The server handler allows the creation of dynamic virtual tables using modules like `json_reader` or `log_reader`, which internally use `go-getter` to fetch URLs. There is no protection mechanism to prevent fetches to local (127.0.0.0/8), private (10.0.0.0/8), or special (169.254.169.254) IP addresses. \n\nAn attacker can use this to map internal networks, interact with internal APIs, or steal IAM tokens from cloud metadata servers by fetching the data and reading it as a database table.\n\n## PoC (Proof of Concept)\n1. Start the server on the victim machine (e.g., an AWS EC2 instance):\n   ```bash\n   anyquery server --host 0.0.0.0 --port 8070\n   ```\n2. Connect from an attacker machine:\n   ```bash\n   mysql -u root -h <VICTIM_IP> -P 8070\n   ```\n3. Execute the payload to fetch AWS Metadata or hit a local API:\n   ```sql\n   -- Payload 1: Fetch AWS Cloud Metadata (IAM credentials)\n   CREATE VIRTUAL TABLE aws_meta USING log_reader('http://169.254.169.254/latest/meta-data/');\n   SELECT * FROM aws_meta;\n\n   -- Payload 2: Access an internal application bound only to localhost\n   CREATE VIRTUAL TABLE local_admin USING log_reader('http://localhost:8000/admin');\n   SELECT * FROM local_admin LIMIT 10;\n   ```\n\n## Impact\n- **Confidentiality:** High. Exfiltration of sensitive internal network data or cloud credentials.\n- **Integrity:** Low. Possible interaction with state-changing internal REST APIs.\n- **Availability:** None.\n- **CVSS Score:** 8.6 (High) - `CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:N/A:N`\n\n## Remediation\nBy default, in Server Mode, remote HTTP fetches to local/private IP ranges and known Cloud Metadata IP addresses should be blocked unless explicitly enabled via configuration.","format":"markdown","source":"ghsa"},{"lang":"en","text":"Anyquery: Server-Side Request Forgery (SSRF) via Unrestricted SQLite Virtual Table Modules in Server Mode in github.com/julien040/anyquery","format":"markdown","source":"go"}],"published":"2026-07-14T20:02:06.000Z","modified":"2026-09-30T17:51:56.193Z","severity":{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:N/A:N","score":8.6,"rating":"HIGH"},"severities":[{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:N/A:N","score":8.6,"rating":"HIGH"},{"scorer":"GitHub","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:N/A:N","score":8.6,"rating":"HIGH"}],"cwes":["CWE-284","CWE-441","CWE-862","CWE-918"],"affected":[{"ranges":[{"version":"< 0.4.5","status":"affected"}],"vendor":"julien040","product":"anyquery","source":"cvelist"},{"ranges":[{"type":"semver","introduced":"0","status":"affected"}],"ecosystem":"Go","package":"github.com/julien040/anyquery","purl":"pkg:golang/github.com/julien040/anyquery","source":"ghsa"},{"ranges":[{"type":"semver","introduced":"0","status":"affected"}],"ecosystem":"Go","package":"github.com/julien040/anyquery","purl":"pkg:golang/github.com/julien040/anyquery","source":"go"}],"references":[{"url":"https://github.com/julien040/anyquery/security/advisories/GHSA-hwrq-8wxh-q4xv","tags":["advisory","exploit","web","x-refsource-confirm"],"sources":["cvelist","ghsa","go","nvd"]},{"url":"https://github.com/julien040/anyquery/commit/27f84fc168310455eaf81ec4ba87eed20298670c","tags":["x-refsource-misc"],"sources":["cvelist","nvd"]},{"url":"https://github.com/julien040/anyquery/releases/tag/0.4.5","tags":["web","x-refsource-misc"],"sources":["cvelist","ghsa","go","nvd"]},{"url":"https://github.com/julien040/anyquery","tags":["package"],"sources":["ghsa"]}],"credits":[],"assigner":"GitHub_M","ssvc":{"scorer":"CISA-ADP","exploitation":"poc","automatable":"yes","technicalImpact":"partial","date":"2026-09-16T16:13:52.721Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2026-54628","url":"https://www.cve.org/CVERecord?id=CVE-2026-54628","licence":"CVE Terms of Use","modified":"2026-09-16T16:16:01.192Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-hwrq-8wxh-q4xv","url":"https://github.com/advisories/GHSA-hwrq-8wxh-q4xv","licence":"CC-BY-4.0","modified":"2026-07-21T19:19:07.950Z"},{"source":"go","name":"Go Vulnerability Database","id":"GO-2026-5988","url":"https://pkg.go.dev/vuln/GO-2026-5988","licence":"CC-BY-4.0","modified":"2026-07-21T19:15:33.206Z"},{"source":"nvd","name":"NVD","id":"CVE-2026-54628","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-54628","licence":"Public domain","modified":"2026-09-30T17:51:56.193Z"}],"updatedAt":"2026-11-25T22:59:38.361Z","epss":{"score":0.00429,"percentile":0.3901,"date":"2026-12-01T12:00:22.000Z"}}