CVE-2024-40647
Unintentional exposure of environment variables to subprocesses in sentry-sdk
- Published
- Updated
- Reserved
- Assigned by
- GitHub_M
Description
sentry-sdk is the official Python SDK for Sentry.io. A bug in Sentry's Python SDK < 2.8.0 allows the environment variables to be passed to subprocesses despite the `env={}` setting. In Python's `subprocess` calls, all environment variables are passed to subprocesses by default. However, if you specifically do not want them to be passed to subprocesses, you may use `env` argument in `subprocess` calls. Due to the bug in Sentry SDK, with the Stdlib integration enabled (which is enabled by default), this expectation is not fulfilled, and all environment variables are being passed to subprocesses instead. The issue has been patched in pull request #3251 and is included in sentry-sdk==2.8.0. We strongly recommend upgrading to the latest SDK version. However, if it's not possible, and if passing environment variables to child processes poses a security risk for you, you can disable all default integrations.
Scores
| Scored by | CVSS | Score | Vector |
|---|---|---|---|
| GitHub_MCNA (assigner) | 3.1 | Medium5.3 | CVSS:3.1/AV:L/AC:H/PR:H/UI:N/S:C/C:H/I:N/A:N |
| NVDNVD · Deferred | 3.1 | Medium5.3 | CVSS:3.1/AV:L/AC:H/PR:H/UI:N/S:C/C:H/I:N/A:N |
- EPSS (exploitation in 30 days)
- 0.20% · top 90% of all CVEs (6 Nov 2026)
- CISA SSVC
- Exploitation: none · Automatable: no · Technical impact: partial
The list uses the assigner's score when there is one, then CISA's, then NVD's: Medium 5.3.
Weakness
Affected products
- affected < 2.8.0
Affected packages
From reviewed advisories of the GitHub Advisory Database.
- PyPIsentry-sdkGHSA-g92j-qhmh-64v2 (opens in a new tab)
References (8)
- https://github.com/getsentry/sentry-python/security/advisories/GHSA-g92j-qhmh-64v2 (opens in a new tab)x_refsource_CONFIRMx_transferred
- https://github.com/getsentry/sentry-python/pull/3251 (opens in a new tab)x_refsource_MISCx_transferred
- https://github.com/getsentry/sentry-python/commit/763e40aa4cb57ecced467f48f78f335c87e9bdff (opens in a new tab)x_refsource_MISCx_transferred
- https://docs.python.org/3/library/subprocess.html (opens in a new tab)x_refsource_MISCx_transferred
- https://docs.sentry.io/platforms/python/integrations/default-integrations (opens in a new tab)x_refsource_MISCx_transferred
- https://docs.sentry.io/platforms/python/integrations/default-integrations/#stdlib (opens in a new tab)x_refsource_MISCx_transferred
- https://github.com/getsentry/sentry-python/releases/tag/2.8.0 (opens in a new tab)x_refsource_MISCx_transferred
- https://lists.debian.org/debian-lts-announce/2026/06/msg00001.html (opens in a new tab)
Sources
The same CVE in the primary databases and aggregators, to check against.
- CVE.org record (opens in a new tab)
- CVE List JSON (GitHub) (opens in a new tab)
- NVD (opens in a new tab)
- FIRST EPSS (opens in a new tab)
- OSV.dev (opens in a new tab)
- GitHub Advisory GHSA-g92j-qhmh-64v2 (opens in a new tab)
- CIRCL Vulnerability-Lookup (opens in a new tab)
Badge for a README or a ticket
[](https://trackcve.app/cve/CVE-2024-40647)Record last updated .