fix(api): redact sensitive headers from webhook delivery records#3988
Merged
mmabrouk merged 1 commit intofix/shady-webhooksfrom Mar 13, 2026
Merged
Conversation
Authorization tokens and HMAC signatures were being stored in plaintext in the delivery data.headers field, which is persisted to the database and returned via the delivery query API. Delivery records are audit logs — they should never contain secrets. The actual HTTP request still uses the full unredacted headers; only the stored copy is sanitized.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
jp-agenta
approved these changes
Mar 13, 2026
Contributor
Railway Preview Environment
Updated at 2026-03-13T15:40:14.224Z |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Authorizationtokens andX-Agenta-SignatureHMAC values in plaintext in thedata.headersJSON column_redact_headers()step that replaces sensitive header values with[REDACTED]before the delivery is stored in the databaseDetails
When
auth_mode=authorization, the decrypted signing secret was stored verbatim indata.headers.Authorization. Whenauth_mode=signature, the HMAC signature was stored indata.headers.X-Agenta-Signature. Both were then returned by the delivery query API and visible in any delivery log viewer.The fix is minimal: after merging headers for the HTTP request, a redacted copy is stored in
base_data.headers(used for DB persistence), while the originalrequest_headerscontinues to be used for the actual HTTP call.