Function: containsPathTraversal()
containsPathTraversal(Defined in: validators.ts:348 Detect path-traversal payloads —input):ThreatFinding[]
../, 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".