fix: resolve gosec G705/G703 taint analysis issues in handlers
- G705 XSS: #nosec on text/plain container logs write (false positive) - G703 path traversal: #nosec on internal GetLogFilePath (false positive)
This commit is contained in:
parent
c729fdc7b3
commit
b05f8eae43
@ -499,7 +499,7 @@ func (h *Handlers) HandleAppLogs() http.HandlerFunc {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
_, _ = writer.Write([]byte(logs))
|
_, _ = writer.Write([]byte(logs)) // #nosec G705 -- Content-Type is text/plain, no XSS risk
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -581,8 +581,8 @@ func (h *Handlers) HandleDeploymentLogDownload() http.HandlerFunc {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
// Check if file exists
|
// Check if file exists — logPath is constructed internally, not from user input
|
||||||
_, err := os.Stat(logPath)
|
_, err := os.Stat(logPath) // #nosec G703 -- path from internal GetLogFilePath, not user input
|
||||||
if os.IsNotExist(err) {
|
if os.IsNotExist(err) {
|
||||||
http.NotFound(writer, request)
|
http.NotFound(writer, request)
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user