CVE-2025-22146
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.
Affected packages
Versions sourced from the GitHub Security Advisory.
| Package | Affected versions | Patched versions |
|---|---|---|
sentryPyPI | >= 21.12.0, < 25.1.0 | 25.1.0 |
Patches
27ca1e3af4f146db508f7949dfix: check user in helper (#83407)
2 files changed · +12 −1
src/sentry/auth/helper.py+1 −1 modified@@ -547,7 +547,7 @@ def handle_unknown_identity( elif not self._has_usable_password(): is_new_account = True - if op == "confirm" and self.user.is_authenticated or is_account_verified: + if op == "confirm" and (self.request.user.id == self.user.id) or is_account_verified: auth_identity = self.handle_attach_identity() elif op == "newuser": auth_identity = self.handle_new_user()
tests/sentry/web/frontend/test_auth_saml2.py+11 −0 modified@@ -295,3 +295,14 @@ def test_logout_request(self): updated = type(self.user).objects.get(pk=self.user.id) assert updated.session_nonce != self.user.session_nonce + + def test_verify_email(self, follow=False, **kwargs): + assert AuthIdentity.objects.filter(user_id=self.user.id).count() == 0 + + response = self.accept_auth() + assert response.status_code == 200 + + response = self.client.post(self.acs_path, {"op": "confirm"}) + + # expect no linking before verification + assert AuthIdentity.objects.filter(user_id=self.user.id).count() == 0
Vulnerability mechanics
Generated by null/stub on May 9, 2026. Inputs: CWE entries + fix-commit diffs from this CVE's patches. Citations validated against bundle.
References
5- github.com/advisories/GHSA-7pq6-v88g-wf3wghsaADVISORY
- nvd.nist.gov/vuln/detail/CVE-2025-22146ghsaADVISORY
- github.com/getsentry/sentry/commit/6db508f7949d117c7dff748a3c82c3a272bf7cfdghsaWEB
- github.com/getsentry/sentry/pull/83407nvdWEB
- github.com/getsentry/sentry/security/advisories/GHSA-7pq6-v88g-wf3wnvdWEB
News mentions
0No linked articles in our index yet.