Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 0 additions & 6 deletions .helm-repositories.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,24 +7,18 @@ repositories:
keyFile: ''
name: bitnami
pass_credentials_all: false
password: ''
url: https://charts.bitnami.com/bitnami
username: ''
- caFile: ''
certFile: ''
insecure_skip_tls_verify: false
keyFile: ''
name: chainlink-qa
pass_credentials_all: false
password: ''
url: https://raw.githubusercontent.com/smartcontractkit/qa-charts/gh-pages/
username: ''
- caFile: ''
certFile: ''
insecure_skip_tls_verify: false
keyFile: ''
name: grafana
pass_credentials_all: false
password: ''
url: https://grafana.github.io/helm-charts
username: ''
12 changes: 10 additions & 2 deletions ops/localenv/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,14 @@ func main() {
}
}

// sanitizeForOutput escapes newlines/carriage returns to prevent log injection (CWE-117).
func sanitizeForOutput(s string) string {
s = strings.ReplaceAll(s, "\\", "\\\\")
s = strings.ReplaceAll(s, "\r", "\\r")
s = strings.ReplaceAll(s, "\n", "\\n")
return s
}

func setEnvIfNotExists(key, defaultValue string) {
value := os.Getenv(key)
if value == "" {
Expand Down Expand Up @@ -98,7 +106,7 @@ func run(name string, f string, args ...string) {
wg.Done()
break
}
fmt.Print(string(p[:n]))
fmt.Print(sanitizeForOutput(string(p[:n])))
}
}()
go func() {
Expand All @@ -109,7 +117,7 @@ func run(name string, f string, args ...string) {
wg.Done()
break
}
fmt.Print(string(p[:n]))
fmt.Print(sanitizeForOutput(string(p[:n])))
}
}()

Expand Down
Loading