Skip to content

OpenList: Arbitrary File Read via Path Prefix Confusion in Share Creation API

Moderate severity GitHub Reviewed Published Jul 23, 2026 in OpenListTeam/OpenList • Updated Jul 24, 2026

Package

gomod github.com/OpenListTeam/OpenList/v4 (Go)

Affected versions

<= 4.2.3

Patched versions

4.2.4

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:

  1. A system with at least two distinct directories at the root level: /base and /base2.
  2. A sensitive file exists at /base2/secret.txt.
  3. An attacker account with the CanShare permission enabled and its Base path strictly limited to /base.

Exploitation Steps:

  1. Log in as the attacker account and obtain the JWT authorization token.
  2. Send a POST request 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.

7b0bd29c9d12ad0b7b84a4a156559a5b

90b16bf15b6e8bfb87f16c4ab8864ea7

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)

References

@xrgzs xrgzs published to OpenListTeam/OpenList Jul 23, 2026
Published to the GitHub Advisory Database Jul 24, 2026
Reviewed Jul 24, 2026
Last updated Jul 24, 2026

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
Low
Privileges required
Low
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:L/PR:L/UI:N/S:U/C:H/I:N/A:N

EPSS score

Weaknesses

Authorization Bypass Through User-Controlled Key

The system's authorization functionality does not prevent one user from gaining access to another user's data or record by modifying the key value identifying the data. Learn more on MITRE.

CVE ID

No known CVE

GHSA ID

GHSA-86cx-wwf4-phq4

Source code

Credits

Loading Checking history
See something to contribute? Suggest improvements for this vulnerability.