Skip to content

Incomplete fix of GHSA-j4wj-p47h-f9cc - a third file-URI shape (file::http://host/abs/path forced getter) bypasses the allow-dirs sandbox

Moderate
julien040 published GHSA-rj3v-75f4-r542 Aug 5, 2026

Package

gomod github.com/julien040/anyquery (Go)

Affected versions

<= 0.4.6

Patched versions

0.5.0

Description

Summary

A third file-URI shape, the file::http forced getter, bypasses the allow-dirs sandbox because the containment check treats it as a relative path under the working directory while go-getter opens the inner URL's absolute path. Live at HEAD 0.4.6+3 (981f706).

The defect

module/restrictions.go lines 61-96. The 0.4.6 fix (GHSA-j4wj) handled two file: shapes (its code comment enumerates them). It does not handle a third: a forced getter of the form file::http://host/abs/path. isRemoteSource and stripFileScheme treat file::http://host/abs/path as a LOCAL RELATIVE PATH under the working directory, so it passes the containment check, while go-getter's forced file getter opens the INNER URL's absolute u.Path. The two components disagree about what the string denotes, the same divergence class this campaign has confirmed repeatedly, here between the validator and go-getter.

Verified by execution through the real csv_reader vtable entry point: payloads read a file OUTSIDE --allow-dirs (content asserted) and read /etc/passwd, while FIVE negative controls, including the two already-fixed file: shapes, were correctly denied. That control set shows this is a genuinely new third shape rather than a re-report. Precondition, stated honestly: the same deployment shape the maintainer ALREADY ACCEPTED for GHSA-j4wj (the working directory being inside an allowed directory), and server mode is unauthenticated by default.

Suggested fix

Resolve the source to the exact path go-getter will open BEFORE the containment check, rather than inferring it, and reject any forced-getter prefix whose inner target escapes the allowlist. The durable fix is to derive the path to be opened and the path to be validated from the same resolution, so a third, fourth or fifth scheme shape cannot diverge again.

Also checked and sound: the ATTACH authorizer, the read_log grok gate, the MCP and GPT authentication, and the plugin-registry hash-pinning.

Tooling

I used AI assistance while investigating. The escape was executed through the real csv_reader entry point reading a file outside the allowlist and /etc/passwd, with five negative controls including the two already-fixed shapes, and I confirmed the cited helpers at HEAD.

I manually verified this finding against the project's source at the location cited above before reporting it; the AI assistance noted above was for the audit and the drafting.

Severity

Moderate

CVSS overall score

This score calculates overall vulnerability severity from 0 to 10 and is based on the Common Vulnerability Scoring System (CVSS).
/ 10

CVSS v3 base metrics

Attack vector
Network
Attack complexity
High
Privileges required
None
User interaction
None
Scope
Unchanged
Confidentiality
High
Integrity
None
Availability
None

CVSS v3 base metrics

Attack vector: More severe the more the remote (logically and physically) an attacker can be in order to exploit the vulnerability.
Attack complexity: More severe for the least complex attacks.
Privileges required: More severe if no privileges are required.
User interaction: More severe when no user interaction is required.
Scope: More severe when a scope change occurs, e.g. one vulnerable component impacts resources in components beyond its security scope.
Confidentiality: More severe when loss of data confidentiality is highest, measuring the level of data access available to an unauthorized user.
Integrity: More severe when loss of data integrity is the highest, measuring the consequence of data modification possible by an unauthorized user.
Availability: More severe when the loss of impacted component availability is highest.
CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:N/A:N

CVE ID

No known CVE

Weaknesses

Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal')

The product uses external input to construct a pathname that is intended to identify a file or directory that is located underneath a restricted parent directory, but the product does not properly neutralize special elements within the pathname that can cause the pathname to resolve to a location that is outside of the restricted directory. Learn more on MITRE.

Interpretation Conflict

Product A handles inputs or steps differently than Product B, which causes A to perform incorrect actions based on its perception of B's state. Learn more on MITRE.

Credits