Information Exposure Affecting sentry-sdk package, versions [,1.14.0)


Severity

Recommended
0.0
medium
0
10

CVSS assessment made by Snyk's Security Team

    Threat Intelligence

    EPSS
    0.09% (40th percentile)

Do your applications use this vulnerable package?

In a few clicks we can analyze your entire application and see what components are vulnerable in your application, and suggest you quick fixes.

Test your applications
  • Snyk ID SNYK-PYTHON-SENTRYSDK-3367401
  • published 22 Mar 2023
  • disclosed 21 Mar 2023
  • credit Tom Wolters (Chapter8)

How to fix?

Upgrade sentry-sdk to version 1.14.0 or higher.

Overview

Affected versions of this package are vulnerable to Information Exposure in the Django integration, which leaks sensitive cookies values, including the session cookie to Sentry. An attacker with access to Sentry issues can use such cookies to escalate privileges within the application.

Note:

All of these conditions must be met for an application to be vulnerable:

  1. sendDefaultPII is set to True, which is not the default.

  2. SESSION_COOKIE_NAME or CSRF_COOKIE_NAME has a custom name in Django settings.

  3. Data scrubbing features are NOT being used to scrub the custom cookie names..

Workaround

This vulnerability can be avoided by filtering out cookies from the payload sent to Sentry. For error events, this can be done with the before_send callback method, and for performance-related events (transactions), with the before_send_transaction callback method.

On the server side, the advanced data scrubbing feature can be used to scrub the $http.cookies, $http.headers, $request.cookies, and $request.headers fields.

CVSS Scores

version 3.1
Expand this section

Snyk

Recommended
5 medium
  • Attack Vector (AV)
    Network
  • Attack Complexity (AC)
    High
  • Privileges Required (PR)
    High
  • User Interaction (UI)
    None
  • Scope (S)
    Unchanged
  • Confidentiality (C)
    High
  • Integrity (I)
    Low
  • Availability (A)
    None
Expand this section

NVD

6.5 medium