fix(config): Ignore config files with double dot in it (#696) (#984)

This commit is contained in:
Victor Laborie 2025-02-03 02:37:55 +01:00 committed by GitHub
parent 41085757f9
commit 9d8928dee0
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -176,6 +176,10 @@ func LoadConfiguration(configPath string) (*Config, error) {
if err != nil {
return fmt.Errorf("error walking path %s: %w", path, err)
}
if strings.Contains(path, "..") {
logr.Warnf("[config.LoadConfiguration] Ignoring configuration from %s", path)
return nil
}
logr.Infof("[config.LoadConfiguration] Reading configuration from %s", path)
data, err := os.ReadFile(path)
if err != nil {