π‘οΈ Sentinel: [CRITICAL] Fix Information Leakage in API Routes - #164
π‘οΈ Sentinel: [CRITICAL] Fix Information Leakage in API Routes#164fysp11 wants to merge 1 commit into
Conversation
Updated multiple API routes to prevent sensitive backend error details (e.g. error messages, fetch response bodies) from being sent to the client. Now logging detailed errors server-side and responding with generic 500/502 JSON payloads. 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: Information Leakage in API Routes. Multiple API route handlers (
ai-chat.ts,ai-image.ts,google-chat.ts,tts.ts) were directly returning internal error messages ((err as Error).message) or full HTTP response bodies to clients during failure states.π― Impact: Attackers could potentially gather sensitive architectural details, stack traces, internal paths, or API configuration parameters from unhandled exceptions.
π§ Fix: Updated catch blocks and error handling paths to log detailed errors server-side (using
console.error) and respond to the client with generic error objects (e.g.,{ error: "Internal error" }).β Verification: Ran
pnpm run checkand verified successful build without regressions.PR created automatically by Jules for task 6959390533454355398 started by @fysp11