-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
moneygram #81
base: develop
Are you sure you want to change the base?
moneygram #81
Conversation
de7d75f
to
af0a140
Compare
af0a140
to
7a4638b
Compare
7a4638b
to
778a70e
Compare
flow.store() | ||
except TransitionNotAllowed as e: | ||
response = Response( | ||
{"errors": [{"message": "transition_not_allowed", "code": str(e)}]}, status=HTTP_400_BAD_REQUEST |
Check warning
Code scanning / CodeQL
Information exposure through an exception Medium
Stack trace information
Show autofix suggestion
Hide autofix suggestion
Copilot Autofix AI 15 days ago
To fix the problem, we need to ensure that detailed exception information is not exposed to the end user. Instead, we should log the detailed error message on the server and return a generic error message to the client. This can be achieved by modifying the exception handling block to log the exception and return a generic error response.
- Import the
logging
module to log the exception details. - Modify the exception handling block to log the exception using the
logging
module. - Return a generic error message to the client instead of the detailed exception message.
-
Copy modified line R4 -
Copy modified line R43 -
Copy modified line R45
@@ -3,2 +3,3 @@ | ||
from viewflow.fsm import TransitionNotAllowed | ||
import logging | ||
|
||
@@ -41,4 +42,5 @@ | ||
except TransitionNotAllowed as e: | ||
logging.error("TransitionNotAllowed exception: %s", str(e)) | ||
response = Response( | ||
{"errors": [{"message": "transition_not_allowed", "code": str(e)}]}, status=HTTP_400_BAD_REQUEST | ||
{"errors": [{"message": "transition_not_allowed", "code": "error_code"}]}, status=HTTP_400_BAD_REQUEST | ||
) |
No description provided.