{"answers":{"affected":"5 open source packages ship an affected version, including sentry-sdk.","exploited":"There is no known exploitation of CVE-2024-40647 in the wild and no public exploit code.","fix":"Upgrade sentry-sdk to a fixed version for your release line: 1.45.1 or 2.8.0.","what":"CVE-2024-40647 is a medium-severity vulnerability in getsentry sentry-python, published on 18 Jul 2024. It can only be exploited from the same machine or local network, with no action from the victim."},"fix_prompt":"Check this codebase for CVE-2024-40647 and fix it if it is affected.\n\nWhat it is: CVE-2024-40647 is a medium-severity vulnerability in getsentry sentry-python, published on 18 Jul 2024. It can only be exploited from the same machine or local network, with no action from the victim.\nExploitation: There is no known exploitation of CVE-2024-40647 in the wild and no public exploit code.\n\nAffected packages and fixed versions:\n- sentry-sdk (PyPI): affected all versions; fixed in 1.45.1, 2.8.0\n- sentry-sdk (PyPI): affected all versions; fixed in 1.45.1\n- sentry-sdk (PyPI): affected all versions; fixed in 1.45.1\n- sentry-sdk (PyPI): affected from 2.0.0a1; fixed in 2.8.0\n- sentry-sdk (PyPI): affected from 2.0.0a1; fixed in 2.8.0\n\nTask:\n1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.\n2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.\n3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.\n4. Run the tests and summarise what changed and why.\n5. If nothing in the project is affected, say so and change nothing.\n\nReference: https://insights.sbomify.com/CVE-2024-40647/ (Markdown: https://insights.sbomify.com/CVE-2024-40647/index.md)","id":"CVE-2024-40647","markdown":"https://insights.sbomify.com/CVE-2024-40647/index.md","name":"CVE-2024-40647","record":{"aliases":["DEBIAN-CVE-2024-40647","GHSA-g92j-qhmh-64v2","PYSEC-2026-1917","UBUNTU-CVE-2024-40647","openSUSE-SU-2024:0214-1","openSUSE-SU-2024:14209-1","openSUSE-SU-2026:11425-1"],"analysis":{"component_type":"library","fix_type":"upgrade","impacts":["data_read"],"network_reachable":"adjacent_or_local","non_default_config":false,"product_category":"Python Sentry SDK","requires_auth":"high_privilege","summary":"The Sentry Python SDK unintentionally exposes environment variables to subprocesses, potentially leaking sensitive data to child processes.","user_interaction":"not_required","vuln_class":"information_disclosure"},"analysis_generated_by":"qwen3.8-flash-next","assigner":"GitHub_M","cpe":[],"cvss":{"score":5.3,"severity":"medium","source":"cna","vector":"CVSS:3.1/AV:L/AC:H/PR:H/UI:N/S:C/C:H/I:N/A:N","version":"3.1"},"cwes":[{"id":"CWE-200","name":"Exposure of Sensitive Information to an Unauthorized Actor"}],"description":"sentry-sdk is the official Python SDK for Sentry.io. A bug in Sentry's Python SDK \u003c 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.","ecosystems":["PyPI","SUSE:Package Hub 15 SP5","openSUSE:Leap 15.5","openSUSE:Tumbleweed"],"exploits":{"exploitdb":0,"first_seen":null,"github_poc":0,"max_poc_stars":null,"metasploit":0,"nuclei":0,"refs":[],"tier":"none_known"},"has_fix":true,"headline":"Unintentional exposure of environment variables to subprocesses in sentry-sdk","id":"CVE-2024-40647","indexable":true,"kev":null,"kind":"cve","links":{"ecosystem":"PyPI","product":null,"products":[],"type":"information_disclosure","year":"2024"},"n_packages":9,"n_references":7,"next":{"headline":"matrix-sdk-crypto's `UserIdentity::is_verified` not checking verification status of own user identity while performing the check","id":"CVE-2024-40648"},"packages":[{"ecosystem":"PyPI","fixed":["1.45.1","2.8.0"],"introduced":["0","2.0.0a1"],"last_affected":[],"package":"sentry-sdk","purl":"pkg:pypi/sentry-sdk","source":"PYSEC-2026-1917"},{"ecosystem":"PyPI","fixed":["1.45.1"],"introduced":["0"],"last_affected":[],"package":"sentry-sdk","purl":null,"source":"GHSA-g92j-qhmh-64v2"},{"ecosystem":"PyPI","fixed":["1.45.1"],"introduced":["0"],"last_affected":[],"package":"sentry-sdk","purl":"pkg:pypi/sentry-sdk","source":"GHSA-g92j-qhmh-64v2"},{"ecosystem":"PyPI","fixed":["2.8.0"],"introduced":["2.0.0a1"],"last_affected":[],"package":"sentry-sdk","purl":null,"source":"GHSA-g92j-qhmh-64v2"},{"ecosystem":"PyPI","fixed":["2.8.0"],"introduced":["2.0.0a1"],"last_affected":[],"package":"sentry-sdk","purl":"pkg:pypi/sentry-sdk","source":"GHSA-g92j-qhmh-64v2"},{"ecosystem":"SUSE:Package Hub 15 SP5","fixed":["0.14.4-bp155.3.3.1"],"introduced":["0"],"last_affected":[],"package":"python-sentry-sdk","purl":"pkg:rpm/suse/python-sentry-sdk\u0026distro=SUSE%20Package%20Hub%2015%20SP5","source":"openSUSE-SU-2024:0214-1"},{"ecosystem":"openSUSE:Leap 15.5","fixed":["0.14.4-bp155.3.3.1"],"introduced":["0"],"last_affected":[],"package":"python-sentry-sdk","purl":"pkg:rpm/opensuse/python-sentry-sdk\u0026distro=openSUSE%20Leap%2015.5","source":"openSUSE-SU-2024:0214-1"},{"ecosystem":"openSUSE:Tumbleweed","fixed":["2.10.0-1.1"],"introduced":["0"],"last_affected":[],"package":"python-sentry-sdk","purl":"pkg:rpm/opensuse/python-sentry-sdk\u0026distro=openSUSE%20Tumbleweed","source":"openSUSE-SU-2024:14209-1"},{"ecosystem":"openSUSE:Tumbleweed","fixed":["2.66.1-1.1"],"introduced":["0"],"last_affected":[],"package":"python-sentry-sdk","purl":"pkg:rpm/opensuse/python-sentry-sdk\u0026distro=openSUSE%20Tumbleweed","source":"openSUSE-SU-2026:11425-1"}],"prev":{"headline":"Vertex Vulnerable to Path Traversal","id":"CVE-2024-40646"},"products":["sentry-python"],"published":"2024-07-18","related":[],"sources":[{"class":"attribution","licence":"CVE Terms of Use (MITRE)","name":"CVE List","prefix":"CVE"},{"class":"attribution","licence":"CC BY 4.0","name":"GitHub Advisory Database","prefix":"GHSA"},{"class":"attribution","licence":"CC BY 4.0","name":"PyPA Advisory Database","prefix":"PYSEC"},{"class":"attribution","licence":"CC BY 4.0","name":"SUSE","prefix":"openSUSE"},{"class":"attribution","licence":"CWE Terms of Use","name":"CWE (MITRE)"},{"class":"attribution","licence":"FIRST CVSS licence","name":"CVSS (FIRST)"}],"ssvc":{"automatable":"no","exploitation":"none","technical_impact":"partial"},"state":"PUBLISHED","updated":"2026-06-01","vendors":["getsentry"]},"summary":"The Sentry Python SDK unintentionally exposes environment variables to subprocesses, potentially leaking sensitive data to child processes.","url":"https://insights.sbomify.com/CVE-2024-40647/"}