Keep the request and the user out of Sentry events - #7
Merged
Merged
Conversation
The SDK default read the request body, so a server error on a login route sent the email and the password to the project.
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
SentryReporter::initializedWithbooted the SDK with its defaults, and the PHP SDK defaults tomax_request_body_size=medium. Its request integration reads the request from the globals of the process andattaches the URL with the query string, the headers, and a body of up to 10 KB.
send_default_pii=falsefilters theAuthorizationandCookieheaders and the IP address, and nothing else. A server error on a login route thereforesent the email and the password to the project.
Measured with a local capture of the envelope, SDK 4.32.0 on PHP 8.5, for a
POST /v1/auth/login?phone=...carrying aJSON body and a bearer token, answered with 500:
[Filtered]requestobjectThe reporter now boots the SDK with
max_request_body_size=never, so the body is never read, and with abefore_sendhook that drops the
requestand theuserthe SDK gathered on its own. The method and the path an event needsalready travel in the
httpcontext, and the matched route in the transaction.SentryReporter::from()is unchanged,because a hub the application boots is the application's to configure, and the README now says so.
Related issue
None. Found while wiring the reporter into more services.
Checklist
that carries a login request and a user.
make reviewpasses.make testspasses: 130 tests, 266 assertions, 203 mutants, all killed, MSI 100%.