# CVE-2025-22146: Improper authentication on SAML SSO process allows user impersonation in sentry

> Attackers can impersonate users via malicious SAML SSO if multiple organizations are enabled, requiring an upgrade to fix.

- **Severity:** Critical 9.1 (`CVSS:3.1/AV:N/AC:L/PR:N/UI:N/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:** Not needed
- **Fix available:** Yes
- **Published:** 15 Jan 2025
- **Updated:** 15 Jan 2025
- **Also known as:** GHSA-7pq6-v88g-wf3w, PYSEC-2026-532

## What is CVE-2025-22146?

CVE-2025-22146 is a critical authentication bypass vulnerability in getsentry sentry, published on 15 Jan 2025. An attacker can exploit it over the internet without logging in, with no action from the victim.

### Official description

Sentry is a developer-first error tracking and performance monitoring tool. A critical vulnerability was discovered in the SAML SSO implementation of Sentry. It was reported to us via our private bug bounty program. The vulnerability allows an attacker to take over any user account by using a malicious SAML Identity Provider and another organization on the same Sentry instance. The victim email address must be known in order to exploit this vulnerability. The Sentry SaaS fix was deployed on Jan 14, 2025. For self hosted users; if only a single organization is allowed `(SENTRY_SINGLE_ORGANIZATION = True)`, then no action is needed. Otherwise, users should upgrade to version 25.1.0 or higher. There are no known workarounds for this vulnerability.

Weakness: CWE-287 (Improper Authentication)

## Which versions are affected by CVE-2025-22146?

3 open source packages ship an affected version, including sentry.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `sentry` | PyPI | From 21.12.0 | 25.1.0 |
| `sentry` | PyPI | From 21.12.0 | 25.1.0 |
| `sentry` | PyPI | From 21.12.0 | 25.1.0 |

## How do I fix CVE-2025-22146?

Upgrade sentry to 25.1.0 or later.

## Is CVE-2025-22146 being exploited?

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

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2025-22146 and fix it if it is affected.

What it is: CVE-2025-22146 is a critical authentication bypass vulnerability in getsentry sentry, published on 15 Jan 2025. An attacker can exploit it over the internet without logging in, with no action from the victim.
Exploitation: There is no known exploitation of CVE-2025-22146 in the wild and no public exploit code.

Affected packages and fixed versions:
- sentry (PyPI): affected from 21.12.0; fixed in 25.1.0
- sentry (PyPI): affected from 21.12.0; fixed in 25.1.0
- sentry (PyPI): affected from 21.12.0; fixed in 25.1.0

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-2025-22146/ (Markdown: https://insights.sbomify.com/CVE-2025-22146/index.md)
```

## Sources

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

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