{"id":"CVE-2024-40647","published":"2024-07-18T16:51:23Z","modified":"2026-06-01T05:37:14Z","title":"Unintentional exposure of environment variables to subprocesses in sentry-sdk","vendor":"getsentry","product":"sentry-python","tier":"tail","description":{"text":"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.\n","provenance":"source","from":"CVE.org"},"cvss":{"score":5.3,"severity":"MEDIUM","version":"3.1","vector":"CVSS:3.1/AV:L/AC:H/PR:H/UI:N/S:C/C:H/I:N/A:N","provenance":"source","from":"CVE.org CNA"},"epss":{"score":0.002,"percentile":0.09976,"provenance":"source"},"cwes":[{"id":"CWE-200","name":"Exposure of Sensitive Information to an Unauthorized Actor"}],"references":[{"url":"https://github.com/getsentry/sentry-python/security/advisories/GHSA-g92j-qhmh-64v2","tags":["x_refsource_CONFIRM"]},{"url":"https://github.com/getsentry/sentry-python/pull/3251","tags":["x_refsource_MISC"]},{"url":"https://github.com/getsentry/sentry-python/commit/763e40aa4cb57ecced467f48f78f335c87e9bdff","tags":["x_refsource_MISC"]},{"url":"https://docs.python.org/3/library/subprocess.html","tags":["x_refsource_MISC"]},{"url":"https://docs.sentry.io/platforms/python/integrations/default-integrations","tags":["x_refsource_MISC"]},{"url":"https://docs.sentry.io/platforms/python/integrations/default-integrations/#stdlib","tags":["x_refsource_MISC"]},{"url":"https://github.com/getsentry/sentry-python/releases/tag/2.8.0","tags":["x_refsource_MISC"]},{"url":"https://lists.debian.org/debian-lts-announce/2026/06/msg00001.html","tags":[]}],"priority":{"score":5.7,"factors":[{"name":"EPSS percentile","points":2.0},{"name":"CVSS severity","points":3.71}]},"vendorSlug":"getsentry","affectedVersions":[{"vendor":"getsentry","product":"sentry-python","versions":["< 2.8.0"]}],"ssvc":{"exploitation":"none","automatable":"no","technicalImpact":"partial","timestamp":"2024-07-18T17:57:48.623412Z","from":"CISA ADP","provenance":"source"},"affected":[{"ecosystem":"PyPI","package":"sentry-sdk","vulnerableRanges":[">=2.0.0a1, <2.8.0","<1.45.1"],"patched":["2.8.0","1.45.1"],"from":["GHSA-g92j-qhmh-64v2","PYSEC-2026-1917"],"provenance":"source"}],"summary":{"text":"The sentry-sdk Python SDK (getsentry's sentry-python, versions before 2.8.0) has a bug in its Stdlib integration, which is enabled by default, that causes all environment variables to be passed to subprocesses even when the caller explicitly sets env={} to withhold them. An attacker who can influence or observe a subprocess launched by an affected application can reach environment variables that were meant to be excluded, which may include sensitive values, and this requires local access to the host with high attack complexity and high privileges, with no user interaction needed.","provenance":"ai","model":"claude-haiku-5-5","generatedAt":"2026-11-20T22:19:04Z"},"euvd":{"id":"EUVD-2024-2345","exploited":false,"provenance":"source"},"lineage":{"packageHistory":[{"cve":"CVE-2023-28117","published":"2023-03-22","fixed":"1.14.0","kev":false,"link":{"from":"CVE-2023-28117","to":"CVE-2024-40647","relation":"successor","confidence":"low","kind":"sequence","evidence":[{"kind":"version-step","provenance":"source","package":"PyPI:sentry-sdk","fromFixed":"1.14.0","toFixed":"1.45.1","daysApart":484}]}},{"cve":"CVE-2024-40647","published":"2024-07-18","fixed":"2.8.0","kev":false}],"package":"PyPI:sentry-sdk"}}