Skip to content

Sanitize serialized worker errors#819

Open
TsuyoshiUshio wants to merge 3 commits into
v3.xfrom
fix/sanitize-node-error-serialization
Open

Sanitize serialized worker errors#819
TsuyoshiUshio wants to merge 3 commits into
v3.xfrom
fix/sanitize-node-error-serialization

Conversation

@TsuyoshiUshio
Copy link
Copy Markdown
Contributor

Summary

  • add credential-aware sanitization when serializing non-Error thrown values
  • redact credential-like property names and known credential tokens while preserving useful object context
  • sanitize worker exception messages and stack traces before sending invocation failures to the host
  • handle circular references in thrown objects without throwing during error conversion

Notes

This is a first implementation intended to support review and discussion. The sanitizer follows the same broad approach as azure-functions-host by redacting obvious credential names/tokens, while preserving non-secret diagnostic context.

Related library PR will apply the same serialization behavior in @azure/functions.

Validation

  • npm test (148 passing, 8 pending)
  • npm run lint

Redact credential-like properties and known credential tokens when serializing non-Error values, and sanitize worker exception messages before sending them to the host.

Co-authored-by: Dobby <dobby@microsoft.com>
@TsuyoshiUshio TsuyoshiUshio requested a review from a team as a code owner May 19, 2026 21:18
Comment thread src/errors.ts
Comment thread src/errors.ts
Comment thread src/errors.ts Outdated
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants