fix: potential file inclusion via variable

This commit is contained in:
lilong.129
2025-04-28 21:09:39 +08:00
parent 7132eec39e
commit da5042f0a4
6 changed files with 7 additions and 7 deletions

View File

@@ -95,7 +95,7 @@ func (s *Summary) GenHTMLReport() error {
}
reportPath := filepath.Join(reportsDir, "report.html")
file, err := os.OpenFile(reportPath, os.O_WRONLY|os.O_CREATE, 0o666)
file, err := os.OpenFile(reportPath, os.O_WRONLY|os.O_CREATE, 0o600)
if err != nil {
log.Error().Err(err).Msg("open file failed")
return err