UUID path params not validated — every /:id route returns 500 with PG error on bad input #102
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. NewvalidateUuidmiddleware inmiddleware/errors.js. Every router with/:id(assets, recorders, projects, bins, jobs, schedules, sequences) now installsrouter.param('id', validateUuid('id')), returning a clean 400 instead of bouncing into Postgres with a 22P02.zgaetano referenced this issue2026-05-26 18:22:49 -04:00
Fix Plan — #102 UUID path params not validated → 500 on bad input
Root cause: No
/:id,/:assetId,/:jobId,/:projectIdroute validates UUID format before PG query. PG throws22P02, error handler leaks message → 500.Fix — drop-in middleware (
src/middleware/validate.js):Apply globally in
src/index.js:Files:
src/middleware/validate.js(new),src/index.jsEffort: ~30min
**Priority: P0 — input validation