vetkit.csharp.path-traversal.tainted-file-path
A file system path is built from request input (or an uploaded file's client-supplied name). Sequences such as ../ or an absolute path let an attacker read, overwrite or delete files outside the intended directory.
Last updated:
Suite: Security
csharp
A file system path is built from request input (or an uploaded file's client-supplied name). Sequences such as ../ or an absolute path let an attacker read, overwrite or delete files outside the intended directory.
Category: SECURITY · Engine rule severity: WARNING
How to fix it
Reduce the input to a bare file name with Path.GetFileName, or resolve the full path with Path.GetFullPath and verify it starts with the base directory. Note that Path.Combine discards the base when the second argument is rooted. Generate server-side names for uploads.
References
Source: packages/engine/rules/sast/csharp.yml.
Generated from shipped rule definitions at build time. Matching is a review signal, not proof of exploitability. “generic” denotes text matching, not complete language or framework coverage. Runtime configuration and available tools affect whether a rule runs.