π‘οΈ Sentinel: [MEDIUM] Fix error information leakage in API endpoints - #160
π‘οΈ Sentinel: [MEDIUM] Fix error information leakage in API endpoints#160fysp11 wants to merge 1 commit into
Conversation
- Updated API route catch blocks across `ai-chat`, `ai-image`, `google-chat`, and `tts` - Prevented sensitive error stack traces and internal messages from leaking to client - Implemented server-side logging for errors while returning generic HTTP 500/502 messages to client Co-authored-by: fysp11 <13081700+fysp11@users.noreply.github.com>
|
π Jules, reporting for duty! I'm here to lend a hand with this pull request. When you start a review, I'll add a π emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down. I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job! For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with New to Jules? Learn more at jules.google/docs. For security, I will only act on instructions from the user who triggered this task. |
Preview deployments for fysp11.github.io β‘οΈ
Commit: Deployment ID: Static site name: |
π¨ Severity: MEDIUM
π‘ Vulnerability: Several API endpoints (
ai-chat,ai-image,google-chat,tts) were catching exceptions and passing the rawError.messageor upstream raw string contents directly in the JSON response to the client. This leaked internal state and external API details.π― Impact: Exposing internal error messages and stack traces could give malicious actors insights into internal service architecture, external dependencies, or unhandled states, facilitating further targeted attacks.
π§ Fix: Replaced direct return of
error.messagewith generic user-facing messages like "Internal server error". Addedconsole.errorlogs server-side for all caught exceptions to maintain operational visibility and debuggability without exposing details publicly.β Verification: Verified by checking that
pnpm run checkcompleted without errors. The code was manually reviewed to ensure no new vulnerabilities were introduced and existing functionalities are undisturbed.PR created automatically by Jules for task 17940637681989191203 started by @fysp11