GHSA-P6PH-3JX2-3337
Vulnerability from github – Published: 2026-07-24 22:32 – Updated: 2026-07-24 22:32Summary
An authorization bypass and information disclosure vulnerability exists in the search API of Openlist. Due to a non-separator-aware path check and unfiltered backend counting, a low-privileged user can bypass their assigned BasePath restrictions to discover and access metadata of files residing in unauthorized sibling directories.
Details
This vulnerability stems from two combined logic flaws when the bleve search engine is utilized:
-
Insecure Path Prefix Validation: In the search handler (
server/handles/search.go), the application attempts to restrict search results to the user's allowed namespace using a simple prefix check:strings.HasPrefix(node.Parent, user.BasePath). Because this function is not path-separator aware, a user with aBasePathrestricted to/basewill successfully pass the authorization check for a completely separate directory named/base2(since "/base2" starts with "/base"). -
Unfiltered Total Count Leakage: The
blevebackend (internal/search/bleve/search.go) searches the index globally and ignores thereq.Parentboundary. Even if the application later successfully filters out unauthorized items from theContentarray (e.g., viaCanAccessmeta password checks), it still returns the rawTotalcount provided by the search backend. This allows an attacker to perform blind data-enumeration, confirming the existence of sensitive files outside their namespace by observing theTotalcount.
PoC
Prerequisites:
1. Log in as an administrator and set the Search Index Mode to bleve. Build the index.
2. Create two directories at the root level: /base and /base2.
3. Upload a sensitive file into the unauthorized directory: /base2/secret_financial_report.pdf.
4. Create a low-privileged test user and strictly set their Base path to /base.
Exploitation Steps: 1. Authenticate as the newly created low-privileged user. 2. Send the following HTTP request to the search API:
POST /api/fs/search HTTP/1.1
Host: <your-openlist-host>
Authorization: <test-user-token>
Content-Type: application/json
{
"parent": "/",
"keywords": "secret",
"page": 1,
"per_page": 20,
"scope": 0
}
- Observe the response: Due to the prefix bypass (
strings.HasPrefix("/base2", "/base") == true), the metadata forsecret_financial_report.pdfwill be leaked in the response Content.- Alternatively, even if access is further blocked by folder-level passwords, the Total field will return > 0, allowing the attacker to blindly confirm the existence of the keyword "secret" in unauthorized global directories.
Impact
This is an Information Disclosure and Horizontal/Vertical Privilege Escalation vulnerability. Any authenticated user can enumerate hidden infrastructure, verify the existence of sensitive files (e.g., passwords, internal documents), and extract file metadata across the entire storage namespace, completely defeating the BasePath isolation mechanism.
Remediation Recommendations
- Separator-Aware Path Containment: Replace strings.HasPrefix with a robust path containment check. For example: target == base || strings.HasPrefix(target, base + "/"), or use a dedicated utility like utils.IsSubPath().
- Backend-Level Filtering: Enforce the path boundary within the bleve query itself (e.g., using indexed parent path hashes) rather than relying solely on post-query API filtering.
- Accurate Total Calculation: Compute the Total count only after all authorization and path filters have been applied to the result set.
{
"affected": [
{
"database_specific": {
"last_known_affected_version_range": "\u003c= 4.2.3"
},
"package": {
"ecosystem": "Go",
"name": "github.com/OpenListTeam/OpenList/v4"
},
"ranges": [
{
"events": [
{
"introduced": "0"
},
{
"fixed": "4.2.4"
}
],
"type": "ECOSYSTEM"
}
]
}
],
"aliases": [],
"database_specific": {
"cwe_ids": [
"CWE-200",
"CWE-639"
],
"github_reviewed": true,
"github_reviewed_at": "2026-07-24T22:32:17Z",
"nvd_published_at": null,
"severity": "MODERATE"
},
"details": "### Summary\nAn authorization bypass and information disclosure vulnerability exists in the search API of `Openlist`. Due to a non-separator-aware path check and unfiltered backend counting, a low-privileged user can bypass their assigned `BasePath` restrictions to discover and access metadata of files residing in unauthorized sibling directories.\n\n### Details\nThis vulnerability stems from two combined logic flaws when the `bleve` search engine is utilized:\n\n1. **Insecure Path Prefix Validation:** In the search handler (`server/handles/search.go`), the application attempts to restrict search results to the user\u0027s allowed namespace using a simple prefix check: `strings.HasPrefix(node.Parent, user.BasePath)`. Because this function is not path-separator aware, a user with a `BasePath` restricted to `/base` will successfully pass the authorization check for a completely separate directory named `/base2` (since \"/base2\" starts with \"/base\").\n\n2. **Unfiltered Total Count Leakage:** The `bleve` backend (`internal/search/bleve/search.go`) searches the index globally and ignores the `req.Parent` boundary. Even if the application later successfully filters out unauthorized items from the `Content` array (e.g., via `CanAccess` meta password checks), it still returns the raw `Total` count provided by the search backend. This allows an attacker to perform blind data-enumeration, confirming the existence of sensitive files outside their namespace by observing the `Total` count.\n\n### PoC\n**Prerequisites:**\n1. Log in as an administrator and set the Search Index Mode to `bleve`. Build the index.\n2. Create two directories at the root level: `/base` and `/base2`.\n3. Upload a sensitive file into the unauthorized directory: `/base2/secret_financial_report.pdf`.\n4. Create a low-privileged test user and strictly set their `Base path` to `/base`.\n\n**Exploitation Steps:**\n1. Authenticate as the newly created low-privileged user.\n2. Send the following HTTP request to the search API:\n```http\nPOST /api/fs/search HTTP/1.1\nHost: \u003cyour-openlist-host\u003e\nAuthorization: \u003ctest-user-token\u003e\nContent-Type: application/json\n\n{\n \"parent\": \"/\",\n \"keywords\": \"secret\",\n \"page\": 1,\n \"per_page\": 20,\n \"scope\": 0\n}\n```\n3. Observe the response: Due to the prefix bypass (`strings.HasPrefix(\"/base2\", \"/base\") == true`), the metadata for `secret_financial_report.pdf` will be leaked in the response Content.\n - Alternatively, even if access is further blocked by folder-level passwords, the Total field will return \u003e 0, allowing the attacker to blindly confirm the existence of the keyword \"secret\" in unauthorized global directories.\n \n\u003cimg width=\"2112\" height=\"1381\" alt=\"image\" src=\"https://github.com/user-attachments/assets/9f8c5e18-8744-4363-8d3f-5e6cf691f061\" /\u003e\n\n### Impact\nThis is an Information Disclosure and Horizontal/Vertical Privilege Escalation vulnerability. Any authenticated user can enumerate hidden infrastructure, verify the existence of sensitive files (e.g., passwords, internal documents), and extract file metadata across the entire storage namespace, completely defeating the BasePath isolation mechanism.\n\n### Remediation Recommendations\n1. Separator-Aware Path Containment: Replace strings.HasPrefix with a robust path containment check. For example: target == base || strings.HasPrefix(target, base + \"/\"), or use a dedicated utility like utils.IsSubPath().\n2. Backend-Level Filtering: Enforce the path boundary within the bleve query itself (e.g., using indexed parent path hashes) rather than relying solely on post-query API filtering.\n3. Accurate Total Calculation: Compute the Total count only after all authorization and path filters have been applied to the result set.",
"id": "GHSA-p6ph-3jx2-3337",
"modified": "2026-07-24T22:32:17Z",
"published": "2026-07-24T22:32:17Z",
"references": [
{
"type": "WEB",
"url": "https://github.com/OpenListTeam/OpenList/security/advisories/GHSA-p6ph-3jx2-3337"
},
{
"type": "WEB",
"url": "https://github.com/OpenListTeam/OpenList/commit/59bd3431408578f420895457554700cc9a52375a"
},
{
"type": "WEB",
"url": "https://github.com/OpenListTeam/OpenList/commit/84ecda35aae2bd0020474086e6ddfd3aa2340679"
},
{
"type": "PACKAGE",
"url": "https://github.com/OpenListTeam/OpenList"
},
{
"type": "WEB",
"url": "https://github.com/OpenListTeam/OpenList/releases/tag/v4.2.4"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:L/I:N/A:N",
"type": "CVSS_V3"
}
],
"summary": "OpenList: Search metadata/count disclosure via Non-Separator-Aware Path Check in Bleve Search"
}
Sightings
| Author | Source | Type | Date | Other |
|---|
Nomenclature
- Seen: The vulnerability was mentioned, discussed, or observed by the user.
- Confirmed: The vulnerability has been validated from an analyst's perspective.
- Published Proof of Concept: A public proof of concept is available for this vulnerability.
- Exploited: The vulnerability was observed as exploited by the user who reported the sighting.
- Patched: The vulnerability was observed as successfully patched by the user who reported the sighting.
- Not exploited: The vulnerability was not observed as exploited by the user who reported the sighting.
- Not confirmed: The user expressed doubt about the validity of the vulnerability.
- Not patched: The vulnerability was not observed as successfully patched by the user who reported the sighting.