-
Notifications
You must be signed in to change notification settings - Fork 10
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
WIP egress type validation #1989
base: main
Are you sure you want to change the base?
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
} | ||
|
||
res.setHeader("Content-Type", "application/json"); | ||
res.end(JSON.stringify(response)); |
Check warning
Code scanning / CodeQL
Information exposure through a stack trace Medium
stack trace information
Show autofix suggestion
Hide autofix suggestion
Copilot Autofix AI about 1 month ago
To fix the problem, we need to ensure that stack trace information is not exposed to the client, even in a development environment. Instead, we should log the stack trace on the server and send a generic error message to the client. This can be achieved by modifying the error handling code to exclude the stack trace from the response and only include a generic error message.
-
Copy modified line R311 -
Copy modified line R320
@@ -310,3 +310,3 @@ | ||
details: | ||
process.env.NODE_ENV === "development" ? error : undefined, | ||
process.env.NODE_ENV === "development" ? error.message : undefined, | ||
}, | ||
@@ -319,2 +319,3 @@ | ||
logToConsole(`apiHandler: Response: ${JSON.stringify(response)}`); | ||
logToConsole(`Stack trace: ${error instanceof Error ? error.stack : String(error)}`); | ||
return; |
…eUsers?limit=1' {"success":true,"data":[{"date":"2024-04-02","dailyActiveUsers":"1"}]}% ➜ test-typia git:(main) ✗ curl 'localhost:4000/consumption/dailyActiveUsers?limit=asdf' {"success":false,"error":{"code":"INTERNAL_ERROR","message":"LIMIT numeric constant expression is not representable as UInt64. "}}% ➜ test-typia git:(main) ✗
…checking-for-consumption
No description provided.