liqd / tempelhof

Project website for the civic participation website for Tempelhofer Feld in Berlin
https://tempelhofer-feld.berlin.de/
1 stars 1 forks source link

chore(deps): update dependency sentry-sdk to v2.8.0 [security] #592

Open renovate[bot] opened 3 months ago

renovate[bot] commented 3 months ago

This PR contains the following updates:

Package Change Age Adoption Passing Confidence
sentry-sdk (changelog) ==2.7.0 -> ==2.8.0 age adoption passing confidence

GitHub Vulnerability Alerts

CVE-2024-40647

Impact

The bug in Sentry's Python SDK <2.8.0 results in the unintentional exposure of environment variables to subprocesses despite the env={} setting.

Details

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, like in this example:

>>> subprocess.check_output(["env"], env={"TEST":"1"})
b'TEST=1\n'

If you'd want to not pass any variables, you can set an empty dict:

>>> subprocess.check_output(["env"], env={})
b''

However, the bug in Sentry SDK <2.8.0 causes all environment variables to be passed to the subprocesses when env={} is set, unless the Sentry SDK's Stdlib integration is disabled. The Stdlib integration is enabled by default.

Patches

The issue has been patched in https://github.com/getsentry/sentry-python/pull/3251 and the fix released in sentry-sdk==2.8.0. The fix was also backported to sentry-sdk==1.45.1.

Workarounds

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, there are two options:

  1. In your application, replace env={} with the minimal dict env={"EMPTY_ENV":"1"} or similar.

OR

  1. Disable Stdlib integration:
    
    import sentry_sdk

Should go before sentry_sdk.init

sentry_sdk.integrations._DEFAULT_INTEGRATIONS.remove("sentry_sdk.integrations.stdlib.StdlibIntegration")

sentry_sdk.init(...)



### References
* Sentry docs: [Default integrations](https://docs.sentry.io/platforms/python/integrations/default-integrations/)
* Python docs: [subprocess module](https://docs.python.org/3/library/subprocess.html)
* Patch [https://github.com/getsentry/sentry-python/pull/3251](https://redirect.github.com/getsentry/sentry-python/pull/3251)

---

### Release Notes

<details>
<summary>getsentry/sentry-python (sentry-sdk)</summary>

### [`v2.8.0`](https://redirect.github.com/getsentry/sentry-python/blob/HEAD/CHANGELOG.md#280)

[Compare Source](https://redirect.github.com/getsentry/sentry-python/compare/2.7.1...2.8.0)

##### Various fixes & improvements

-   `profiler_id` uses underscore ([#&#8203;3249](https://redirect.github.com/getsentry/sentry-python/issues/3249)) by [@&#8203;Zylphrex](https://redirect.github.com/Zylphrex)
-   Don't send full env to subprocess ([#&#8203;3251](https://redirect.github.com/getsentry/sentry-python/issues/3251)) by [@&#8203;kmichel-aiven](https://redirect.github.com/kmichel-aiven)
-   Stop using `Hub` in `HttpTransport` ([#&#8203;3247](https://redirect.github.com/getsentry/sentry-python/issues/3247)) by [@&#8203;szokeasaurusrex](https://redirect.github.com/szokeasaurusrex)
-   Remove `ipdb` from test requirements ([#&#8203;3237](https://redirect.github.com/getsentry/sentry-python/issues/3237)) by [@&#8203;rominf](https://redirect.github.com/rominf)
-   Avoid propagation of empty baggage ([#&#8203;2968](https://redirect.github.com/getsentry/sentry-python/issues/2968)) by [@&#8203;hartungstenio](https://redirect.github.com/hartungstenio)
-   Add entry point for `SentryPropagator` ([#&#8203;3086](https://redirect.github.com/getsentry/sentry-python/issues/3086)) by [@&#8203;mender](https://redirect.github.com/mender)
-   Bump checkouts/data-schemas from `8c13457` to `88273a9` ([#&#8203;3225](https://redirect.github.com/getsentry/sentry-python/issues/3225)) by [@&#8203;dependabot](https://redirect.github.com/dependabot)

### [`v2.7.1`](https://redirect.github.com/getsentry/sentry-python/blob/HEAD/CHANGELOG.md#271)

[Compare Source](https://redirect.github.com/getsentry/sentry-python/compare/2.7.0...2.7.1)

##### Various fixes & improvements

-   fix(otel): Fix missing baggage ([#&#8203;3218](https://redirect.github.com/getsentry/sentry-python/issues/3218)) by [@&#8203;sentrivana](https://redirect.github.com/sentrivana)
-   This is the config file of asdf-vm which we do not use. ([#&#8203;3215](https://redirect.github.com/getsentry/sentry-python/issues/3215)) by [@&#8203;antonpirker](https://redirect.github.com/antonpirker)
-   Added option to disable middleware spans in Starlette ([#&#8203;3052](https://redirect.github.com/getsentry/sentry-python/issues/3052)) by [@&#8203;antonpirker](https://redirect.github.com/antonpirker)
-   build: Update tornado version in setup.py to match code check. ([#&#8203;3206](https://redirect.github.com/getsentry/sentry-python/issues/3206)) by [@&#8203;aclemons](https://redirect.github.com/aclemons)

</details>

---

### Configuration

šŸ“… **Schedule**: Branch creation - "" (UTC), Automerge - At any time (no schedule defined).

šŸš¦ **Automerge**: Disabled by config. Please merge this manually once you are satisfied.

ā™» **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

šŸ”• **Ignore**: Close this PR and you won't be reminded about this update again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box

---

This PR was generated by [Mend Renovate](https://mend.io/renovate/). View the [repository job log](https://developer.mend.io/github/liqd/tempelhof).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNy40MzEuNCIsInVwZGF0ZWRJblZlciI6IjM4LjU5LjIiLCJ0YXJnZXRCcmFuY2giOiJtYWluIiwibGFiZWxzIjpbInJlbm92YXRlIl19-->