CVE-2024-40647
Unintentional exposure of environment variables to subprocesses in sentry-sdk
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.
Attack profile
How easy it is to exploit
- Attack vector
- Local
- Complexity
- High
- Privileges needed
- High
- User interaction
- None
What an attacker can affect
- Confidentiality
- High
- Integrity
- None
- Availability
- None
Exploit likelihood
What each source reports
CVE List Score used
5.3
Unintentional exposure of environment variables to subprocesses in sentry-sdk
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.
- Record
CVE-2024-40647- CVSS 3.1
- 5.3 Medium
CVSS:3.1/AV:L/AC:H/PR:H/UI:N/S:C/C:H/I:N/A:N - Weakness
- CWE-200
- Updated
- 2026-11-02
EUVDEUVD-2024-2345
5.3
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.
- Record
EUVD-2024-2345- CVSS 3.1
- 5.3 Medium
CVSS:3.1/AV:L/AC:H/PR:H/UI:N/S:C/C:H/I:N/A:N - Updated
- 2026-11-02
GitHub AdvisoriesGHSA-g92j-qhmh-64v2
1.8
Sentry's Python SDK unintentionally exposes environment variables to subprocesses
Impact
The bug in Sentry's Python SDK <2.8.0 results in the unintentional exposure of environment variables to subprocesses despite the env={} setting.
Details
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, like in this example:
>>> subprocess.check_output(["env"], env={"TEST":"1"})
b'TEST=1\n'
If you'd want to not pass any variables, you can set an empty dict:
>>> subprocess.check_output(["env"], env={})
b''
However, the bug in Sentry SDK <2.8.0 causes all environment variables to be passed to the subprocesses when env={} is set, unless the Sentry SDK's Stdlib integration is disabled. The Stdlib integration is enabled by default.
Patches
The issue has been patched in https://github.com/getsentry/sentry-python/pull/3251 and the fix released in sentry-sdk==2.8.0. The fix was also backported to sentry-sdk==1.45.1.
Workarounds
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, there are two options:
- In your application, replace
env={}with the minimal dictenv={"EMPTY_ENV":"1"}or similar.
OR
- Disable Stdlib integration:
import sentry_sdk
# Should go before sentry_sdk.init
sentry_sdk.integrations._DEFAULT_INTEGRATIONS.remove("sentry_sdk.integrations.stdlib.StdlibIntegration")
sentry_sdk.init(...)
References
- Sentry docs: Default integrations
- Python docs: subprocess module
- Patch https://github.com/getsentry/sentry-python/pull/3251
- Record
GHSA-g92j-qhmh-64v2- CVSS 4.0
- 1.8 Low
CVSS:4.0/AV:L/AC:L/AT:P/PR:H/UI:N/VC:N/VI:N/VA:N/SC:L/SI:N/SA:N - CVSS 3.1
- 2.5 Low
CVSS:3.1/AV:L/AC:H/PR:H/UI:N/S:C/C:L/I:N/A:N - Weakness
- CWE-200
- Updated
- 2026-11-02
NVD
5.3
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.
- Record
CVE-2024-40647- CVSS 3.1
- 5.3 Medium
CVSS:3.1/AV:L/AC:H/PR:H/UI:N/S:C/C:H/I:N/A:N - Weakness
- CWE-200
- Updated
- 2026-11-02
OSV
5.3
Unintentional exposure of environment variables to subprocesses in sentry-sdk
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.
- Record
CVE-2024-40647- CVSS 3.1
- 5.3 Medium
CVSS:3.1/AV:L/AC:H/PR:H/UI:N/S:C/C:H/I:N/A:N - Weakness
- CWE-200
- Updated
- 2026-11-02
OSVDEBIAN-CVE-2024-40647
5.3
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.
- Record
DEBIAN-CVE-2024-40647- CVSS 3.1
- 5.3 Medium
CVSS:3.1/AV:L/AC:H/PR:H/UI:N/S:C/C:H/I:N/A:N - Updated
- 2026-11-02
Show 6 moreShow less
OSVGHSA-g92j-qhmh-64v2
1.8
Sentry's Python SDK unintentionally exposes environment variables to subprocesses
Impact
The bug in Sentry's Python SDK <2.8.0 results in the unintentional exposure of environment variables to subprocesses despite the env={} setting.
Details
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, like in this example:
>>> subprocess.check_output(["env"], env={"TEST":"1"})
b'TEST=1\n'
If you'd want to not pass any variables, you can set an empty dict:
>>> subprocess.check_output(["env"], env={})
b''
However, the bug in Sentry SDK <2.8.0 causes all environment variables to be passed to the subprocesses when env={} is set, unless the Sentry SDK's Stdlib integration is disabled. The Stdlib integration is enabled by default.
Patches
The issue has been patched in https://github.com/getsentry/sentry-python/pull/3251 and the fix released in sentry-sdk==2.8.0. The fix was also backported to sentry-sdk==1.45.1.
Workarounds
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, there are two options:
- In your application, replace
env={}with the minimal dictenv={"EMPTY_ENV":"1"}or similar.
OR
- Disable Stdlib integration:
import sentry_sdk
# Should go before sentry_sdk.init
sentry_sdk.integrations._DEFAULT_INTEGRATIONS.remove("sentry_sdk.integrations.stdlib.StdlibIntegration")
sentry_sdk.init(...)
References
- Sentry docs: Default integrations
- Python docs: subprocess module
- Patch https://github.com/getsentry/sentry-python/pull/3251
- Record
GHSA-g92j-qhmh-64v2- CVSS 4.0
- 1.8 Low
CVSS:4.0/AV:L/AC:L/AT:P/PR:H/UI:N/VC:N/VI:N/VA:N/SC:L/SI:N/SA:N - CVSS 3.1
- 2.5 Low
CVSS:3.1/AV:L/AC:H/PR:H/UI:N/S:C/C:L/I:N/A:N - Weakness
- CWE-200
- Updated
- 2026-11-02
OSVPYSEC-2026-1917
1.8
Sentry's Python SDK unintentionally exposes environment variables to subprocesses
Impact
The bug in Sentry's Python SDK <2.8.0 results in the unintentional exposure of environment variables to subprocesses despite the env={} setting.
Details
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, like in this example:
>>> subprocess.check_output(["env"], env={"TEST":"1"})
b'TEST=1\n'
If you'd want to not pass any variables, you can set an empty dict:
>>> subprocess.check_output(["env"], env={})
b''
However, the bug in Sentry SDK <2.8.0 causes all environment variables to be passed to the subprocesses when env={} is set, unless the Sentry SDK's Stdlib integration is disabled. The Stdlib integration is enabled by default.
Patches
The issue has been patched in https://github.com/getsentry/sentry-python/pull/3251 and the fix released in sentry-sdk==2.8.0. The fix was also backported to sentry-sdk==1.45.1.
Workarounds
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, there are two options:
- In your application, replace
env={}with the minimal dictenv={"EMPTY_ENV":"1"}or similar.
OR
- Disable Stdlib integration:
import sentry_sdk
# Should go before sentry_sdk.init
sentry_sdk.integrations._DEFAULT_INTEGRATIONS.remove("sentry_sdk.integrations.stdlib.StdlibIntegration")
sentry_sdk.init(...)
References
- Sentry docs: Default integrations
- Python docs: subprocess module
- Patch https://github.com/getsentry/sentry-python/pull/3251
- Record
PYSEC-2026-1917- CVSS 4.0
- 1.8 Low
CVSS:4.0/AV:L/AC:L/AT:P/PR:H/UI:N/VC:N/VI:N/VA:N/SC:L/SI:N/SA:N - CVSS 3.1
- 2.5 Low
CVSS:3.1/AV:L/AC:H/PR:H/UI:N/S:C/C:L/I:N/A:N - Updated
- 2026-11-02
OSVUBUNTU-CVE-2024-40647
5.3
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.
- Record
UBUNTU-CVE-2024-40647- CVSS 3.1
- 5.3 Medium
CVSS:3.1/AV:L/AC:H/PR:H/UI:N/S:C/C:H/I:N/A:N - Updated
- 2026-11-02
OSVopenSUSE-SU-2024:0214-1 No score
Security update for python-sentry-sdk
This update for python-sentry-sdk fixes the following issues:
- CVE-2024-40647: Do not leak environment variables to child processes. (bsc#1228128)
- Record
openSUSE-SU-2024:0214-1- Updated
- 2026-11-02
OSVopenSUSE-SU-2024:14209-1 No score
python310-sentry-sdk-2.10.0-1.1 on GA media
These are all security issues fixed in the python310-sentry-sdk-2.10.0-1.1 package on the GA media of openSUSE Tumbleweed.
- Record
openSUSE-SU-2024:14209-1- Updated
- 2026-11-02
OSVopenSUSE-SU-2026:11425-1 No score
python313-sentry-sdk-2.66.1-1.1 on GA media
These are all security issues fixed in the python313-sentry-sdk-2.66.1-1.1 package on the GA media of openSUSE Tumbleweed.
- Record
openSUSE-SU-2026:11425-1- Updated
- 2026-11-02
Affected products
Affected packages
| Package | Affected | Fixed |
|---|---|---|
sentry-sdkPyPI |
2.0.0a1 up to 2.8.0 | 2.8.0 |
sentry-sdkPyPI |
before 1.45.1 | 1.45.1 |
sentry-pythonDebian:12 |
before 1.9.10-2+deb12u1, plus listed versions 1.9.10-2 |
1.9.10-2+deb12u1 |
sentry-pythonDebian:13 |
before 2.16.0-1 | 2.16.0-1 |
sentry-pythonDebian:14 |
before 2.16.0-1 | 2.16.0-1 |
sentry-sdkPyPI |
2.0.0a1 up to 2.8.0, plus listed versions 2.0.02.0.0a22.0.0rc12.0.0rc22.0.0rc3 Show 16 moreShow less2.0.0rc42.0.0rc52.0.0rc62.0.12.1.02.1.12.2.02.2.12.3.02.3.12.4.02.5.02.5.12.6.02.7.02.7.1 |
2.8.0 |
sentry-sdkPyPI |
before 1.45.1, plus listed versions 0.1.00.1.0rc10.1.0rc100.1.0rc110.1.0rc12 Show 45 moreShow less0.1.0rc130.1.0rc140.1.0rc150.1.0rc160.1.0rc20.1.0rc30.1.0rc40.1.0rc50.1.0rc60.1.0rc70.1.0rc80.1.0rc90.1.10.1.20.1.30.10.00.10.10.10.20.11.00.11.10.11.20.12.00.12.10.12.20.12.30.13.00.13.10.13.20.13.30.13.40.13.50.14.00.14.10.14.20.14.30.14.40.15.00.15.10.16.00.16.10.16.20.16.30.16.40.16.50.17.0 |
1.45.1 |
sentry-sdkPyPI |
before 1.45.1, 2.0.0a1 up to 2.8.0, plus listed versions 0.1.00.1.0rc10.1.0rc100.1.0rc110.1.0rc12 Show 45 moreShow less0.1.0rc130.1.0rc140.1.0rc150.1.0rc160.1.0rc20.1.0rc30.1.0rc40.1.0rc50.1.0rc60.1.0rc70.1.0rc80.1.0rc90.1.10.1.20.1.30.10.00.10.10.10.20.11.00.11.10.11.20.12.00.12.10.12.20.12.30.13.00.13.10.13.20.13.30.13.40.13.50.14.00.14.10.14.20.14.30.14.40.15.00.15.10.16.00.16.10.16.20.16.30.16.40.16.50.17.0 |
1.45.12.8.0 |
sentry-pythonUbuntu:20.04:LTS |
All versions, plus listed versions 0.12.2-1 |
None known |
sentry-pythonUbuntu:22.04:LTS |
All versions, plus listed versions 0.13.2-11.4.3-1 |
None known |
Show 8 moreShow less
| Package | Affected | Fixed |
|---|---|---|
sentry-pythonUbuntu:24.04:LTS |
All versions, plus listed versions 1.9.10-21.39.2-0.1 |
None known |
sentry-pythonUbuntu:25.10 |
All versions, plus listed versions 2.18.0-1 |
None known |
sentry-pythonUbuntu:26.10 |
All versions, plus listed versions 2.22.0-12.60.0-32.63.0-12.64.0-1 |
None known |
sentry-pythonUbuntu:26.04:LTS |
All versions, plus listed versions 2.18.0-12.22.0-1 |
None known |
python-sentry-sdkSUSE:Package Hub 15 SP5 |
before 0.14.4-bp155.3.3.1 | 0.14.4-bp155.3.3.1 |
python-sentry-sdkopenSUSE:Leap 15.5 |
before 0.14.4-bp155.3.3.1 | 0.14.4-bp155.3.3.1 |
python-sentry-sdkopenSUSE:Tumbleweed |
before 2.10.0-1.1 | 2.10.0-1.1 |
python-sentry-sdkopenSUSE:Tumbleweed |
before 2.66.1-1.1 | 2.66.1-1.1 |
History
| Recorded | Changed | Sources |
|---|---|---|
| first indexed | CVE List, EUVD, GitHub Advisories, NVD, OSV |
Dates are when Every CVE recorded each change. Upstream dates may differ.
In short
CVE-2024-40647 is a medium vulnerability (CVSS 5.3) in Getsentry Sentry-python, published July 18, 2024. No source lists public exploit code. EPSS puts the chance of exploitation in the next 30 days at 0.20%, the 9th percentile. Fixed in sentry-sdk 2.8.0.
References
github.com/getsentry/sentry-python/security/advisories/GHSA-g92j-qhmh-64v2
github.com/getsentry/sentry-python/pull/3251
github.com/getsentry/sentry-python/commit/763e40aa4cb57ecced467f48f78f335c87e9bdff
docs.python.org/3/library/subprocess.html
docs.sentry.io/platforms/python/integrations/default-integrations
github.com/getsentry/sentry-python/releases/tag/2.8.0
Show 13 moreShow less
lists.debian.org/debian-lts-announce/2026/06/msg00001.html
nvd.nist.gov/vuln/detail/CVE-2024-40647
github.com/getsentry/sentry-python/releases/tag/1.45.1
github.com/advisories/GHSA-g92j-qhmh-64v2
github.com/CVEProject/cvelistV5/tree/main/cves/2024/40xxx/CVE-2024-40647.json
security-tracker.debian.org/tracker/CVE-2024-40647
github.com/getsentry/sentry-python
pypi.org/project/sentry-sdk
ubuntu.com/security/CVE-2024-40647
cve.org/CVERecord?id=CVE-2024-40647
lists.opensuse.org/archives/list/[email protected]/thread/J6DLLMQ4P74VFN7WOQ3UL2VM6BAM22WL
bugzilla.suse.com/1228128
suse.com/security/cve/CVE-2024-40647
Left out here: 369 versions. The JSON record has them.