sentry-python — security advisory
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.
- Products
- sentry-python
- Affected versions
- 0.12.2-1, 0.13.2-1, 1.39.2-0.1, 1.4.3-1, 1.9.10-2, 2.18.0-1, 2.22.0-1, 2.60.0-3, 2.63.0-1, 2.64.0-1
- Fixed versions
- Not specified
- CVEs
- CVE-2024-40647
- Confirmed fixed CVEs
- Not specified
- Updated in this feed
- 31 Oct 2026, 01:45 UTC · Revision 1
Source evidence
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.
osv:UBUNTU-CVE-2024-40647
sentry-python
Fixed versions: Not specified
sentry-python
Fixed versions: Not specified
sentry-python
Fixed versions: Not specified
sentry-python
Fixed versions: Not specified
sentry-python
Fixed versions: Not specified
sentry-python
Fixed versions: Not specified
Complete source record
{
"id": "ab97f0dbaa9fd5219d2a80963c4405d524c7019b2f4726a63266e264c02192d5",
"url": "https://osv.dev/vulnerability/UBUNTU-CVE-2024-40647",
"method": "structured",
"payload": {
"kind": "advisory",
"title": "UBUNTU-CVE-2024-40647",
"summary": "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.",
"evidence": "osv:UBUNTU-CVE-2024-40647",
"products": [
{
"name": {
"value": "sentry-python",
"evidence": "/affected/0/package/name"
},
"prerequisites": [],
"fixed_versions": [],
"affected_versions": [
{
"value": "0.12.2-1",
"evidence": "/affected/0/versions"
}
]
},
{
"name": {
"value": "sentry-python",
"evidence": "/affected/1/package/name"
},
"prerequisites": [],
"fixed_versions": [],
"affected_versions": [
{
"value": "0.13.2-1",
"evidence": "/affected/1/versions"
},
{
"value": "1.4.3-1",
"evidence": "/affected/1/versions"
}
]
},
{
"name": {
"value": "sentry-python",
"evidence": "/affected/2/package/name"
},
"prerequisites": [],
"fixed_versions": [],
"affected_versions": [
{
"value": "1.9.10-2",
"evidence": "/affected/2/versions"
},
{
"value": "1.39.2-0.1",
"evidence": "/affected/2/versions"
}
]
},
{
"name": {
"value": "sentry-python",
"evidence": "/affected/3/package/name"
},
"prerequisites": [],
"fixed_versions": [],
"affected_versions": [
{
"value": "2.18.0-1",
"evidence": "/affected/3/versions"
}
]
},
{
"name": {
"value": "sentry-python",
"evidence": "/affected/4/package/name"
},
"prerequisites": [],
"fixed_versions": [],
"affected_versions": [
{
"value": "2.22.0-1",
"evidence": "/affected/4/versions"
},
{
"value": "2.60.0-3",
"evidence": "/affected/4/versions"
},
{
"value": "2.63.0-1",
"evidence": "/affected/4/versions"
},
{
"value": "2.64.0-1",
"evidence": "/affected/4/versions"
}
]
},
{
"name": {
"value": "sentry-python",
"evidence": "/affected/5/package/name"
},
"prerequisites": [],
"fixed_versions": [],
"affected_versions": [
{
"value": "2.18.0-1",
"evidence": "/affected/5/versions"
},
{
"value": "2.22.0-1",
"evidence": "/affected/5/versions"
}
]
}
],
"severity": "medium",
"structured": {
"id": "UBUNTU-CVE-2024-40647",
"aliases": [
"UBUNTU-CVE-2024-40647"
],
"metrics": [
{
"type": "CVSS_V3",
"score": "CVSS:3.1/AV:L/AC:H/PR:H/UI:N/S:C/C:H/I:N/A:N"
},
{
"type": "Ubuntu",
"score": "medium"
}
],
"affected": [
{
"ranges": [
{
"type": "ECOSYSTEM",
"events": [
{
"introduced": "0"
}
]
}
],
"package": {
"name": "sentry-python",
"purl": "pkg:deb/ubuntu/sentry-python?arch=source&distro=focal",
"ecosystem": "Ubuntu:20.04:LTS"
},
"versions": [
"0.12.2-1"
],
"database_specific": {
"source": "https://github.com/canonical/ubuntu-security-notices/blob/main/osv/cve/2024/UBUNTU-CVE-2024-40647.json"
},
"ecosystem_specific": {
"binaries": [
{
"binary_name": "python3-sentry-sdk",
"binary_version": "0.12.2-1"
}
]
}
},
{
"ranges": [
{
"type": "ECOSYSTEM",
"events": [
{
"introduced": "0"
}
]
}
],
"package": {
"name": "sentry-python",
"purl": "pkg:deb/ubuntu/sentry-python?arch=source&distro=jammy",
"ecosystem": "Ubuntu:22.04:LTS"
},
"versions": [
"0.13.2-1",
"1.4.3-1"
],
"database_specific": {
"source": "https://github.com/canonical/ubuntu-security-notices/blob/main/osv/cve/2024/UBUNTU-CVE-2024-40647.json"
},
"ecosystem_specific": {
"binaries": [
{
"binary_name": "python3-sentry-sdk",
"binary_version": "1.4.3-1"
}
]
}
},
{
"ranges": [
{
"type": "ECOSYSTEM",
"events": [
{
"introduced": "0"
}
]
}
],
"package": {
"name": "sentry-python",
"purl": "pkg:deb/ubuntu/sentry-python?arch=source&distro=noble",
"ecosystem": "Ubuntu:24.04:LTS"
},
"versions": [
"1.9.10-2",
"1.39.2-0.1"
],
"database_specific": {
"source": "https://github.com/canonical/ubuntu-security-notices/blob/main/osv/cve/2024/UBUNTU-CVE-2024-40647.json"
},
"ecosystem_specific": {
"binaries": [
{
"binary_name": "python3-sentry-sdk",
"binary_version": "1.39.2-0.1"
}
]
}
},
{
"ranges": [
{
"type": "ECOSYSTEM",
"events": [
{
"introduced": "0"
}
]
}
],
"package": {
"name": "sentry-python",
"purl": "pkg:deb/ubuntu/sentry-python?arch=source&distro=questing",
"ecosystem": "Ubuntu:25.10"
},
"versions": [
"2.18.0-1"
],
"database_specific": {
"source": "https://github.com/canonical/ubuntu-security-notices/blob/main/osv/cve/2024/UBUNTU-CVE-2024-40647.json"
},
"ecosystem_specific": {
"binaries": [
{
"binary_name": "python3-sentry-sdk",
"binary_version": "2.18.0-1"
}
]
}
},
{
"ranges": [
{
"type": "ECOSYSTEM",
"events": [
{
"introduced": "0"
}
]
}
],
"package": {
"name": "sentry-python",
"purl": "pkg:deb/ubuntu/sentry-python?arch=source&distro=stonking",
"ecosystem": "Ubuntu:26.10"
},
"versions": [
"2.22.0-1",
"2.60.0-3",
"2.63.0-1",
"2.64.0-1"
],
"database_specific": {
"source": "https://github.com/canonical/ubuntu-security-notices/blob/main/osv/cve/2024/UBUNTU-CVE-2024-40647.json"
},
"ecosystem_specific": {
"binaries": [
{
"binary_name": "python3-sentry-sdk",
"binary_version": "2.64.0-1"
}
]
}
},
{
"ranges": [
{
"type": "ECOSYSTEM",
"events": [
{
"introduced": "0"
}
]
}
],
"package": {
"name": "sentry-python",
"purl": "pkg:deb/ubuntu/sentry-python?arch=source&distro=resolute",
"ecosystem": "Ubuntu:26.04:LTS"
},
"versions": [
"2.18.0-1",
"2.22.0-1"
],
"database_specific": {
"source": "https://github.com/canonical/ubuntu-security-notices/blob/main/osv/cve/2024/UBUNTU-CVE-2024-40647.json"
},
"ecosystem_specific": {
"binaries": [
{
"binary_name": "python3-sentry-sdk",
"binary_version": "2.22.0-1"
}
]
}
}
],
"modified": "2026-10-17T12:57:23.551156886Z",
"provider": "osv",
"upstream": [
"CVE-2024-40647"
],
"references": [
"https://ubuntu.com/security/CVE-2024-40647",
"https://www.cve.org/CVERecord?id=CVE-2024-40647",
"https://github.com/getsentry/sentry-python/security/advisories/GHSA-g92j-qhmh-64v2",
"https://github.com/getsentry/sentry-python/pull/3251",
"https://github.com/getsentry/sentry-python/commit/763e40aa4cb57ecced467f48f78f335c87e9bdff",
"https://docs.python.org/3/library/subprocess.html",
"https://docs.sentry.io/platforms/python/integrations/default-integrations",
"https://docs.sentry.io/platforms/python/integrations/default-integrations/#stdlib",
"https://github.com/getsentry/sentry-python/releases/tag/2.8.0"
]
},
"related_cves": [
{
"value": "CVE-2024-40647",
"evidence": "/upstream"
}
],
"security_relevant": true,
"severity_evidence": "/severity/0/score"
},
"source_id": "core-osv",
"document_id": 357399,
"published_at": "2024-07-18T17:15:00+00:00"
}