-
Notifications
You must be signed in to change notification settings - Fork 351
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feature: header encoder filter #3231
base: master
Are you sure you want to change the base?
Conversation
Signed-off-by: Sandor Szücs <[email protected]>
…ncoding/charmap Signed-off-by: Sandor Szücs <[email protected]>
Signed-off-by: Sandor Szücs <[email protected]>
|
||
sNew, err := f.encoder.String(s) | ||
if err != nil { | ||
log.Errorf("Failed to encode %q: %v", s, err) |
Check failure
Code scanning / CodeQL
Clear-text logging of sensitive information High
Sensitive data returned by HTTP request headers
Show autofix suggestion
Hide autofix suggestion
Copilot Autofix AI 3 months ago
To fix the problem, we should avoid logging the sensitive information directly. Instead, we can log a generic message indicating that an error occurred without including the sensitive data. This approach maintains the functionality of logging errors while protecting potentially sensitive information.
- Modify the log statement on line 147 to remove the sensitive data (
s
). - Log a generic error message that does not include the sensitive data.
-
Copy modified line R147
@@ -146,3 +146,3 @@ | ||
if err != nil { | ||
log.Errorf("Failed to encode %q: %v", s, err) | ||
log.Errorf("Failed to encode header value: %v", err) | ||
} |
feature: header encoder filter #3230