Skip to content
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

Fix code scanning alert no. 10: Information exposure through an exception #26

Merged
merged 1 commit into from
Dec 20, 2024

Conversation

LiamTownsley2
Copy link
Owner

Fixes https://github.com/LiamTownsley2/Security-Access/security/code-scanning/10

To fix the problem, we should avoid returning the exception message directly to the user. Instead, we should log the detailed error message on the server and return a generic error message to the user. This ensures that sensitive information is not exposed while still allowing developers to debug issues using the server logs.

  • Modify the create_user function to log the exception message and return a generic error message.
  • Add an import for the logging module to handle logging the exception.

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

…tion

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
@LiamTownsley2 LiamTownsley2 marked this pull request as ready for review December 20, 2024 18:22
@LiamTownsley2 LiamTownsley2 merged commit 65dc22a into main Dec 20, 2024
2 checks passed
@LiamTownsley2 LiamTownsley2 deleted the codeql-fix branch December 20, 2024 18:23
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