Skip to content
HighVulnerability

GHSA-j9rx-rppg-6hh4: Anyquery has Path Traversal through `clear_plugin_cache`, Allowing Arbitrary Directory Deletion

Published
Record updated
View JSON
Affected
  • github.com/julien040/anyquery <= 0.4.4
Fixed in
0.4.5
Known exploitation
Not listed in the CISA Known Exploited Vulnerabilities catalog at the last check.
EPSS
0.4%

Summary

The `clear_plugin_cache(plugin)` SQL scalar function in `namespace/other_functions.go` in julien040/anyquery 0.4.4 passes the caller-supplied `plugin` argument to `path.Join` and then to `os.RemoveAll`, guarded only by an empty-string check. Because `path.Join` resolves `..` segments, a low-privileged bearer-token holder can send `SELECT clear_plugin_cache('../../../../tmp/target')` to the `/v1/query` HTTP endpoint and delete directories outside the plugin cache that the server process can reach. The report states a directory outside `$XDG_CACHE_HOME/anyquery/plugins/` was successfully deleted in a verified scenario.

Mitigation

The source does not state a fix yet. Check the original advisory for updates.