Skip to content

Conversation

@GitTimeraider
Copy link
Owner

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

To fix the problem, we should ensure that exception details are not sent to the user in API responses. Instead, return a generic error message and log the actual exception details on the server for debugging. Specifically, in DirectAdminAPI.create_forwarder, change the return value in the exception handler from False, str(e) to False, "An error occurred while creating the forwarder". The detailed exception should still be logged server-side. No changes are needed in app/main.py since it already returns a generic error message in the outer exception handler, but the error returned from create_forwarder should also be generic.


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 11:00
@GitTimeraider GitTimeraider merged commit eaf3a26 into main Aug 5, 2025
4 of 5 checks passed
@GitTimeraider GitTimeraider deleted the alert-autofix-4 branch August 5, 2025 14:04
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