MCPcopy Create free account
hub / github.com/Noumena-Network/code / isSessionMemoryPath

Function isSessionMemoryPath

src/utils/permissions/filesystem.ts:284–288  ·  view source on GitHub ↗
(absolutePath: string)

Source from the content-addressed store, hash-verified

282
283// Check if file is within the session memory directory
284function isSessionMemoryPath(absolutePath: string): boolean {
285 // SECURITY: Normalize to prevent path traversal bypasses via .. segments
286 const normalizedPath = normalize(absolutePath)
287 return normalizedPath.startsWith(getSessionMemoryDir())
288}
289
290/**
291 * Check if file is within the current project's directory.

Callers 1

Calls 2

getSessionMemoryDirFunction · 0.85
normalizeFunction · 0.50

Tested by

no test coverage detected