{
    "dataType": "CVE_RECORD",
    "dataVersion": "5.1",
    "cveMetadata": {
        "cveId": "CVE-2024-40647",
        "assignerOrgId": "a0819718-46f1-4df5-94e2-005712e83aaa",
        "state": "PUBLISHED",
        "assignerShortName": "GitHub_M",
        "dateReserved": "2024-07-08T16:13:15.512Z",
        "datePublished": "2024-07-18T16:51:23.539Z",
        "dateUpdated": "2024-08-02T04:33:11.814Z"
    },
    "containers": {
        "cna": {
            "title": "Unintentional exposure of environment variables to subprocesses in sentry-sdk",
            "problemTypes": [
                {
                    "descriptions": [
                        {
                            "cweId": "CWE-200",
                            "lang": "en",
                            "description": "CWE-200: Exposure of Sensitive Information to an Unauthorized Actor",
                            "type": "CWE"
                        }
                    ]
                }
            ],
            "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"
                    }
                }
            ],
            "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"
                }
            ],
            "affected": [
                {
                    "vendor": "getsentry",
                    "product": "sentry-python",
                    "versions": [
                        {
                            "version": "< 2.8.0",
                            "status": "affected"
                        }
                    ]
                }
            ],
            "providerMetadata": {
                "orgId": "a0819718-46f1-4df5-94e2-005712e83aaa",
                "shortName": "GitHub_M",
                "dateUpdated": "2024-07-18T16:51:23.539Z"
            },
            "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"
                }
            ],
            "source": {
                "advisory": "GHSA-g92j-qhmh-64v2",
                "discovery": "UNKNOWN"
            }
        },
        "adp": [
            {
                "metrics": [
                    {
                        "other": {
                            "type": "ssvc",
                            "content": {
                                "timestamp": "2024-07-18T17:57:48.623412Z",
                                "id": "CVE-2024-40647",
                                "options": [
                                    {
                                        "Exploitation": "none"
                                    },
                                    {
                                        "Automatable": "no"
                                    },
                                    {
                                        "Technical Impact": "partial"
                                    }
                                ],
                                "role": "CISA Coordinator",
                                "version": "2.0.3"
                            }
                        }
                    }
                ],
                "title": "CISA ADP Vulnrichment",
                "providerMetadata": {
                    "orgId": "134c704f-9b21-4f2e-91b3-4a467353bcc0",
                    "shortName": "CISA-ADP",
                    "dateUpdated": "2024-07-18T17:57:55.364Z"
                }
            },
            {
                "providerMetadata": {
                    "orgId": "af854a3a-2127-422b-91ae-364da2661108",
                    "shortName": "CVE",
                    "dateUpdated": "2024-08-02T04:33:11.814Z"
                },
                "title": "CVE Program Container",
                "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"
                    }
                ]
            }
        ]
    }
}