CVE-2024-35196: Sentry Slack Integration Leaks Sensitive Information Vulnerability

LOW
Advisory Identifier: GHSA-c2g2-gx4j-rj3j
CVSS 2.0
CWE-532
Published
Advisory Summary

CVE-2024-35196 is a LOW (CVSS 2.0) slack integration leaks sensitive information vulnerability (CWE-532: Insertion of Sensitive Information into Log File) affecting Sentry libraries in the PyPI ecosystem. The issue involves slack integration leaks sensitive information in logs. Remediation is available by upgrading affected packages to version 24.5.0.

CVE-2024-35196 at a Glance

CVE Identifier CVE-2024-35196
GHSA Identifier GHSA-c2g2-gx4j-rj3j
Severity LOW
CVSS v3.1 Base Score 2.0
CWE Classification CWE-532: Insertion of Sensitive Information into Log File
Affected Product Sentry
Package Ecosystem PyPI
Published Date
Last Updated

Security Impact

CVSS: 2.0

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:H/PR:H/UI:R/S:U/C:L/I:N/A:N).

Attack Vector Network (AV:N)
Attack Complexity High (AC:H)
Privileges Required High (PR:H)
User Interaction Required (UI:R)
Scope Unchanged (S:U)
Confidentiality Low (C:L)
Integrity None (I:N)
Availability None (A:N)

How to Fix CVE-2024-35196

To remediate this vulnerability, upgrade all affected Sentry dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

sentry fixed: 24.5.0
pip install sentry>=24.5.0
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

pip show sentry

How to Check if You Are Affected

To determine whether your Python environment is affected by CVE-2024-35196, inspect your installed packages using pip:

pip show sentry

Analyze the terminal output to locate any version of Sentry in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 24.5.0), your application is affected.

Note: The pip show sentry command checks currently installed packages in your active Python environment.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-532: Insertion of Sensitive Information into Log File, where the product writes sensitive information to a log file. In Sentry, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

### Impact Sentry's Slack integration incorrectly records the incoming request body in logs. This request data can contain sensitive information, including the [deprecated Slack verification token](https://api.slack.com/authentication/verifying-requests-from-slack#deprecation). With this verification token, it is possible under specific configurations, an attacker can forge requests and act as the Slack integration. The request body is leaked in log entries matching `event == "slack.*" && name == "sentry.integrations.slack" && request_data == *`. The deprecated slack verification token, will be found in the `request_data.token` key. Example event: ```json { "name": "sentry.integrations.slack", "level": "info", "event": "slack.event.message", # This could be any of the `slack.*` events "request_data": { # Other keys are omitted for brevity "token": "<MyDeprecatedSlackVerificationToken>", } } ``` ### Patches - **SaaS users** do not need to take any action. - **Self-hosted users** should upgrade to version 24.5.0 or higher, [rotate their Slack verification token](https://api.slack.com/authentication/verifying-requests-from-slack#regenerating), and [use the Slack Signing Secret instead of the verification token](https://develop.sentry.dev/integrations/slack/). - If you are only using the `slack.signing-secret` in your self-hosted configuration, then the legacy verification token is not used to verify the webhook payload. It is ignored. > ⚠️ Sentry's support for validating Slack requests via the legacy verification token will be deprecated in version 24.7.0. ### Workarounds #### Option 1 Set the `slack.signing-secret` instead of `slack.verification-token`. The [signing secret](https://api.slack.com/authentication/verifying-requests-from-slack#app-management-updates) is Slack's recommended way of authenticating webhooks. By having `slack.singing-secret` set, Sentry self-hosted will no longer use the verification token for authentication of the webhooks, regardless of whether `slack.verification-token` is set or not. #### Option 2 The deprecated Slack verification token is leaked in log levels of `INFO` and `ERROR` in the Slack integration. If the self-hosted instance is unable to be upgraded or re-configured to use the `slack.signing-secret`, the logging configuration can be adjusted to not generate logs from the integration. The [default logging configuration can be found in `src/sentry/conf/server.py`](https://github.com/getsentry/sentry/blob/17d2b87e39ccd57e11da4deed62971ff306253d1/src/sentry/conf/server.py#L1307). **Services should be restarted once the configuration change is saved.** Below you'll find an example of the configuration adjustments necessary to remove the Slack integration logs: ```python # src/sentry/conf/server.py ... LOGGING: LoggingConfig = { ... handlers: { # the line below already exists in the default configuration "null": {"class": "logging.NullHandler"}, ... }, "loggers": { "sentry.integrations.slack": { "handlers": ["null"], # route logs to null handler "level": "CRITICAL", # prevent generation of logs a lower levels (ex. ERROR and INFO) }, ... }, } ``` ### References - https://github.com/getsentry/sentry/pull/70508 - [Sentry Slack Integration Documentation for Self-Hosted users](https://develop.sentry.dev/integrations/slack/) - [Documentation on Slack Signing Secrets](https://api.slack.com/authentication/verifying-requests-from-slack#app-management-updates) - [Slack Deprecation for Verification Tokens](https://api.slack.com/authentication/verifying-requests-from-slack#deprecation)

