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. Learn more

Threat Intelligence

EPSS
0.08% (38th 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 IDSNYK-PYTHON-SENTRYSDK-3367401
  • published22 Mar 2023
  • disclosed21 Mar 2023
  • creditTom Wolters (Chapter8)

Introduced: 21 Mar 2023

CVE-2023-28117  (opens in a new tab)
CWE-209  (opens in a new tab)

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