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. 22: Information exposure through an exception #520

Merged
merged 1 commit into from
Oct 19, 2024

Conversation

TreyWW
Copy link
Owner

@TreyWW TreyWW commented Oct 19, 2024

Fixes https://github.com/TreyWW/MyFinances/security/code-scanning/22

To fix the problem, we need to ensure that detailed error messages are not exposed to the end user. Instead, we should log the detailed error message on the server and return a generic error message to the user. This can be achieved by modifying the exception handling block to log the error and return a generic message.

Steps to fix:

  1. Import the logging module to enable logging of error messages.
  2. Replace the line that returns the detailed error message with a line that logs the error and returns a generic error message.

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>
Copy link
Contributor

Dependency Review

✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.

OpenSSF Scorecard

PackageVersionScoreDetails

Scanned Manifest Files

@TreyWW TreyWW marked this pull request as ready for review October 19, 2024 20:11
@TreyWW TreyWW merged commit a13ffa6 into main Oct 19, 2024
9 checks passed
@TreyWW TreyWW deleted the alert-autofix-22 branch October 19, 2024 20:11
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