mirror of
https://github.com/JezzWTF/vibepod.git
synced 2026-06-01 15:22:14 +00:00
🔒 security: fix unhandled exception details exposure
Replace detailed exception strings with generic error messages in the health and generate endpoints to prevent information leakage. Internal logs still contain full exception details for debugging. Co-authored-by: LyAhn <27559362+LyAhn@users.noreply.github.com>
This commit is contained in:
@@ -192,7 +192,7 @@ def _load_model_sync() -> None:
|
||||
|
||||
except Exception as exc:
|
||||
_model_status = "error"
|
||||
_model_error = str(exc)
|
||||
_model_error = "Internal server error during model initialization."
|
||||
logger.exception("Failed to initialise model: %s", exc)
|
||||
|
||||
|
||||
@@ -355,7 +355,7 @@ async def generate(req: GenerateRequest, request: Request) -> StreamingResponse:
|
||||
return
|
||||
except Exception as exc:
|
||||
logger.exception("Generation failed: %s", exc)
|
||||
yield _sse({"type": "error", "message": str(exc)})
|
||||
yield _sse({"type": "error", "message": "Internal server error during generation."})
|
||||
return
|
||||
|
||||
elapsed = round(time.monotonic() - start, 1)
|
||||
|
||||
Reference in New Issue
Block a user