medium · M6 · MASVS-PRIVACY-1 · PTKD-VC-SENTRY-SENDS-PII

    Error tracking sends personal data by default (sendDefaultPii)

    Sentry is initialized with sendDefaultPii: true, so error events include IP addresses, cookies, request bodies and user details. Error payloads also often carry tokens. That data then sits with a third party and must be disclosed in the privacy label and policy.

    How it is exploited

    A crash on the login screen ships the request body, including the user's password-reset token, the IP address and the email, to the error tracker. Everyone with access to the Sentry project can read it.

    Why it matters

    Personal data and live tokens stored with a third party, data that must be disclosed in the App Privacy answers and the Data safety form, and a GDPR problem if it is not.

    How to fix it

    1. Set sendDefaultPii: false.
    2. Scrub events in beforeSend: drop request bodies, cookies and authorization headers, and mask emails and tokens.
    3. Turn on Sentry's server-side data scrubbing for the project as a second layer.
    4. List what you still send (crash data, a user id) in the App Privacy and Data safety answers.

    TypeScript

    Sentry.init({
      dsn,
      sendDefaultPii: false,
      beforeSend(event) {
        if (event.request) { delete event.request.data; delete event.request.cookies; }
        return event;
      },
    });

    Does your app have this?

    PTKD checks your build or your source project for PTKD-VC-SENTRY-SENDS-PII and every other check in this knowledge base.

    Scan your app

    References

    Related checks (M6)