-
Notifications
You must be signed in to change notification settings - Fork 40
Feature/72 #86
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
base: master
Are you sure you want to change the base?
Feature/72 #86
Conversation
… works with implicit grant results.
…vironment file path.
…detail page tests for all token types.
| } catch(e) { | ||
| log.error("An error occurred while retrieving the claim description XML: " + e.stack); | ||
| res.status(500) | ||
| .render('error', { error: e }); |
Check warning
Code scanning / CodeQL
Information exposure through a stack trace Medium
stack trace information
Show autofix suggestion
Hide autofix suggestion
Copilot Autofix
AI 5 days ago
To fix the issue, we must prevent sensitive information (such as stack traces, file paths, or internal error details) from being included in the HTTP response sent to the client. On line 95, instead of passing the raw error object to the template renderer, we should render the error page with a generic message, e.g., "An unexpected error occurred.". All detailed error information should be logged server-side (already handled on line 93), and the client gets only a safe, generic message.
The required change is:
- In the catch block at line 92, on line 95, replace
res.render('error', { error: e });withres.status(500).render('error', { error: "An unexpected error occurred." }); - Optionally retain status code 500 to indicate a server error.
- No new imports or dependencies are needed.
-
Copy modified line R95
| @@ -92,7 +92,7 @@ | ||
| } catch(e) { | ||
| log.error("An error occurred while retrieving the claim description XML: " + e.stack); | ||
| res.status(500) | ||
| .render('error', { error: e }); | ||
| .render('error', { error: "An unexpected error occurred." }); | ||
| } | ||
| }); | ||
|
|
OAuth2 Implicit Grant + Test working.