GHSA-86cx-wwf4-phq4
MEDIUMOpenList: Arbitrary File Read via Path Prefix Confusion in Share Creation API
Blast Radius
github.com/OpenListTeam/OpenList/v4Real-time download stats are indexed for npm and PyPI packages. This vulnerability affects Go packages — download data is not available via public APIs for these ecosystems.
Description
Summary
An authorization bypass vulnerability exists in the file sharing mechanism of Openlist. Due to a flawed, non-separator-aware path validation check, an authenticated user can create share links for files outside their restricted base directory. This allows an attacker to bypass tenant/user isolation and gain unauthorized read access to arbitrary files within the system.
Details
When a user attempts to create or update a file share, the application must verify that the requested file path falls within the user's assigned BasePath. However, in server/handles/sharing.go, this authorization check relies on a simple string prefix function: strings.HasPrefix(requested_path, user.BasePath).
Because strings.HasPrefix does not account for directory separators (e.g., /), an attacker whose BasePath is assigned to /base can supply a target path like /base2/secret_document.txt. The validation strings.HasPrefix("/base2/secret_document.txt", "/base") evaluates to true, successfully passing the authorization filter.
Once the share is created, the public share download/list handlers unwrap and serve the file based on the stored absolute path without re-verifying the creator's current directory scope, granting the attacker horizontal access to unauthorized data.
PoC
Prerequisites:
- A system with at least two distinct directories at the root level:
/baseand/base2. - A sensitive file exists at
/base2/secret.txt. - An attacker account with the
CanSharepermission enabled and itsBase pathstrictly limited to/base.
Exploitation Steps:
- Log in as the attacker account and obtain the JWT authorization token.
- Send a
POSTrequest to create a new share, intentionally targeting the unauthorized sibling directory/base2:
POST /api/share/create HTTP/1.1
Host: <your-openlist-host>
Authorization: <attacker-jwt-token>
Content-Type: application/json
{
"files": ["/base2/secret.txt"],
"pwd": "",
"max_accessed": 0
}
Observe the bypass: The API accepts the request and responds with a successful share creation message, returning a share_id.
The attacker can now access the public share endpoint (e.g., via the web UI or API /api/fs/list / /sd/<share-id>/...) to download or view /base2/secret.txt, completely bypassing their directory restrictions.
Impact
This is a High-severity Horizontal and Vertical Privilege Escalation vulnerability. A malicious user with basic sharing privileges can weaponize this path confusion to expose, read, and download any file from other users' directories or internal application paths, provided the target path shares the same string prefix as their own directory. This completely breaks the data isolation guarantees of the application.
Remediation Recommendations
Canonical Path Containment: Replace the raw strings.HasPrefix check with a robust, separator-aware path containment validation. Ensure both paths are normalized, and use logic such as: target == base || strings.HasPrefix(target, base + "/").
Centralized Validation Utility: Implement a dedicated function (e.g., utils.IsSubPath(base, target)) and apply it consistently across share creation, updating, and viewing handlers to prevent regressions.
Credits
- Thai Son Dinh from VinSOC Labs (R&D)
Affected Packages
| Ecosystem | Package | Vulnerable range | Fix |
|---|---|---|---|
| 🐹Go | github.com/OpenListTeam/OpenList/v4 | all versions | 4.2.4 |
Detection & mitigation playbook
Open-source dependencyDetect
Scan your dependency tree (package-lock.json, pnpm-lock.yaml, requirements.txt, go.sum, etc.) for github.com/OpenListTeam/OpenList/v4. O3's reachability analysis confirms whether the vulnerable code path is actually invoked in your application, so you act on real exposure instead of every transitive match.
Fix
Update github.com/OpenListTeam/OpenList/v4 to 4.2.4 or later, then make sure no transitive (indirect) dependency still pins the vulnerable range — O3 confirms GHSA-86cx-wwf4-phq4 is resolved across your whole dependency graph.
Workarounds
If you can't upgrade right away: gate or disable the affected feature, validate untrusted input at the boundary, and avoid passing attacker-controlled data into the vulnerable path. O3's runtime protection blocks exploitation in production as an interim safeguard until the upgrade lands.
How O3 protects you
O3 pinpoints whether GHSA-86cx-wwf4-phq4 is reachable in your code and exactly where to fix it, then blocks exploitation in production at runtime until the patched version is deployed.
Tailored to GHSA-86cx-wwf4-phq4. Runtime protection reduces exposure until a permanent patch is applied and verified — it complements patching, it doesn't replace it.
Frequently Asked Questions
Is GHSA-86cx-wwf4-phq4 in your dependencies?
O3 detects GHSA-86cx-wwf4-phq4 across Go dependencies and uses function-level reachability to confirm whether the vulnerable code path is actually reachable — not just present. No false positives.