# CVE-2023-36829: Sentry CORS misconfiguration vulnerability

> Sentry API misconfiguration allows credential leakage via CORS if base hostname is set, enabling potential multi-step attacks.

- **Severity:** Medium 6.8 (`CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:U/C:H/I:H/A:N`)
- **Exploited in the wild:** Not known
- **Login needed:** Not needed
- **Attackable:** Over the internet
- **Victim action needed:** A user has to click or open something
- **Fix available:** Yes
- **Published:** 6 Jul 2023
- **Updated:** 6 Nov 2024
- **Also known as:** GHSA-4xqm-4p72-87h6, PYSEC-2023-115

## What is CVE-2023-36829?

CVE-2023-36829 is a medium-severity vulnerability in getsentry sentry, published on 6 Jul 2023. An attacker can exploit it over the internet without logging in, and only if a user opens a file or follows a link.

### Official description

Sentry is an error tracking and performance monitoring platform. Starting in version 23.6.0 and prior to version 23.6.2, 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. The patch has been released in Sentry 23.6.2.

Weakness: CWE-697 (Incorrect Comparison), CWE-942 (Permissive Cross-domain Security Policy with Untrusted Domains), CWE-863 (Incorrect Authorization)

## Which versions are affected by CVE-2023-36829?

3 open source packages ship an affected version, including sentry. It affects 1 product.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `sentry` | PyPI | From 23.6.0 | 23.6.2 |
| `sentry` | PyPI | From 23.6.0 | 23.6.2 |
| `sentry` | PyPI | From 23.6.0 | 23.6.2 |

Products: Functional Sentry.

## How do I fix CVE-2023-36829?

Upgrade sentry to 23.6.2 or later.

## Is CVE-2023-36829 being exploited?

There is no known exploitation of CVE-2023-36829 in the wild and no public exploit code.

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2023-36829 and fix it if it is affected.

What it is: CVE-2023-36829 is a medium-severity vulnerability in getsentry sentry, published on 6 Jul 2023. An attacker can exploit it over the internet without logging in, and only if a user opens a file or follows a link.
Exploitation: There is no known exploitation of CVE-2023-36829 in the wild and no public exploit code.

Affected packages and fixed versions:
- sentry (PyPI): affected from 23.6.0; fixed in 23.6.2
- sentry (PyPI): affected from 23.6.0; fixed in 23.6.2
- sentry (PyPI): affected from 23.6.0; fixed in 23.6.2

Task:
1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.
2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.
3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.
4. Run the tests and summarise what changed and why.
5. If nothing in the project is affected, say so and change nothing.

Reference: https://insights.sbomify.com/CVE-2023-36829/ (Markdown: https://insights.sbomify.com/CVE-2023-36829/index.md)
```

## Sources

- CVE record: https://www.cve.org/CVERecord?id=CVE-2023-36829
- NVD: https://nvd.nist.gov/vuln/detail/CVE-2023-36829
- OSV: https://osv.dev/vulnerability/CVE-2023-36829

---
From sbomify Insights: https://insights.sbomify.com/CVE-2023-36829/
Summaries are generated and may contain mistakes; the official description above is the record.
