CVE-2024-40647

Unintentional exposure of environment variables to subprocesses in sentry-sdk

MEDIUM
5.3
CVSS Score
Published: July 18, 2024 at 04:51 PM UTC
Updated: June 17, 2026 at 07:46 AM UTC
1 product affected across 1 vendorSentry Software Development Kit

Using sentry-python by getsentry?

Get instant alerts when new vulnerabilities affect sentry-python - before attackers find them.

Real-time alertsTrack your software stackFree plan available
Severity
MEDIUM5.3
Exploit prediction
EPSS 0.2%
SSVC
No known exploit

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.

Affected

Our own answer: ranges merged, affected separated from platform-only, with confidence and review flags.

v < 2.8.0
Affected range stops below 2.8.0, so it looks safe — our inference, not a vendor statement

Remediation

No guide yet

No remediation guidance has been written for this CVE yet, and no fixed version or vendor advisory is recorded against it.

SSVC — Action Prioritization

SSVCNo known exploitNot automatablePartial impact

SSVC signals action urgency (what to patch first), separate from CVSS which measures severity.

CVSS

5.3MEDIUMGitHub_M
Attack Vector
LOCAL
Complexity
HIGH
Privileges
HIGH
User Interaction
NONE
Scope
CHANGED
Confidentiality
HIGH
Integrity
NONE
Availability
NONE
Vector?

Quick Info

StatusDEFERRED
CWE
CWE-200

Get alerted

Stop reading CVE feeds looking for your own stack

Track the products you run and VulnTracker tells you when a new CVE affects them — with what is known about fixing it, and nothing about the rest.

Free plan, no card