/

CVE-2026-47253

Severity:

HIGH RISK

(7.3)

Path Traversal (CWE-22) in Anyquery Plugin Cache API

CVE-2026-47253

Deferred

Vulnerability type

Category:

Path Traversal

CWE:

CWE-22

Impact:

Arbitrary File and Directory Deletion

Severity:

HIGH RISK

(7.3)

CVSS version:

3.1

Catch this CVE while code is being written

Detect vulnerable code directly in pull requests, so CVEs are fixed before merge.

Summary

Anyquery contains a path traversal vulnerability in the clear_plugin_cache(plugin) SQL function. A low-privileged bearer-token holder who can submit queries to the /v1/query endpoint may cause the server to recursively delete directories writable by its process, resulting in data loss or denial of service.

Affected context

The vulnerability occurs in Anyquery deployments before the affected fix where the plugin-cache cleanup function accepts caller-controlled names. Risk is present when:

  • The /v1/query endpoint is reachable by a user with a valid low-privileged bearer token
  • The SQL function is available to that user
  • The Anyquery process can write to directories outside its intended plugin-cache location
  • User-supplied path components are joined and passed to recursive deletion without traversal checks

Exploit preconditions

  • Attack surface: The /v1/query HTTP endpoint and its SQL function interface
  • Required access: A valid bearer token with permission to submit queries
  • Trigger point: Invocation of the clear_plugin_cache(plugin) scalar function
  • Why exploitation is possible: Caller-controlled path components are resolved with path.Join, allowing traversal segments to escape the intended cache directory before os.RemoveAll performs recursive deletion

Why this happens

The underlying bug is insufficient canonicalization and validation of an attacker-controlled filesystem path. The application treats a value intended to identify a plugin as a safe path component, but path joining can interpret traversal segments as directory navigation. Passing the resulting path to a recursive removal operation permits deletion beyond the designated cache root. This behavior maps to CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal').

Potential impact

  • An attacker may delete files or directories writable by the Anyquery server process
  • The service could experience denial of service
  • Persistent data loss could occur
  • Plugin or application state may be disrupted
  • Recovery operations could require restoration from backups

General mitigation guidance

Mitigation generally focuses on enforcing a strict filesystem trust boundary before any deletion operation.

Common defensive patterns include:

  • Accepting only opaque, allowlisted plugin identifiers rather than path fragments
  • Resolving candidate paths and verifying that they remain beneath the intended cache root
  • Rejecting traversal components, absolute paths, symbolic-link escapes, and unexpected separators
  • Using narrowly scoped deletion APIs that operate only on known plugin directories
  • Running the service with a dedicated least-privileged account and minimal writable filesystem access
  • Separating cache storage from persistent application data and applying filesystem protections where practical
  • Restricting which authenticated roles may invoke maintenance-oriented SQL functions

How teams detect issues like this

Detection approaches can include:

  • Static analysis rules for user-controlled values passed to path-joining and recursive deletion APIs
  • Code review checks for filesystem operations reachable through SQL functions or HTTP request handlers
  • Tests that verify canonicalized paths cannot escape an approved directory
  • Runtime audit logging for cache-clearing calls and recursive deletion failures
  • Policy enforcement that blocks maintenance functions from low-privilege query roles
  • Automated security review tools that identify path traversal and dangerous file-operation patterns

Sources

SourceLink
github.comgithub.com/julien040/anyquery/commit/27f84fc168310455eaf81ec4ba87eed20298670c
github.comgithub.com/julien040/anyquery/releases/tag/0.4.5
github.comgithub.com/julien040/anyquery/security/advisories/GHSA-j9rx-rppg-6hh4

Frequently asked

questions

An attacker generally needs a valid bearer token with permission to submit queries and invoke the exposed cache-clearing function. The impact is constrained by the filesystem permissions of the Anyquery server process.

It may be remotely exploitable through the /v1/query HTTP endpoint when that endpoint is reachable and the attacker has suitable authenticated access.

Treat plugin identifiers as data rather than paths, use an allowlist, and verify that every resolved target remains within the intended cache directory before deletion.

Apply least-privilege filesystem permissions, limit access to maintenance functions, test path-boundary enforcement, and monitor filesystem operations initiated by query requests.

Find out what's already
exploitable in your codebase.