se2024-jpg / WolfTrack6.0

A personal job-tracker application
MIT License
0 stars 1 forks source link

Fix code scanning alert no. 11: Information exposure through an exception #22

Closed joeljogy closed 1 month ago

joeljogy commented 1 month ago

Fixes https://github.com/se2024-jpg/WolfTrack6.0/security/code-scanning/11

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

  1. Import the logging module to enable logging of error messages.
  2. Replace the detailed error messages returned to the user with a generic message.
  3. Log the detailed error messages on the server for debugging purposes.

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

codecov[bot] commented 1 month ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark: