MCPcopy Create free account
hub / github.com/claude-code-best/claude-code / containsPathTraversal

Function containsPathTraversal

src/utils/path.ts:158–160  ·  view source on GitHub ↗
(path: string)

Source from the content-addressed store, hash-verified

156 * @returns true if the path contains traversal (e.g., '../', '..\', or ends with '..')
157 */
158export function containsPathTraversal(path: string): boolean {
159 return /(?:^|[\\/])\.\.(?:[\\/]|$)/.test(path)
160}
161
162// Re-export from the shared zero-dep source.
163export { sanitizePath } from './sessionStoragePortable.js'

Callers 6

path.test.tsFile · 0.90
validatePathFunction · 0.85
symlinkDirectoriesFunction · 0.85
pathInWorkingPathFunction · 0.85
validateGlobPatternFunction · 0.85
isPathSafeFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected