Skip to content

Conversation

@GitTimeraider
Copy link
Owner

Potential fix for https://github.com/GitTimeraider/Directadmin-Emailforwarder/security/code-scanning/7

To fix the problem, we should avoid returning the raw exception message from DirectAdminAPI.delete_forwarder to the client. Instead, we should return a generic error message for the client, while logging the actual exception details on the server for debugging purposes. This involves modifying the delete_forwarder method in app/directadmin_api.py so that, in the event of an exception, it returns a generic error message (e.g., "An error occurred while deleting the forwarder") instead of str(e). The actual exception should be logged using print or a logging framework. No changes are needed in app/main.py since it already returns a generic error message in the outer exception handler.


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

…ough an exception

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
@GitTimeraider GitTimeraider marked this pull request as ready for review August 5, 2025 10:40
@GitTimeraider GitTimeraider merged commit 9cb899e into main Aug 5, 2025
3 of 4 checks passed
@GitTimeraider GitTimeraider deleted the alert-autofix-7 branch August 5, 2025 14:32
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.

2 participants