Commit 577cd27
`resolveErrorResponse` — the value side of `sendError`, and therefore the error
path of every metadata / UI / discovery / batch route — passed an explicit
status straight through for the whole 400-599 band. A declared 5xx returned
`error.message` verbatim, past `isSqlLeak`, past `looksLikeInternalErrorLeak`,
past the `Internal data error` envelope, while `mapDataError`'s sibling branch
stops at 4xx on purpose and says why: "5xx messages keep going through the
sanitizing heuristics below so internal/SQL details never reach the client
verbatim". Two opposite verdicts on one question.
`metadata-protocol` interpolates the raw driver error into two client-facing
500s (overlay persist / delete), and a real driver line is far shorter than the
500-character bound that was the only thing standing here, so the whole thing
arrived intact. Length was never a proxy for leakage; on this side of the bound
it failed open.
The 5xx band now drops the message unconditionally and keeps the producer's
status and `code`. Unconditional rather than heuristic: a keyword gate only
moves the question to "does the predicate know this dialect". Sanitised in the
branch rather than by falling through to `mapDataError`, which derives status
from message TEXT — measured first, and it answers 404 OBJECT_NOT_FOUND for the
overlay 500s, 404 "Object '<name>' is not registered" for the atomic batch's
501, and 400 with the driver text still verbatim for anything its keywords miss.
The withheld text still reaches the log: `handleRouteError` already prints a
genuine fault, and a new line covers the 502/503 gap its predicate leaves.
4xx truncation (#5423 / #5436) is untouched.
Claude-Session: https://claude.ai/code/session_016FNvXhtSdnEGEfLEsMmvxh
Co-authored-by: Claude <noreply@anthropic.com>
1 parent ef19b94 commit 577cd27
4 files changed
Lines changed: 659 additions & 28 deletions
File tree
- .changeset
- packages/rest/src
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
29 | 29 | | |
30 | 30 | | |
31 | 31 | | |
| 32 | + | |
32 | 33 | | |
33 | 34 | | |
34 | 35 | | |
| |||
288 | 289 | | |
289 | 290 | | |
290 | 291 | | |
291 | | - | |
292 | | - | |
293 | | - | |
294 | | - | |
295 | | - | |
296 | | - | |
297 | | - | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
298 | 303 | | |
299 | 304 | | |
300 | 305 | | |
| |||
305 | 310 | | |
306 | 311 | | |
307 | 312 | | |
308 | | - | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
309 | 319 | | |
310 | 320 | | |
0 commit comments