Information Disclosure in sentry-sdk (CVE-2024-40647)
Summary
Vulnerability in sentry-sdk (CVE-2024-40647). Risk of unauthorized operations or information disclosure. Exploitable via subprocess. Mitigation: upgrade to 1.45.1 or later.
Original description
The description as published by the source.
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.
Source: NIST National Vulnerability Database NVD GitHub Advisory
Auto-generated summary
Assembled by SecPulse from the source data (CVSS, CWE, affected versions) using templates — no AI involved. Check the original description and references below for exact details.
A vulnerability tracked as CVE-2024-40647 has been found in sentry-sdk.
Attackers can target a specific entry point like subprocess over the network to misuse the product.
Risk of unauthorized operations or information disclosure. CVSS score: 5.3/10.
What to do: upgrade sentry-sdk to 1.45.1 or later.
If unsure, ask your IT team or search "sentry-sdk CVE-2024-40647" on the vendor's site.
CVE-2024-40647 (sentry-sdk) — CWE-200 / CVSS v3 5.3
Attack vector: local / no user interaction
Attack surface: subprocess / env
Patched: 1.45.1 — apply immediately
Plan: 1) Audit SBOM/dependencies, 2) Stage→prod upgrade, 3) Add WAF/proxy monitoring on affected endpoints, 4) Hunt IOCs in logs.
Refs: see the GHSA / vendor advisory / patched release linked on this page.
Information disclosure (CWE-200) exists in sentry-sdk. Attackers reach the vulnerable code path via subprocess.
Check the vendor advisory for the affected versions of sentry-sdk. Attack surface: subprocess / env.
Severity: Medium (CVSS 5.3/10). Risk of unauthorized operations or information disclosure.
Update to 1.45.1.
Until the patch is applied: disable the affected feature, apply WAF rules, or restrict access via network ACLs.
Search webserver/proxy logs for unusual request patterns matching this CVE's known IOCs. Run grep -r 'sentry-sdk' . against your dependency files (package-lock.json, requirements.txt, go.sum) to find affected services.
Response actions
Concrete steps and command examples for SOC/SRE teams to execute in order
-
1Identify exposure identify
grep -r 'sentry-sdk' . | grep -v node_modulesリポジトリと本番環境の依存ファイル (package-lock.json / requirements.txt / go.sum / Gemfile.lock 等) で
sentry-sdkを grep し、稼働しているサービス・バージョンを把握する。 -
2Apply patch patch
Upgrade sentry-sdk to 1.45.1ステージング環境で 1.45.1 に上げて回帰テスト → 本番反映。回帰テストはアプリの主要ハッピーパスを含めること。
-
3Post-deployment verification verify
Confirm patched version is live in productionパッチ適用後、ステージングで PoC または同等の悪用パターンを再現して脆弱性が閉じたことを確認。本番ではアクセスログ・WAF でアラート再発が無いか継続監視。
Affected packages
Fix status by distribution
Fixed packages published by each distribution for this CVE
- Debian DEBIAN-CVE-2024-40647 sentry-python Fixed in: 0.13.2-1+deb11u1
- Ubuntu UBUNTU-CVE-2024-40647 sentry-python
References
- advisory github.com
- advisory nvd.nist.gov
- advisory github.com
- advisory github.com
- package github.com
- package pypi.org
- patch github.com
- patch github.com
- web docs.python.org
- web docs.sentry.io
- web docs.sentry.io
- web github.com
- web lists.debian.org
- web github.com