CVE intelligence and bounded remediation

CVE-2024-40647 — sentry-sdk is the official Python SDK for Sentry.io

Medium CVSS 5.3

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.

Severity
Medium
CVSS
5.3 (3.1)
Published
2024-07-18
CISA KEV
Not currently listed
Ecosystem
python/pypi
Weaknesses
CWE-200

Affected products

No browser-safe affected-product rows are available.

Matched remediation archetype

Information disclosure and sensitive data exposure

This catalog composition supplies bounded fallback guidance. Explicitly reviewed curated workflows load with the complete record below.

Check exposure

  • Trace sensitive data through responses, errors, logs, metrics, traces, caches, exports, files, backups, and client bundles.
  • Identify affected subjects, tenants, retention windows, access controls, and downstream copies without opening unnecessary sensitive records.
  • Review metadata, timing, status, length, and existence signals as well as direct content disclosure.

Remediate safely

  • Minimize collection and output, apply field-level authorization and redaction at a centralized boundary, and return generic external errors.
  • Remove secrets and sensitive data from logs, artifacts, URLs, caches, and client-side bundles; rotate credentials that may have been exposed.
  • Update the affected component and add synthetic-data tests for response, error, observability, and export paths.

Authoritative sources

Complete CVE record and remediation plan

The detailed catalog view below loads this exact record, its source evidence, and the full seven-phase agentic change plan.