CVE-2024-40647
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.
AI Insight
LLM-synthesized narrative grounded in this CVE's description and references.
Affected packages
Versions sourced from the GitHub Security Advisory.
| Package | Affected versions | Patched versions |
|---|---|---|
sentry-sdkPyPI | >= 2.0.0a1, < 2.8.0 | 2.8.0 |
sentry-sdkPyPI | < 1.45.1 | 1.45.1 |
Affected products
5- Range: 0.2.0
- ghsa-coords4 versionspkg:pypi/sentry-sdkpkg:rpm/opensuse/python-sentry-sdk&distro=openSUSE%20Leap%2015.5pkg:rpm/opensuse/python-sentry-sdk&distro=openSUSE%20Tumbleweedpkg:rpm/suse/python-sentry-sdk&distro=SUSE%20Package%20Hub%2015%20SP5
>= 2.0.0a1, < 2.8.0+ 3 more
- (no CPE)range: >= 2.0.0a1, < 2.8.0
- (no CPE)range: < 0.14.4-bp155.3.3.1
- (no CPE)range: < 2.10.0-1.1
- (no CPE)range: < 0.14.4-bp155.3.3.1
Patches
Vulnerability mechanics
References
11- github.com/advisories/GHSA-g92j-qhmh-64v2ghsaADVISORY
- nvd.nist.gov/vuln/detail/CVE-2024-40647ghsaADVISORY
- docs.python.org/3/library/subprocess.htmlnvdWEB
- docs.sentry.io/platforms/python/integrations/default-integrationsnvdWEB
- docs.sentry.io/platforms/python/integrations/default-integrations/nvdWEB
- github.com/getsentry/sentry-python/commit/763e40aa4cb57ecced467f48f78f335c87e9bdffnvdWEB
- github.com/getsentry/sentry-python/pull/3251nvdWEB
- github.com/getsentry/sentry-python/releases/tag/1.45.1ghsaWEB
- github.com/getsentry/sentry-python/releases/tag/2.8.0nvdWEB
- github.com/getsentry/sentry-python/security/advisories/GHSA-g92j-qhmh-64v2nvdWEB
- lists.debian.org/debian-lts-announce/2026/06/msg00001.htmlnvdWEB
News mentions
0No linked articles in our index yet.