Changelog - 2026-11-06
The error response redacts extra and carries none for server errors in production
Security Behavior Change Bug FixIn one line. The extra of an error response goes through the same redaction as the log line, and a server error (5xx) in production carries no extra.
What changed
- Redacted.
extrais whatever a throw site attached to the error. The log line already masked secret-shaped keys in it; the response now does the same, and in production it masks whateverAPP_ENV_LOGGER_DO_REDACTsays. - Only the correlation ids for a 5xx in production.
requestIdandupstreamRequestIdsstay (short strings only), because support needs them; everything else is dropped. The log has the context; a client has no use for it. A client error (4xx) keeps itsextra, masked, because validation and conflict details are meant for the caller. Outside production every status keeps it, masked. - Also in the response. A nested error in
extracarries nostackin production, theargsof the message template are masked by key name in production, andRedactUtilitynames a function ([Function]) instead of carrying it, so atoJSONon a plain object cannot add keys after the redaction. - No more degraded status. A cycle in
extraused to make the response fail and fall back to a plain 500; it now reads[Circular]and a BigInt becomes text, so the status the throw site chose is the status the client gets.
Who is affected
- Apps that read
extrafrom a 5xx response in production. There is none now; read the log, or put what the client needs in the message or a 4xx. - Apps that read
extrafrom a 4xx. Values under secret-shaped keys (password,token,apiKey,dsn, ...) read[REDACTED]. - Everyone else. No action needed.
Details
| File | Package |
|---|---|
src/base/middlewares/app-error/app-error.middleware.ts | kernel |