π‘οΈ Sentinel: [MEDIUM] Fix sensitive information leakage in API error responses - #183
π‘οΈ Sentinel: [MEDIUM] Fix sensitive information leakage in API error responses#183fysp11 wants to merge 1 commit into
Conversation
Updated all API endpoints to log errors to console.error internally and return only generic error messages to the client. This prevents information leakage from internal runtime errors or downstream service bodies. Co-authored-by: fysp11 <13081700+fysp11@users.noreply.github.com>
Preview deployments for fysp11.github.io β‘οΈ
Commit: Deployment ID: Static site name: |
|
π 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. |
π¨ Severity: MEDIUM
π‘ Vulnerability: API routes (
ai-chat.ts,ai-image.ts,google-chat.ts,tts.ts) were catching exceptions or failed downstream responses and returning the raw error message (err.message) or remote body text directly back to the client in JSON format. This could potentially expose internal server state, stack traces, or downstream configurations.π― Impact: Exposing internal error messages provides reconnaissance information to attackers, making it easier for them to formulate targeted attacks by understanding backend technologies and architectures.
π§ Fix: Refactored the catch blocks across all API routes to utilize secure error handling. Actual detailed errors (including downstream response bodies) are now strictly logged to
console.errorserver-side, while clients only receive generic JSON error messages like{"error": "Internal server error"}.β Verification: Verified by checking out the branch and running
pnpm run check(which handles tests, linting, and build steps) to ensure no regressions were introduced. Additionally, reviewed.jules/sentinel.mdwhich includes a journal entry on this vulnerability pattern and prevention approach.PR created automatically by Jules for task 350382826174993757 started by @fysp11