Menu

Your Sentry Breadcrumbs Are Carrying Someone Else's PHI
📰

Your Sentry Breadcrumbs Are Carrying Someone Else's PHI

DEV Community: security·Andrew Rogers·3 days ago
#s1emiF3U
#devtosecurity#devto#dev#sentry#didn
Reading 0:00
15s threshold
Cover image for Your Sentry Breadcrumbs Are Carrying Someone Else's PHI

Andrew Rogers

The Bug You Didn't Write

Your Go service handles concurrent HTTP requests. You're using
sentryzerolog to ship breadcrumbs and errors to Sentry for
observability. Everything looks clean in code review. Then someone
runs a HIPAA audit and finds patient names, DOB strings, and
medication codes inside Sentry error payloads for requests that
never touched those patients.

You didn't write this bug. The architecture did.

Why This Happens

The sentry-zerolog integration stores a single Hub inside the
Writer struct, initialized once at construction time:


go
type Writer struct {
    hub    *sentry.Hub  // fixed at creation — shared across ALL goroutines
    levels []zerolog.Level

Enter fullscreen mode Exit fullscreen mode