CVE-2024-35196 Affected Sentry Versions

1 component(s)
Fixed Versions:
24.5.0
Product / Package Ecosystem Affected Versions Fixed Version
sentry
PyPI
≥ 24.3.0
< 24.5.0
24.5.0

References

Frequently Asked Questions

What is CVE-2024-35196?
CVE-2024-35196 is a security vulnerability in Sentry involving Slack integration leaks sensitive information in logs under CWE-532: Insertion of Sensitive Information into Log File.
Which Sentry versions are affected?
Affected versions include releases prior to 24.5.0 across affected packages: sentry.
What version fixes CVE-2024-35196?
Upgrading to 24.5.0 (or the latest patched release for your respective branch) resolves the vulnerability.
Is sentry affected?
Yes, sentry is affected in releases prior to 24.5.0. Upgrade your dependency to 24.5.0 or later.
What is the CVSS score of CVE-2024-35196?
CVE-2024-35196 has a CVSS v3.1 base score of 2.0 (LOW) with vector string CVSS:3.1/AV:N/AC:H/PR:H/UI:R/S:U/C:L/I:N/A:N.
What CWE is associated with CVE-2024-35196?
CVE-2024-35196 is classified under CWE-532: Insertion of Sensitive Information into Log File (The product writes sensitive information to a log file.).
How can I check PyPI dependencies for CVE-2024-35196?
Run the dependency tree command: 'pip show sentry'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-c2g2-gx4j-rj3j",
  "modified" : "2024-06-02T22:28:09Z",
  "published" : "2024-06-02T22:28:09Z",
  "aliases" : [ "CVE-2024-35196" ],
  "summary" : "Slack integration leaks sensitive information in logs",
  "details" : "### Impact\nSentry's Slack integration incorrectly records the incoming request body in logs. This request data can contain sensitive information, including the [deprecated Slack verification token](https://api.slack.com/authentication/verifying-requests-from-slack#deprecation). With this verification token, it is possible under specific configurations, an attacker can forge requests and act as the Slack integration.\n\nThe request body is leaked in log entries matching `event == \"slack.*\" && name == \"sentry.integrations.slack\" && request_data == *`. The deprecated slack verification token, will be found in the `request_data.token` key.\n\nExample event:\n\n```json\n{\n    \"name\": \"sentry.integrations.slack\",\n    \"level\": \"info\",\n    \"event\": \"slack.event.message\",  # This could be any of the `slack.*` events\n    \"request_data\": {\n      # Other keys are omitted for brevity\n      \"token\": \"<MyDeprecatedSlackVerificationToken>\",\n    }\n}\n``` \n\n### Patches\n- **SaaS users** do not need to take any action.\n- **Self-hosted users** should upgrade to version 24.5.0 or higher, [rotate their Slack verification token](https://api.slack.com/authentication/verifying-requests-from-slack#regenerating), and [use the Slack Signing Secret instead of the verification token](https://develop.sentry.dev/integrations/slack/).\n  - If you are only using the `slack.signing-secret` in your self-hosted configuration, then the legacy verification token is not used to verify the webhook payload. It is ignored. \n \n> ⚠️ Sentry's support for validating Slack requests via the legacy verification token will be deprecated in version 24.7.0.\n\n\n### Workarounds\n\n#### Option 1\n\nSet the `slack.signing-secret` instead of `slack.verification-token`. The [signing secret](https://api.slack.com/authentication/verifying-requests-from-slack#app-management-updates) is Slack's recommended way of authenticating webhooks.\n\nBy having `slack.singing-secret` set, Sentry self-hosted will no longer use the verification token for authentication of the webhooks, regardless of whether `slack.verification-token` is set or not.\n\n#### Option 2\n\nThe deprecated Slack verification token is leaked in log levels of `INFO` and `ERROR` in the Slack integration. If the self-hosted instance is unable to be upgraded or re-configured to use the `slack.signing-secret`, the logging configuration can be adjusted to not generate logs from the integration. The [default logging configuration can be found in `src/sentry/conf/server.py`](https://github.com/getsentry/sentry/blob/17d2b87e39ccd57e11da4deed62971ff306253d1/src/sentry/conf/server.py#L1307). **Services should be restarted once the configuration change is saved.**\n\nBelow you'll find an example of the configuration adjustments necessary to remove the Slack integration logs:\n \n```python\n# src/sentry/conf/server.py\n\n...\n \nLOGGING: LoggingConfig = {\n    ...\n    handlers: {\n        # the line below already exists in the default configuration\n        \"null\": {\"class\": \"logging.NullHandler\"},\n        ...\n    },\n    \"loggers\": {\n        \"sentry.integrations.slack\": {\n            \"handlers\": [\"null\"],  # route logs to null handler\n            \"level\": \"CRITICAL\",  # prevent generation of logs a lower levels (ex. ERROR and INFO)\n        },\n        ...\n    },\n}\n```\n\n### References\n- https://github.com/getsentry/sentry/pull/70508\n- [Sentry Slack Integration Documentation for Self-Hosted users](https://develop.sentry.dev/integrations/slack/)\n- [Documentation on Slack Signing Secrets](https://api.slack.com/authentication/verifying-requests-from-slack#app-management-updates)\n- [Slack Deprecation for Verification Tokens](https://api.slack.com/authentication/verifying-requests-from-slack#deprecation)\n",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:H/PR:H/UI:R/S:U/C:L/I:N/A:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "PyPI",
      "name" : "sentry"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "24.3.0"
      }, {
        "fixed" : "24.5.0"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/getsentry/sentry/security/advisories/GHSA-c2g2-gx4j-rj3j"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2024-35196"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/getsentry/sentry/pull/70508"
  }, {
    "type" : "WEB",
    "url" : "https://api.slack.com/authentication/verifying-requests-from-slack#app-management-updates"
  }, {
    "type" : "WEB",
    "url" : "https://api.slack.com/authentication/verifying-requests-from-slack#deprecation"
  }, {
    "type" : "WEB",
    "url" : "https://api.slack.com/authentication/verifying-requests-from-slack#regenerating"
  }, {
    "type" : "WEB",
    "url" : "https://develop.sentry.dev/integrations/slack"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/getsentry/sentry"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/getsentry/sentry/blob/17d2b87e39ccd57e11da4deed62971ff306253d1/src/sentry/conf/server.py#L1307"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-532" ],
    "severity" : "LOW",
    "github_reviewed" : true,
    "github_reviewed_at" : "2024-06-02T22:28:09Z",
    "nvd_published_at" : "2024-05-31T18:15:12Z"
  }
}