| عنوان | alioshr memory-bank-mcp 0.2.1 Directory Enumeration |
|---|
| الوصف | A vulnerability was found in alioshr/memory-bank-mcp. The issue affects the MCP tool list_project_files and the parameter projectName.
The list_project_files tool accepts caller-controlled ../ path segments in the projectName argument. The tool then passes projectName into the filesystem listing path without applying the same project-isolation validation used by sibling tools such as read, write, and update. As a result, an MCP client that can invoke list_project_files can enumerate directory entries outside the configured MEMORY_BANK_ROOT.
The root cause is that list-project-files-validation-factory.ts attaches no validators, while the sibling validation factories for read, write, and update attach PathSecurityValidator to projectName. With no validator in place, projectName flows through ListProjectFilesController to FsFileRepository.listFiles(projectName), where path.join(rootDir, projectName) resolves ../ segments and fs.readdir returns entries outside the intended memory-bank root.
The confirmed impact is directory enumeration and project-isolation bypass. This report does not claim arbitrary file read or arbitrary file write. In the public reproduction, a payload such as projectName="../../mb_repro_victim" caused the server to list filenames from a directory outside MEMORY_BANK_ROOT, including private_key.pem and secret_credentials.txt.
Affected component: src/main/factories/controllers/list-project-files/list-project-files-validation-factory.ts
Affected filesystem path: FsFileRepository.listFiles
Affected tool: list_project_files
Affected parameter: projectName
CWE: CWE-22 / CWE-200
CVSS v3.1: CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:L/I:N/A:N
Suggested severity: Low to Medium
Suggested remediation: attach PathSecurityValidator to projectName in list-project-files-validation-factory.ts, matching the validation pattern already used by read, write, and update. As defense in depth, also enforce canonical path containment in FsFileRepository.listFiles by resolving the requested path and rejecting any path that escapes MEMORY_BANK_ROOT. |
|---|
| المصدر | ⚠️ https://github.com/alioshr/memory-bank-mcp/issues/36 |
|---|
| المستخدم | Mcfly_Zhang (UID 98877) |
|---|
| ارسال | 10/06/2026 02:19 AM (1 شهر منذ) |
|---|
| الاعتدال | 12/07/2026 02:04 PM (1 month later) |
|---|
| الحالة | تمت الموافقة |
|---|
| إدخال VulDB | 377853 [alioshr memory-bank-mcp حتى 0.2.1/3.1 list-project-files-validation-factory.ts projectName اجتياز الدليل] |
|---|
| النقاط | 20 |
|---|