Ecosyste.ms: Advisories

An open API service providing security vulnerability metadata for many open source software ecosystems.

Security Advisories: GSA_kwCzR0hTQS1jMmcyLWd4NGotcmozas4AA8mO

Slack integration leaks sensitive information in logs

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. 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:

{
    "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

⚠️ 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 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. 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:

# 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

Permalink: https://github.com/advisories/GHSA-c2g2-gx4j-rj3j
JSON: https://advisories.ecosyste.ms/api/v1/advisories/GSA_kwCzR0hTQS1jMmcyLWd4NGotcmozas4AA8mO
Source: GitHub Advisory Database
Origin: Unspecified
Severity: Low
Classification: General
Published: 4 months ago
Updated: 4 months ago


CVSS Score: 2.0
CVSS vector: CVSS:3.1/AV:N/AC:H/PR:H/UI:R/S:U/C:L/I:N/A:N

Identifiers: GHSA-c2g2-gx4j-rj3j, CVE-2024-35196
References: Repository: https://github.com/getsentry/sentry
Blast Radius: 4.6

Affected Packages

pypi:sentry
Dependent packages: 19
Dependent repositories: 209
Downloads: 7,577 last month
Affected Version Ranges: >= 24.3.0, < 24.5.0
Fixed in: 24.5.0
All affected versions:
All unaffected versions: 2.0.0, 2.0.1, 2.0.2, 2.1.0, 2.1.1, 2.1.2, 2.1.3, 2.2.0, 2.2.1, 2.2.2, 2.2.3, 2.2.4, 2.2.5, 2.3.0, 2.3.1, 2.3.2, 2.4.0, 2.4.1, 2.4.2, 2.4.3, 2.4.4, 2.4.5, 2.4.6, 2.4.7, 2.5.0, 2.5.1, 2.5.2, 2.6.0, 2.6.1, 2.6.2, 2.7.0, 2.8.0, 2.8.1, 2.8.2, 2.9.0, 3.0.0, 3.0.1, 3.0.2, 3.0.3, 3.0.4, 3.1.0, 3.1.1, 3.1.2, 3.1.3, 3.1.4, 3.2.0, 3.3.0, 3.3.1, 3.3.2, 3.4.0, 3.4.1, 3.4.2, 3.5.0, 3.5.1, 3.5.2, 3.5.3, 3.5.4, 3.5.5, 3.5.6, 3.5.7, 3.5.8, 3.5.9, 3.6.0, 3.6.1, 3.6.2, 3.6.3, 3.6.4, 3.7.0, 3.7.1, 3.7.2, 3.7.3, 3.7.4, 3.8.0, 3.8.1, 3.8.2, 4.0.0, 4.0.1, 4.0.2, 4.0.3, 4.0.4, 4.0.5, 4.0.6, 4.0.7, 4.0.8, 4.0.9, 4.0.10, 4.0.11, 4.0.12, 4.0.13, 4.0.14, 4.0.15, 4.0.16, 4.0.17, 4.1.0, 4.1.1, 4.1.2, 4.1.3, 4.1.4, 4.1.5, 4.1.6, 4.1.7, 4.2.0, 4.2.1, 4.2.2, 4.2.4, 4.2.5, 4.3.0, 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