CVE-2023-39531: Sentry Sentry Vulnerable To Incorrect Credential Vulnerability

MODERATE
Advisory Identifier: GHSA-hgj4-h2x3-rfx4
CVSS 6.5
CWE-287
Published
Advisory Summary

CVE-2023-39531 is a MODERATE (CVSS 6.5) sentry vulnerable to incorrect credential vulnerability (CWE-287: Improper Authentication) affecting Sentry libraries in the PyPI ecosystem. The issue involves sentry vulnerable to incorrect credential validation on oauth token requests. Remediation is available by upgrading affected packages to version 23.7.2.

CVE-2023-39531 at a Glance

CVE Identifier CVE-2023-39531
GHSA Identifier GHSA-hgj4-h2x3-rfx4
Severity MODERATE
CVSS v3.1 Base Score 6.5
CWE Classification CWE-287: Improper Authentication
Affected Product Sentry
Package Ecosystem PyPI
Published Date
Last Updated

Security Impact

CVSS: 6.5

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:H/PR:L/UI:R/S:C/C:H/I:L/A:N).

Attack Vector Network (AV:N)
Attack Complexity High (AC:H)
Privileges Required Low (PR:L)
User Interaction Required (UI:R)
Scope Changed (S:C)
Confidentiality High (C:H)
Integrity Low (I:L)
Availability None (A:N)

How to Fix CVE-2023-39531

To remediate this vulnerability, upgrade all affected Sentry dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

sentry fixed: 23.7.2
pip install sentry>=23.7.2
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

pip show sentry

How to Check if You Are Affected

To determine whether your Python environment is affected by CVE-2023-39531, inspect your installed packages using pip:

pip show sentry

Analyze the terminal output to locate any version of Sentry in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 23.7.2), your application is affected.

Note: The pip show sentry command checks currently installed packages in your active Python environment.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-287: Improper Authentication, where when an actor claims to have a given identity, the product does not prove or insufficiently proves that the claim is correct. In Sentry, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

### Impact An attacker with sufficient client-side exploits could retrieve a valid access token for another user during the OAuth token exchange due to incorrect credential validation. The client ID must be known and the API application must have already been authorized on the targeted user account. ### Remediation - **Sentry SaaS** customers do not need to take any action. Those with the highest risk will be contacted directly by Sentry. - **Self-hosted installations** should upgrade to version 23.7.2 or higher. ### Workarounds There are no direct workarounds, but users should review applications authorized on their account (_User Settings > Authorized Applications_) and remove any that are no longer needed.

CVE-2023-39531 Affected Sentry Versions

1 component(s)
Fixed Versions:
23.7.2
Product / Package Ecosystem Affected Versions Fixed Version
sentry
PyPI
≥ 10.0.0
< 23.7.2
23.7.2

References

Frequently Asked Questions

What is CVE-2023-39531?
CVE-2023-39531 is a security vulnerability in Sentry involving Sentry vulnerable to incorrect credential validation on OAuth token requests under CWE-287: Improper Authentication.
Which Sentry versions are affected?
Affected versions include releases prior to 23.7.2 across affected packages: sentry.
What version fixes CVE-2023-39531?
Upgrading to 23.7.2 (or the latest patched release for your respective branch) resolves the vulnerability.
Is sentry affected?
Yes, sentry is affected in releases prior to 23.7.2. Upgrade your dependency to 23.7.2 or later.
What is the CVSS score of CVE-2023-39531?
CVE-2023-39531 has a CVSS v3.1 base score of 6.5 (MODERATE) with vector string CVSS:3.1/AV:N/AC:H/PR:L/UI:R/S:C/C:H/I:L/A:N.
What CWE is associated with CVE-2023-39531?
CVE-2023-39531 is classified under CWE-287: Improper Authentication (When an actor claims to have a given identity, the product does not prove or insufficiently proves that the claim is correct.).
How can I check PyPI dependencies for CVE-2023-39531?
Run the dependency tree command: 'pip show sentry'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-hgj4-h2x3-rfx4",
  "modified" : "2023-08-09T20:58:47Z",
  "published" : "2023-08-09T20:58:47Z",
  "aliases" : [ "CVE-2023-39531" ],
  "summary" : "Sentry vulnerable to incorrect credential validation on OAuth token requests",
  "details" : "### Impact\n\nAn attacker with sufficient client-side exploits could retrieve a valid access token for another user during the OAuth token exchange due to incorrect credential validation. The client ID must be known and the API application must have already been authorized on the targeted user account. \n\n### Remediation\n\n- **Sentry SaaS** customers do not need to take any action. Those with the highest risk will be contacted directly by Sentry.\n- **Self-hosted installations** should upgrade to version 23.7.2 or higher.\n\n### Workarounds\n\nThere are no direct workarounds, but users should review applications authorized on their account (_User Settings > Authorized Applications_) and remove any that are no longer needed.\n\n",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:H/PR:L/UI:R/S:C/C:H/I:L/A:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "PyPI",
      "name" : "sentry"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "10.0.0"
      }, {
        "fixed" : "23.7.2"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/getsentry/sentry/security/advisories/GHSA-hgj4-h2x3-rfx4"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2023-39531"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/getsentry/sentry"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-287" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2023-08-09T20:58:47Z",
    "nvd_published_at" : "2023-08-09T17:15:09Z"
  }
}