CVE-2024-40647 json
Unintentional exposure of environment variables to subprocesses in sentry-sdk
published 2024-07-18 2 y ago modified 2026-07-07 4 mo ago also EUVD-2024-2345 , GHSA-g92j-qhmh-64v2 , PYSEC-2026-1917
- cvss
- 5.3
- version 3.1, CNA
- cisa kev
- Not listed
- not in CISA's catalog
- epss
- 0.2%
- EPSS 0.2% chance of exploitation in 30 days, percentile 9%
- public exploits
- 0
- none known
Summary
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.
Patch / fix
- pypi sentry-sdk 1.45.1, 2.8.0
- sentry sentry_software_development_kit 2.8.0
- sentry-python Debian 12 1.9.10-2+deb12u1
- sentry-python Debian 14, Debian 13 2.16.0-1
debian advisories DEBIAN-CVE-2024-40647
- python-sentry-sdk openSUSE Tumbleweed 2.66.1-1.1
- python-sentry-sdk Package Hub 15 SP5, openSUSE Leap 15.5 0.14.4-bp155.3.3.1
- python-sentry-sdk openSUSE Tumbleweed 2.10.0-1.1
opensuse advisories openSUSE-SU-2026:11425-1openSUSE-SU-2024:0214-1openSUSE-SU-2024:14209-1
CISA SSVC
- Exploitation
- none
- Automatable
- no
- Technical impact
- partial
- Assessed
- 2 y ago
Exploit prediction
0.20% chance of exploitation in the next 30 days, higher than 9% of all scored CVEs (FIRST EPSS, 2026-11-08).
CVSS scores
| assigned by | version | score | vector |
|---|---|---|---|
| CNA | 3.1 | 5.3 | CVSS:3.1/AV:L/AC:H/PR:H/UI:N/S:C/C:H/I:N/A:N |
| GitHub | 3.1 | 2.5 | CVSS:3.1/AV:L/AC:H/PR:H/UI:N/S:C/C:L/I:N/A:N |
| OSV | 3.1 | 2.5 | CVSS:3.1/AV:L/AC:H/PR:H/UI:N/S:C/C:L/I:N/A:N |
Affected packages
| ecosystem | package | affected | fixed in |
|---|---|---|---|
| pypi | sentry-sdk | >=2.0.0a1, <2.8.0 <1.45.1 |
2.8.0 1.45.1 |
Affected products
- getsentry sentry-python
Classification
- Weakness
-
- CWE-200 Exposure of Sensitive Information to an Unauthorized Actor
References
-
github.com
/getsentry/sentry-python/pull/3251
web
-
github.com
/getsentry/sentry-python/commit/763e40aa4cb57ecced467f48f78f335c87e9bdff
web
-
github.com
/getsentry/sentry-python/security/advisories/GHSA-g92j-qhmh-64v2
web
-
docs.python.org
/3/library/subprocess.html
web
-
docs.sentry.io
/platforms/python/integrations/default-integrations
web
-
docs.sentry.io
/platforms/python/integrations/default-integrations/#stdlib
web
-
github.com
/getsentry/sentry-python/releases/tag/2.8.0
web
-
lists.debian.org
/debian-lts-announce/2026/06/msg00001.html
web
-
nvd.nist.gov
/vuln/detail/CVE-2024-40647
advisory
-
github.com
/getsentry/sentry-python
package
-
github.com
/getsentry/sentry-python/releases/tag/1.45.1
web
-
pypi.org
/project/sentry-sdk
package
-
github.com
/advisories/GHSA-g92j-qhmh-64v2
advisory
Sources
- CVE List CVE-2024-40647
- GitHub Advisory GHSA-g92j-qhmh-64v2
- NVD CVE-2024-40647
- OSV PYSEC-2026-1917
Fencer Vulns keeps one entry per vulnerability: the CVE id wins, then GHSA, and records that alias each other are merged, except that two CVEs always keep separate entries. The same data is available as JSON.
CPEs and fixed versions use Anchore's correction of NVD's data: Added CPE configurations because not yet analyzed by NVD.