Error handler leaks raw Postgres error messages (schema/column/UUID syntax) to clients #101
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Fixed in
04ce096.errorHandlernow classifies Postgres SQLSTATE codes (22P02, 23502, 23503, 23505, 42703, 42P01, 42601) and returns a generic message + the SQLSTATE code with the right HTTP status, never the rawerr.message. 5xx responses are stable shape:{"error":"Internal Server Error","status":500}. 4xx still carry operator-authored messages. Full error always logged server-side.zgaetano referenced this issue2026-05-26 18:22:49 -04:00
Fix Plan — #101 Error handler leaks raw Postgres messages
Root cause:
src/middleware/errors.jsreturnserr.messageverbatim. PG errors expose schema names, column names, SQL state codes, parser positions.Fix —
src/middleware/errors.js:Also fix direct
err.messagereturns insdk.js:138andassets.js:586.Files:
src/middleware/errors.js,src/routes/sdk.js:138,src/routes/assets.js:586Effort: ~1h
**Priority: P0 — security/info leak