CVE-2024-40647: Unintentional exposure of environment variables to subprocesses in sentry-sdk
Vulnerability summary
CVE-2024-40647 is a medium (CVSS 5.3) vulnerability in getsentry sentry-python. EPSS estimates a 0.20% chance of exploitation in the next 30 days, higher than 9.8% of scored vulnerabilities.
Not severe (CVSS 5.3, local access); no exploitation reported by the 5 checked sources
Source freshness unavailable
How is this decided?Timeline
- 18-07-2024PublishedVulnerability first disclosed.
- 01-06-2026Last modifiedVulnerability information updated.
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.
CVSS metrics
6 scores · 5 sources · 2 versions- OSV · PypiEcosystem advisory · calculated2.5LowCVSS:3.1/AV:L/AC:H/PR:H/UI:N/S:C/C:L/I:N/A:NDiffers
- OSV · UbuntuEcosystem advisory · calculated5.3MediumCVSS:3.1/AV:L/AC:H/PR:H/UI:N/S:C/C:H/I:N/A:N
- OSV · DebianEcosystem advisory · calculated5.3MediumCVSS:3.1/AV:L/AC:H/PR:H/UI:N/S:C/C:H/I:N/A:N
- NVDNIST5.3MediumCVSS:3.1/AV:L/AC:H/PR:H/UI:N/S:C/C:H/I:N/A:N
EPSS trend
Probability
0.20%
Chance of exploitation in the next 30 days
Percentile
10%
Versus all other CVEs
30-day change
No change 0.00 pp
From 0.20% on 04-10-2026
Known exploited
Compare KEV catalogsNot in the CISA KEV catalog.
Not in the ENISA CNW catalog.
Not in the CIRCL catalog.
Public exploits
0 foundNo public exploits indexed.
Weaknesses
CWE · root causeAffected systems
Known conditions: local access, administrative account, no user interaction (CVSS vector). Other conditions: not stated in public data.
Opensuse2 products
- python-sentry-sdk&distro=openSUSE Leap 15.5< 0.14.4-bp155.3.3.1
- python-sentry-sdk&distro=openSUSE Tumbleweed< 2.10.0-1.1 | < 2.66.1-1.1
Debian1 product
- sentry-python< 1.9.10-2+deb12u1 | < 2.16.0-1
Getsentry1 product
- sentry-python< 2.8.0
PyPI1 product
- sentry-sdk< 1.45.1 | ≥ 2.0.0a1, < 2.8.0
Suse1 product
- python-sentry-sdk&distro=SUSE Package Hub 15 SP5< 0.14.4-bp155.3.3.1
Ubuntu1 product
- sentry-pythonAll versions (No fix recorded)
6 vendors · 7 products
References
19 links- github.com/getsentry/sentry-python/security/advisories/GHSA-g92j-qhmh-64v2X Refsource CONFIRMWEBREPORT
- github.com/getsentry/sentry-python/commit/763e40aa4cb57ecced467f48f78f335c87e9bdffX Refsource MISCWEBREPORT
- lists.opensuse.org/archives/…Advisory
Show all 19 references
- pypi.org/project/sentry-sdkPACKAGE