Skip to main content
EPSS 0.2%top 90%

CVE-2024-40647: CWE-200: Exposure of Sensitive Information to an Unauthorized Actor in getsentry sentry-python

0
Medium
VulnerabilityCVE-2024-40647cvecve-2024-40647cwe-200
Published: 07/18/2024 (07/18/2024, 16:51:23 UTC)
Source: CVE Database V5
Vendor/Project: getsentry
Product: sentry-python

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.

CVSS v3.1

Score 5.3medium

Attack Vector
Local
Attack Complexity
High
Privileges Required
High
User Interaction
None
Scope
Changed
Confidentiality
High
Integrity
None
Availability
None
CVSS:3.1/AV:L/AC:H/PR:H/UI:N/S:C/C:H/I:N/A:N

Affected software

sentry-sdk
pkg:pypi/sentry-sdk
Affected versions
<2.8.0

Run on your own infrastructure? Check whether these packages are installed with threat-finder — our free open-source scanner.

AI-Powered Analysis

Machine-generated threat intelligence

AILast updated: 06/01/2026, 20:04:33 UTC

Technical Analysis

The sentry-python SDK before version 2.8.0 contains a bug where environment variables are passed to subprocesses even when the subprocess call explicitly sets env={} to prevent this. This behavior is caused by the Stdlib integration enabled by default in the SDK. The unintended passing of environment variables can expose sensitive information to subprocesses that should not receive it. The issue is tracked as CVE-2024-40647 and classified under CWE-200 (Exposure of Sensitive Information). The vulnerability was patched in pull request #3251 and included in sentry-sdk version 2.8.0.

Potential Impact

Sensitive environment variables may be exposed to subprocesses spawned by applications using vulnerable versions of sentry-python SDK. This exposure could lead to unauthorized access to sensitive data contained in environment variables. The CVSS score of 5.3 (medium severity) reflects that the attack vector requires local access with high privileges and no user interaction, and the impact is limited to confidentiality without affecting integrity or availability.

Mitigation Recommendations

A fix is available in sentry-python SDK version 2.8.0. Users should upgrade to version 2.8.0 or later to resolve this vulnerability. If upgrading is not possible, users can mitigate the risk by disabling all default integrations in the SDK to prevent environment variables from being passed to subprocesses. There is no indication that the vulnerability is mitigated by default or that no action is required.

Pro Console: star threats, build custom feeds, automate alerts via Slack, email & webhooks.Upgrade to Pro

Technical Details

Data Version
5.2
Assigner Short Name
GitHub_M
Date Reserved
2024-07-08T16:13:15.512Z
Cvss Version
3.1
State
PUBLISHED

Threat ID: 6a1de30ee29bf47b503a5814

Added to database: 06/01/2026, 19:52:46 UTC

Last enriched: 06/01/2026, 20:04:33 UTC

Last updated: 09/10/2026, 19:36:48 UTC

Views: 105

Community Reviews

0 reviews

Crowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.

Sort by
Loading community insights…

Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.

Actions

PRO

Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.

Please log in to the Console to use AI analysis features.

Need more coverage?

Upgrade to Pro Console for AI refresh and higher limits.

For incident response and remediation, OffSeq services can help resolve threats faster.

Latest Threats

Breach by OffSeqOFFSEQFRIENDS — 25% OFF

Check if your credentials are on the dark web

Instant breach scanning across billions of leaked records. Free tier available.

Scan now
OffSeq TrainingCredly Certified

Lead Pen Test Professional

Technical5-day eLearningPECB Accredited
View courses