Skip to content

Potential fix for code scanning alert no. 1: Clear-text logging of sensitive information#54

Merged
ilyabrin merged 1 commit into
releasefrom
alert-autofix-1
Jul 28, 2025
Merged

Potential fix for code scanning alert no. 1: Clear-text logging of sensitive information#54
ilyabrin merged 1 commit into
releasefrom
alert-autofix-1

Conversation

@ilyabrin
Copy link
Copy Markdown
Owner

Potential fix for https://github.com/ilyabrin/disk/security/code-scanning/1

To fix the issue, we need to ensure that sensitive information in HTTP headers is sanitized before being logged. The SanitizeValue method already exists and can be leveraged for this purpose. Specifically, we need to modify the LogRequest method in logger.go to sanitize header values before passing them to the Debug logging call. Additionally, we should verify that all sensitive data passed to logging calls is sanitized consistently across the codebase.

Steps to implement the fix:

  1. Update the LogRequest method in logger.go to ensure all header values are sanitized using the SanitizeValue method.
  2. Ensure that the Debug logging call in LogRequest uses sanitized values.
  3. Verify that other logging methods (e.g., LogResponse, LogError) do not log sensitive information unencrypted.

Suggested fixes powered by Copilot Autofix. Review carefully before merging.

…nsitive information

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
@ilyabrin ilyabrin marked this pull request as ready for review July 28, 2025 19:11
@ilyabrin
Copy link
Copy Markdown
Owner Author

LGTM 👍

@ilyabrin ilyabrin merged commit 3d2439f into release Jul 28, 2025
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant