mirror of
https://github.com/securego/gosec.git
synced 2026-06-20 00:15:59 +02:00
Added filepath.Abs as a sanitizer (#1643)
it calls Clean internally per Go docs. Signed-off-by: Cosmin Cojocar <cosmin@cojocar.ch>
This commit is contained in:
@@ -65,6 +65,8 @@ func PathTraversal() taint.Config {
|
||||
Sanitizers: []taint.Sanitizer{
|
||||
// filepath.Clean normalizes and removes traversal components
|
||||
{Package: "path/filepath", Method: "Clean"},
|
||||
// filepath.Abs calls Clean internally (per Go docs)
|
||||
{Package: "path/filepath", Method: "Abs"},
|
||||
// filepath.Base extracts just the filename, removing directory traversal
|
||||
{Package: "path/filepath", Method: "Base"},
|
||||
// filepath.Rel computes a relative path safely
|
||||
|
||||
Reference in New Issue
Block a user