Skip to content

Conversation

@einarwar
Copy link
Contributor

@einarwar einarwar commented Oct 1, 2025

Potential fix for https://github.com/equinor/template-fastapi-react/security/code-scanning/2

To fix this problem, we should avoid directly logging the value of config.OAUTH_WELL_KNOWN. Instead, we can log a general error message without including the potentially sensitive configuration value. This ensures attackers cannot retrieve configuration details from log files, and we maintain useful error logging for debugging.

Hence, in get_JWK_client on line 27, we should change:

logger.error(f"Failed to fetch OpenId Connect configuration for '{config.OAUTH_WELL_KNOWN}': {error}")

to something like:

logger.error(f"Failed to fetch OpenId Connect configuration: {error}")

No new imports or methods are needed.


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

…of sensitive information

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
Signed-off-by: Einar Wigum Arbo <[email protected]>
@einarwar einarwar marked this pull request as ready for review October 1, 2025 10:18
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.

2 participants