Skip to content

fix: prevent exception message exposure via unauthenticated /api/settings endpoint - #103

Merged
dvir001 merged 4 commits into
mainfrom
copilot/fix-code-scanning-alerts
Aug 17, 2026
Merged

fix: prevent exception message exposure via unauthenticated /api/settings endpoint#103
dvir001 merged 4 commits into
mainfrom
copilot/fix-code-scanning-alerts

Conversation

Copilot AI commented Aug 17, 2026

Copy link
Copy Markdown
Contributor

GET /api/settings requires no authentication and returns dataUpdateStatus, which included raw exception messages (str(e)) from failed data sync runs. This leaked internal details (file paths, API responses, etc.) to any external user.

Changes

  • data_update.py — In run_data_update, log the full exception server-side first, then assign a generic string to error_message instead of str(e). This generic message is what propagates into the status dict, persisted to disk, and ultimately returned to clients.
# Before
error_message = str(e)
logger.error(f"Error updating employee data: {e}")

# After
logger.error(f"Error updating employee data: {e}")
error_message = 'Data update failed due to an internal error.'

Full exception detail is preserved in server logs; only the opaque message reaches the HTTP response.

@dvir001
dvir001 marked this pull request as ready for review August 17, 2026 10:24
Copilot AI lite review requested due to automatic review settings August 17, 2026 10:24

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot wasn't able to review any files in this pull request.


💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

…#61)

Co-authored-by: dvir001 <39403717+dvir001@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix code scanning alerts flagged in repository fix: prevent exception message exposure via unauthenticated /api/settings endpoint Aug 17, 2026
Copilot AI requested a review from dvir001 August 17, 2026 10:25
@dvir001
dvir001 merged commit 812307b into main Aug 17, 2026
6 checks passed
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.

3 participants