fix(sentry-apps): reject non-latin-1 webhook headers - #123263
Open
sentry-junior[bot] wants to merge 4 commits into
Open
fix(sentry-apps): reject non-latin-1 webhook headers#123263sentry-junior[bot] wants to merge 4 commits into
sentry-junior[bot] wants to merge 4 commits into
Conversation
HTTP headers must be latin-1. Custom webhook header values with characters like U+3000 previously crashed send as UnicodeEncodeError and were reported as Sentry failures. Validate headers on write (400) and halt webhook send as invalid customer config instead of recording a product failure. Co-Authored-By: Athena Moghaddam <athena.moghaddam@sentry.io>
CodeQL flagged ValidationError(str(e)) as information exposure through an exception. Use a fixed validation message instead.
Warden flagged that re-raising UnicodeEncodeError from external requests still becomes outer lifecycle failures, and that passing the raw exception to record_halt can log unmasked header secrets. Raise SentryAppIntegratorError with a fixed halt reason instead.
backend typing failed with no-untyped-def on the external-request invalid-header test.
sentaur-athena
marked this pull request as ready for review
August 31, 2026 23:09
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.
Custom sentry-app webhook headers with non-latin-1 characters (e.g. U+3000 ideographic space in
Authorization: Bearer\u3000...) cannot be sent as HTTP headers. That previously raisedUnicodeEncodeErrorduring webhook send and was recorded as a Sentry product failure.Changes:
400UnicodeEncodeErroras invalid customer config (record_halt/INVALID_HEADER) instead of a failure issueFixes SENTRY-5TWJ
This PR is made as part of daily #team-issues-oncall routine to handle the new and regressed sentry issues.
Requested by Athena Moghaddam.
--
View Junior Session [Sentry]