Add guarded MCP file transfer and complete diagnostic access
CI / verify (push) Canceled after 0s

This commit is contained in:
Sucukdeluxe committed 2026-10-15 17:31:34 +02:00
1 parent d5022d2d59
commit cd2394dd22
19 files changed
+1757 -32

No files matched your search

+2
View File
@@ -53,6 +53,8 @@ async function resolveGrantedFile(grants, rootId, relativePath, options = {}) {
if (typeof relativePath !== 'string' || relativePath.includes('\0') || path.isAbsolute(relativePath)
|| /(?:^|[\\/])\.\.(?:[\\/]|$)|:/.test(relativePath)) throw new McpAccessError('PATH_NOT_GRANTED');
const realRoot = await fs.realpath(grant.path);
const expectedRoot = path.resolve(grant.path);
if (process.platform === 'win32' ? realRoot.toLowerCase() !== expectedRoot.toLowerCase() : realRoot !== expectedRoot) throw new McpAccessError('PATH_NOT_GRANTED');
const target = path.resolve(realRoot, relativePath || '.');
if (!within(realRoot, target)) throw new McpAccessError('PATH_NOT_GRANTED');
const realTarget = await fs.realpath(target);