CVE-2023-36829: Sentry Sentry CORS Misconfiguration Vulnerability

MODERATE
Advisory Identifier: GHSA-4xqm-4p72-87h6
CVSS 6.8
CWE-942 CWE-863 CWE-697
Published
Advisory Summary

CVE-2023-36829 is a MODERATE (CVSS 6.8) sentry cors misconfiguration vulnerability (CWE-942: Permissive Cross-domain Security Policy with Untrusted Domains) affecting Sentry libraries in the PyPI ecosystem. The issue involves sentry cors misconfiguration. Remediation is available by upgrading affected packages to version 23.6.2.

CVE-2023-36829 at a Glance

CVE Identifier CVE-2023-36829
GHSA Identifier GHSA-4xqm-4p72-87h6
Severity MODERATE
CVSS v3.1 Base Score 6.8
CWE Classification CWE-942: Permissive Cross-domain Security Policy with Untrusted Domains
Affected Product Sentry
Package Ecosystem PyPI
Published Date
Last Updated

Security Impact

CVSS: 6.8

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

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

How to Fix CVE-2023-36829

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.6.2
pip install sentry>=23.6.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-36829, 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.6.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-942: Permissive Cross-domain Security Policy with Untrusted Domains, where the product uses a web-client protection mechanism such as a content security policy (csp) or cross-domain policy file, but the policy includes untrusted domains with which the web client is allowed to communicate. 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 The Sentry API incorrectly returns the `access-control-allow-credentials: true` HTTP header if the `Origin` request header ends with the `system.base-hostname` option of Sentry installation. This only affects installations that have `system.base-hostname` option explicitly set, as it is empty by default. Impact is limited since recent versions of major browsers have cross-site cookie blocking enabled by default. However, this flaw could allow other multi-step attacks. ### Patches The patch has been released in [Sentry 23.6.2](https://github.com/getsentry/self-hosted/releases/tag/23.6.2). ### Workarounds For Sentry SaaS customers, no action is needed. For self-hosted Sentry installations that have `system.base-hostname` explicitly set, it is recommended to upgrade the installation to 23.6.2 or higher. There are no known workarounds. ### References - [getsentry/sentry PR #52276](https://github.com/getsentry/sentry/pull/52276) ### Credits - [@andr0idp4r4n0id](https://twitter.com/andr0idp4r4n0id)

CVE-2023-36829 Affected Sentry Versions

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

References

Frequently Asked Questions

What is CVE-2023-36829?
CVE-2023-36829 is a security vulnerability in Sentry involving Sentry CORS misconfiguration under CWE-942: Permissive Cross-domain Security Policy with Untrusted Domains.
Which Sentry versions are affected?
Affected versions include releases prior to 23.6.2 across affected packages: sentry.
What version fixes CVE-2023-36829?
Upgrading to 23.6.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.6.2. Upgrade your dependency to 23.6.2 or later.
What is the CVSS score of CVE-2023-36829?
CVE-2023-36829 has a CVSS v3.1 base score of 6.8 (MODERATE) with vector string CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:U/C:H/I:H/A:N.
What CWE is associated with CVE-2023-36829?
CVE-2023-36829 is classified under CWE-942: Permissive Cross-domain Security Policy with Untrusted Domains (The product uses a web-client protection mechanism such as a Content Security Policy (CSP) or cross-domain policy file, but the policy includes untrusted domains with which the web client is allowed to communicate.).
How can I check PyPI dependencies for CVE-2023-36829?
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-4xqm-4p72-87h6",
  "modified" : "2023-07-06T22:55:44Z",
  "published" : "2023-07-06T22:55:44Z",
  "aliases" : [ "CVE-2023-36829" ],
  "summary" : "Sentry CORS misconfiguration",
  "details" : "### Impact\nThe Sentry API incorrectly returns the `access-control-allow-credentials: true` HTTP header if the `Origin` request header ends with the `system.base-hostname` option of Sentry installation. This only affects installations that have `system.base-hostname` option explicitly set, as it is empty by default.\n\nImpact is limited since recent versions of major browsers have cross-site cookie blocking enabled by default. However, this flaw could allow other multi-step attacks.\n\n### Patches\nThe patch has been released in [Sentry 23.6.2](https://github.com/getsentry/self-hosted/releases/tag/23.6.2).\n\n### Workarounds\n\nFor Sentry SaaS customers, no action is needed.\n\nFor self-hosted Sentry installations that have `system.base-hostname` explicitly set, it is recommended to upgrade the installation to 23.6.2 or higher. There are no known workarounds.\n\n### References\n- [getsentry/sentry PR #52276](https://github.com/getsentry/sentry/pull/52276)\n\n### Credits\n- [@andr0idp4r4n0id](https://twitter.com/andr0idp4r4n0id)",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:U/C:H/I:H/A:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "PyPI",
      "name" : "sentry"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "23.6.0"
      }, {
        "fixed" : "23.6.2"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/getsentry/sentry/security/advisories/GHSA-4xqm-4p72-87h6"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2023-36829"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/getsentry/sentry/pull/52276"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/getsentry/sentry/commit/19248fb9802c252665b802aeab02fdc65ed47dc9"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/getsentry/sentry/commit/ee44c6be35e5e464bc40637580f39867898acd8b"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/getsentry/self-hosted/releases/tag/23.6.2"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/getsentry/sentry"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/pypa/advisory-database/tree/main/vulns/sentry/PYSEC-2023-115.yaml"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-697", "CWE-863", "CWE-942" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2023-07-06T22:55:44Z",
    "nvd_published_at" : "2023-07-06T23:15:09Z"
  }
}