Skip to content

Potential fix for code scanning alert no. 10: Information exposure through an exception#17

Merged
Rootless-Ghost merged 1 commit intomainfrom
alert-autofix-111
Mar 22, 2026
Merged

Potential fix for code scanning alert no. 10: Information exposure through an exception#17
Rootless-Ghost merged 1 commit intomainfrom
alert-autofix-111

Conversation

@Rootless-Ghost
Copy link
Owner

Potential fix for https://github.com/Rootless-Ghost/SigmaForge/security/code-scanning/10

To fix the problem, the exception details should be logged server-side and replaced with a generic error message in the HTTP response. This prevents potential exposure of internal file paths, rule-directory layouts, or other environment details to an external caller, while retaining sufficient information in logs for debugging.

Concretely, in app.py within api_list_rules, replace the except block that directly returns str(e) with one that uses logging.exception to log the full traceback and returns a generic error message similar to the other API endpoints (api_validate, api_convert, api_save_rule, etc.). No behavioral change is introduced for successful requests; only the error payload content is made less specific. The file already imports logging at the top, so no new imports are needed. Only the except block at lines 251–252 needs to be edited.

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

…rough an exception

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
@Rootless-Ghost Rootless-Ghost marked this pull request as ready for review March 22, 2026 08:52
@Rootless-Ghost Rootless-Ghost merged commit 9135c19 into main Mar 22, 2026
6 checks passed
@Rootless-Ghost Rootless-Ghost deleted the alert-autofix-111 branch March 22, 2026 08:52
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