MCPcopy
hub / github.com/codeaashu/claude-code / containsPathTraversal

Function containsPathTraversal

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

Source from the content-addressed store, hash-verified

131 * @returns true if the path contains traversal (e.g., '../', '..\', or ends with '..')
132 */
133export function containsPathTraversal(path: string): boolean {
134 return /(?:^|[\\/])\.\.(?:[\\/]|$)/.test(path)
135}
136
137// Re-export from the shared zero-dep source.
138export { sanitizePath } from './sessionStoragePortable.js'

Callers 5

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