MCPcopy Index your code
hub / github.com/codeaashu/claude-code / isTeamMemPath

Function isTeamMemPath

src/memdir/teamMemPaths.ts:214–220  ·  view source on GitHub ↗
(filePath: string)

Source from the content-addressed store, hash-verified

212 * or validateTeamMemKey() which include symlink resolution.
213 */
214export function isTeamMemPath(filePath: string): boolean {
215 // SECURITY: resolve() converts to absolute and eliminates .. segments,
216 // preventing path traversal attacks (e.g. "team/../../etc/passwd")
217 const resolvedPath = resolve(filePath)
218 const teamDir = getTeamMemPath()
219 return resolvedPath.startsWith(teamDir)
220}
221
222/**
223 * Validate that an absolute file path is safe for writing to the team memory directory.

Callers 2

checkTeamMemSecretsFunction · 0.85
isTeamMemFileFunction · 0.85

Calls 2

getTeamMemPathFunction · 0.85
resolveFunction · 0.50

Tested by

no test coverage detected