{"api_version":"1","generated_at":"2026-06-03T06:13:04+00:00","cve":"CVE-2024-40647","urls":{"html":"https://cve.report/CVE-2024-40647","api":"https://cve.report/api/cve/CVE-2024-40647.json","docs":"https://cve.report/api","cve_org":"https://www.cve.org/CVERecord?id=CVE-2024-40647","nvd":"https://nvd.nist.gov/vuln/detail/CVE-2024-40647"},"summary":{"title":"Unintentional exposure of environment variables to subprocesses in sentry-sdk","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.","state":"PUBLISHED","assigner":"GitHub_M","published_at":"2024-07-18 17:15:05","updated_at":"2026-06-01 08:16:17"},"problem_types":["CWE-200","CWE-200 CWE-200: Exposure of Sensitive Information to an Unauthorized Actor"],"metrics":[{"version":"3.1","source":"security-advisories@github.com","type":"Secondary","score":"5.3","severity":"MEDIUM","vector":"CVSS:3.1/AV:L/AC:H/PR:H/UI:N/S:C/C:H/I:N/A:N","data":{"version":"3.1","vectorString":"CVSS:3.1/AV:L/AC:H/PR:H/UI:N/S:C/C:H/I:N/A:N","baseScore":5.3,"baseSeverity":"MEDIUM","attackVector":"LOCAL","attackComplexity":"HIGH","privilegesRequired":"HIGH","userInteraction":"NONE","scope":"CHANGED","confidentialityImpact":"HIGH","integrityImpact":"NONE","availabilityImpact":"NONE"}},{"version":"3.1","source":"CNA","type":"DECLARED","score":"5.3","severity":"MEDIUM","vector":"CVSS:3.1/AV:L/AC:H/PR:H/UI:N/S:C/C:H/I:N/A:N","data":{"attackComplexity":"HIGH","attackVector":"LOCAL","availabilityImpact":"NONE","baseScore":5.3,"baseSeverity":"MEDIUM","confidentialityImpact":"HIGH","integrityImpact":"NONE","privilegesRequired":"HIGH","scope":"CHANGED","userInteraction":"NONE","vectorString":"CVSS:3.1/AV:L/AC:H/PR:H/UI:N/S:C/C:H/I:N/A:N","version":"3.1"}}],"references":[{"url":"https://github.com/getsentry/sentry-python/releases/tag/2.8.0","name":"https://github.com/getsentry/sentry-python/releases/tag/2.8.0","refsource":"af854a3a-2127-422b-91ae-364da2661108","tags":[],"title":"","mime":"","httpstatus":"","archivestatus":"0"},{"url":"https://github.com/getsentry/sentry-python/security/advisories/GHSA-g92j-qhmh-64v2","name":"https://github.com/getsentry/sentry-python/security/advisories/GHSA-g92j-qhmh-64v2","refsource":"af854a3a-2127-422b-91ae-364da2661108","tags":[],"title":"","mime":"","httpstatus":"","archivestatus":"0"},{"url":"https://lists.debian.org/debian-lts-announce/2026/06/msg00001.html","name":"https://lists.debian.org/debian-lts-announce/2026/06/msg00001.html","refsource":"af854a3a-2127-422b-91ae-364da2661108","tags":[],"title":"","mime":"","httpstatus":"","archivestatus":"0"},{"url":"https://docs.sentry.io/platforms/python/integrations/default-integrations","name":"https://docs.sentry.io/platforms/python/integrations/default-integrations","refsource":"af854a3a-2127-422b-91ae-364da2661108","tags":[],"title":"","mime":"","httpstatus":"","archivestatus":"0"},{"url":"https://github.com/getsentry/sentry-python/commit/763e40aa4cb57ecced467f48f78f335c87e9bdff","name":"https://github.com/getsentry/sentry-python/commit/763e40aa4cb57ecced467f48f78f335c87e9bdff","refsource":"af854a3a-2127-422b-91ae-364da2661108","tags":[],"title":"","mime":"","httpstatus":"","archivestatus":"0"},{"url":"https://docs.sentry.io/platforms/python/integrations/default-integrations/#stdlib","name":"https://docs.sentry.io/platforms/python/integrations/default-integrations/#stdlib","refsource":"af854a3a-2127-422b-91ae-364da2661108","tags":[],"title":"","mime":"","httpstatus":"","archivestatus":"0"},{"url":"https://docs.python.org/3/library/subprocess.html","name":"https://docs.python.org/3/library/subprocess.html","refsource":"af854a3a-2127-422b-91ae-364da2661108","tags":[],"title":"","mime":"","httpstatus":"","archivestatus":"0"},{"url":"https://github.com/getsentry/sentry-python/pull/3251","name":"https://github.com/getsentry/sentry-python/pull/3251","refsource":"af854a3a-2127-422b-91ae-364da2661108","tags":[],"title":"","mime":"","httpstatus":"","archivestatus":"0"},{"url":"https://www.cve.org/CVERecord?id=CVE-2024-40647","name":"CVE Program record","refsource":"CVE.ORG","tags":["canonical"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2024-40647","name":"NVD vulnerability detail","refsource":"NVD","tags":["canonical","analysis"]}],"affected":[{"source":"CNA","vendor":"getsentry","product":"sentry-python","version":"affected < 2.8.0","platforms":[]}],"timeline":[],"solutions":[],"workarounds":[],"exploits":[],"credits":[],"nvd_cpes":[],"vendor_comments":[],"enrichments":{"kev":null,"epss":{"cve_year":"2024","cve_id":"40647","cve":"CVE-2024-40647","epss":"0.000280000","percentile":"0.085620000","score_date":"2026-06-02","updated_at":"2026-06-03 00:08:16"},"legacy_qids":[]},"source_records":{"cve_program":{"containers":{"adp":[{"metrics":[{"other":{"content":{"id":"CVE-2024-40647","options":[{"Exploitation":"none"},{"Automatable":"no"},{"Technical Impact":"partial"}],"role":"CISA Coordinator","timestamp":"2024-07-18T17:57:48.623412Z","version":"2.0.3"},"type":"ssvc"}}],"providerMetadata":{"dateUpdated":"2024-07-18T17:57:55.364Z","orgId":"134c704f-9b21-4f2e-91b3-4a467353bcc0","shortName":"CISA-ADP"},"title":"CISA ADP Vulnrichment"},{"providerMetadata":{"dateUpdated":"2026-06-01T05:37:14.536Z","orgId":"af854a3a-2127-422b-91ae-364da2661108","shortName":"CVE"},"references":[{"name":"https://github.com/getsentry/sentry-python/security/advisories/GHSA-g92j-qhmh-64v2","tags":["x_refsource_CONFIRM","x_transferred"],"url":"https://github.com/getsentry/sentry-python/security/advisories/GHSA-g92j-qhmh-64v2"},{"name":"https://github.com/getsentry/sentry-python/pull/3251","tags":["x_refsource_MISC","x_transferred"],"url":"https://github.com/getsentry/sentry-python/pull/3251"},{"name":"https://github.com/getsentry/sentry-python/commit/763e40aa4cb57ecced467f48f78f335c87e9bdff","tags":["x_refsource_MISC","x_transferred"],"url":"https://github.com/getsentry/sentry-python/commit/763e40aa4cb57ecced467f48f78f335c87e9bdff"},{"name":"https://docs.python.org/3/library/subprocess.html","tags":["x_refsource_MISC","x_transferred"],"url":"https://docs.python.org/3/library/subprocess.html"},{"name":"https://docs.sentry.io/platforms/python/integrations/default-integrations","tags":["x_refsource_MISC","x_transferred"],"url":"https://docs.sentry.io/platforms/python/integrations/default-integrations"},{"name":"https://docs.sentry.io/platforms/python/integrations/default-integrations/#stdlib","tags":["x_refsource_MISC","x_transferred"],"url":"https://docs.sentry.io/platforms/python/integrations/default-integrations/#stdlib"},{"name":"https://github.com/getsentry/sentry-python/releases/tag/2.8.0","tags":["x_refsource_MISC","x_transferred"],"url":"https://github.com/getsentry/sentry-python/releases/tag/2.8.0"},{"url":"https://lists.debian.org/debian-lts-announce/2026/06/msg00001.html"}],"title":"CVE Program Container"}],"cna":{"affected":[{"product":"sentry-python","vendor":"getsentry","versions":[{"status":"affected","version":"< 2.8.0"}]}],"descriptions":[{"lang":"en","value":"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"}],"metrics":[{"cvssV3_1":{"attackComplexity":"HIGH","attackVector":"LOCAL","availabilityImpact":"NONE","baseScore":5.3,"baseSeverity":"MEDIUM","confidentialityImpact":"HIGH","integrityImpact":"NONE","privilegesRequired":"HIGH","scope":"CHANGED","userInteraction":"NONE","vectorString":"CVSS:3.1/AV:L/AC:H/PR:H/UI:N/S:C/C:H/I:N/A:N","version":"3.1"}}],"problemTypes":[{"descriptions":[{"cweId":"CWE-200","description":"CWE-200: Exposure of Sensitive Information to an Unauthorized Actor","lang":"en","type":"CWE"}]}],"providerMetadata":{"dateUpdated":"2024-07-18T16:51:23.539Z","orgId":"a0819718-46f1-4df5-94e2-005712e83aaa","shortName":"GitHub_M"},"references":[{"name":"https://github.com/getsentry/sentry-python/security/advisories/GHSA-g92j-qhmh-64v2","tags":["x_refsource_CONFIRM"],"url":"https://github.com/getsentry/sentry-python/security/advisories/GHSA-g92j-qhmh-64v2"},{"name":"https://github.com/getsentry/sentry-python/pull/3251","tags":["x_refsource_MISC"],"url":"https://github.com/getsentry/sentry-python/pull/3251"},{"name":"https://github.com/getsentry/sentry-python/commit/763e40aa4cb57ecced467f48f78f335c87e9bdff","tags":["x_refsource_MISC"],"url":"https://github.com/getsentry/sentry-python/commit/763e40aa4cb57ecced467f48f78f335c87e9bdff"},{"name":"https://docs.python.org/3/library/subprocess.html","tags":["x_refsource_MISC"],"url":"https://docs.python.org/3/library/subprocess.html"},{"name":"https://docs.sentry.io/platforms/python/integrations/default-integrations","tags":["x_refsource_MISC"],"url":"https://docs.sentry.io/platforms/python/integrations/default-integrations"},{"name":"https://docs.sentry.io/platforms/python/integrations/default-integrations/#stdlib","tags":["x_refsource_MISC"],"url":"https://docs.sentry.io/platforms/python/integrations/default-integrations/#stdlib"},{"name":"https://github.com/getsentry/sentry-python/releases/tag/2.8.0","tags":["x_refsource_MISC"],"url":"https://github.com/getsentry/sentry-python/releases/tag/2.8.0"}],"source":{"advisory":"GHSA-g92j-qhmh-64v2","discovery":"UNKNOWN"},"title":"Unintentional exposure of environment variables to subprocesses in sentry-sdk"}},"cveMetadata":{"assignerOrgId":"a0819718-46f1-4df5-94e2-005712e83aaa","assignerShortName":"GitHub_M","cveId":"CVE-2024-40647","datePublished":"2024-07-18T16:51:23.539Z","dateReserved":"2024-07-08T16:13:15.512Z","dateUpdated":"2026-06-01T05:37:14.536Z","state":"PUBLISHED"},"dataType":"CVE_RECORD","dataVersion":"5.2"},"nvd":{"publishedDate":"2024-07-18 17:15:05","lastModifiedDate":"2026-06-01 08:16:17","problem_types":["CWE-200","CWE-200 CWE-200: Exposure of Sensitive Information to an Unauthorized Actor"],"metrics":{"cvssMetricV31":[{"source":"security-advisories@github.com","type":"Secondary","cvssData":{"version":"3.1","vectorString":"CVSS:3.1/AV:L/AC:H/PR:H/UI:N/S:C/C:H/I:N/A:N","baseScore":5.3,"baseSeverity":"MEDIUM","attackVector":"LOCAL","attackComplexity":"HIGH","privilegesRequired":"HIGH","userInteraction":"NONE","scope":"CHANGED","confidentialityImpact":"HIGH","integrityImpact":"NONE","availabilityImpact":"NONE"},"exploitabilityScore":0.8,"impactScore":4}]},"configurations":[]},"legacy_mitre":{"record":{"CveYear":"2024","CveId":"40647","Ordinal":"1","Title":"Unintentional exposure of environment variables to subprocesses ","CVE":"CVE-2024-40647","Year":"2024"},"notes":[{"CveYear":"2024","CveId":"40647","Ordinal":"1","NoteData":"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.","Type":"Description","Title":"Unintentional exposure of environment variables to subprocesses "}]}}}