Skip to main content

Function: containsPathTraversal()

containsPathTraversal(input): ThreatFinding[]
Defined in: validators.ts:348 Detect path-traversal payloads — ../, encoded dots, raw absolute paths trying to escape a base directory. Pair with path.resolve()
  • a startsWith() containment check on the canonicalised path before reading or writing the file.

Parameters

input

string String to scan.

Returns

ThreatFinding[] Empty array, or one finding of type "path_traversal".