CVE-2023-39349: Sentry Privilege Escalation Vulnerability
HIGHCVE-2023-39349 is a HIGH (CVSS 8.1) privilege escalation vulnerability (CWE-284: Improper Access Control) affecting Sentry libraries in the PyPI ecosystem. The issue involves privilege escalation via apitokensendpoint. Remediation is available by upgrading affected packages to version 23.7.2.
CVE-2023-39349 at a Glance
Security Impact
CVSS: 8.1
The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:N).
How to Fix CVE-2023-39349
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.
pip install sentry>=23.7.2
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-39349, 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-284: Improper Access Control, where the product does not restrict or incorrectly restricts access to a resource from an unauthorized actor. 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
CVE-2023-39349 Affected Sentry Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
sentry
|
PyPI |
≥ 22.1.0
< 23.7.2
|
23.7.2
|
References
Frequently Asked Questions
What is CVE-2023-39349?
Which Sentry versions are affected?
What version fixes CVE-2023-39349?
Is sentry affected?
What is the CVSS score of CVE-2023-39349?
What CWE is associated with CVE-2023-39349?
How can I check PyPI dependencies for CVE-2023-39349?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-9jcq-jf57-c62c",
"modified" : "2023-08-08T20:46:12Z",
"published" : "2023-08-08T20:46:12Z",
"aliases" : [ "CVE-2023-39349" ],
"summary" : "Privilege escalation via ApiTokensEndpoint",
"details" : "### Impact\nAn attacker with access to a token with few or no scopes can query `/api/0/api-tokens/` for a list of all tokens created by a user, including tokens with greater scopes, and use those tokens in other requests.\n\nThere is no evidence that the issue was exploited on https://sentry.io. For self-hosted users, it is advised to rotate user auth tokens via `https://your-self-hosted-sentry-installation/settings/account/api/auth-tokens/`.\n\n### Patches\nThe issue was fixed in https://github.com/getsentry/sentry/pull/53850 and is available in the release 23.7.2 of [sentry](https://github.com/getsentry/sentry/releases/tag/23.7.2) and [self-hosted](https://github.com/getsentry/self-hosted/releases/tag/23.7.2).\n\n### Workarounds\nThere are no known workarounds.",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:N"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "PyPI",
"name" : "sentry"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "22.1.0"
}, {
"fixed" : "23.7.2"
} ]
} ]
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://github.com/getsentry/sentry/security/advisories/GHSA-9jcq-jf57-c62c"
}, {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2023-39349"
}, {
"type" : "WEB",
"url" : "https://github.com/getsentry/sentry/pull/53850"
}, {
"type" : "WEB",
"url" : "https://github.com/getsentry/sentry/commit/fad12c1150d1135edf9666ea72ca11bc110c1083"
}, {
"type" : "WEB",
"url" : "https://github.com/getsentry/self-hosted/releases/tag/23.7.2"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/getsentry/sentry"
}, {
"type" : "WEB",
"url" : "https://github.com/getsentry/sentry/releases/tag/23.7.2"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-284" ],
"severity" : "HIGH",
"github_reviewed" : true,
"github_reviewed_at" : "2023-08-08T20:46:12Z",
"nvd_published_at" : "2023-08-07T19:15:11Z"
}
}