You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
To fix this problem, we should ensure that no sensitive credential data (e.g., API keys, secrets, tokens) is directly logged. Instead, log only identifying but non-sensitive information about the expired/removed API keys, such as their database IDs, associated user IDs, display names, or generic counts. Specifically, in services/web/server/src/simcore_service_webserver/garbage_collector/_tasks_api_keys.py, line 25 currently logs the variable api_key in full.
The fix involves:
Editing line 25 to avoid logging the full API key value.
Use available metadata if possible (such as a display name, if that's present in the list instead).
If only API key values are available, replace the full log with a generic message (e.g., logging just the count, or obfuscating part of the key—e.g., log a truncated or masked version).
If project context allows, logging the API key's display name or database ID is safe.
You will edit line 25 in _tasks_api_keys.py to something like:
_logger.info("Expired API key was removed")
Or, if safe and possible, log identifying metadata, e.g.:
_logger.info("API-key with display name '%s' expired and was removed", api_key.display_name)
But, as only the API key or name string is available, safest is to avoid logging the key string.
No imports or method definitions are required unless additional metadata needs fetching. Use only the shown code.
Suggested fixes powered by Copilot Autofix. Review carefully before merging.
❌ Patch coverage is 0% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 89.58%. Comparing base (3d80890) to head (faac26b).
pcrespov
changed the title
Potential fix for code scanning alert no. 95: Clear-text logging of sensitive information
🔒️ Potential fix for code scanning alert no. 95: Clear-text logging of sensitive information
Oct 3, 2025
a:webserverwebserver's codebase. Assigning the area is particularly useful for bugssecurityPull requests that address a security vulnerability
4 participants
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Potential fix for https://github.com/ITISFoundation/osparc-simcore/security/code-scanning/95
To fix this problem, we should ensure that no sensitive credential data (e.g., API keys, secrets, tokens) is directly logged. Instead, log only identifying but non-sensitive information about the expired/removed API keys, such as their database IDs, associated user IDs, display names, or generic counts. Specifically, in
services/web/server/src/simcore_service_webserver/garbage_collector/_tasks_api_keys.py, line 25 currently logs the variableapi_keyin full.The fix involves:
You will edit line 25 in
_tasks_api_keys.pyto something like:Or, if safe and possible, log identifying metadata, e.g.:
But, as only the API key or name string is available, safest is to avoid logging the key string.
No imports or method definitions are required unless additional metadata needs fetching. Use only the shown code.
Suggested fixes powered by Copilot Autofix. Review carefully before merging.