Skip to content

slack: connect_slack answers raw exception text in its 500 — fix after 2026-11-19 and drop the guard's hold #4339

Open

Description

@AndriiPasternak31

Problem

src/backend/routers/slack.py, connect_slack (line 334 on dev at e0e0306c0), answers a broad except Exception as e with raise HTTPException(status_code=500, detail=str(e)). The caller gets the raw exception text in a 500, the class of defect #4284 removes everywhere else in the backend.

This file is held unchanged until 2026-11-19: code-scanning dismissals recorded against its current source must stay valid until then. The static guard tests/unit/test_4284_no_exception_text_in_5xx.py lists this one site with an expiry of 2026-11-19, so from 2026-11-20 that test fails on every branch until this is fixed and the entry is removed.

Suggested fix

Do what the other sites in #4284 did:

  • answer a fixed sentence plus the exception class (Failed to connect Slack (<Class> — details in backend logs));
  • log the exception with its traceback, credential-masked (the handler holds Slack tokens);
  • remove the routers/slack.py connect_slack entry from the guard's allowlist.

Acceptance criteria

  • A test makes the code inside the try raise with a sentinel. The 500 detail does not contain the sentinel and does name the class; the log record carries the masked text.
  • The guard's allowlist no longer has a routers/slack.py entry, and the guard passes.
  • The 400 answers in the same function (lines 294, 347) are unchanged unless deliberately changed in the same PR.
  • Done on or after 2026-11-19, and before 2026-11-20 if possible, so the guard never goes red.

Follow-up from #4284.

Activity

  1. added
    priority-p2
    type-bug
    theme-security
    complexity-low
    status-ready
    on Nov 6, 2026
  2. added
    status-in-dev
    on Nov 19, 2026
  3. removed
    status-ready
    on Nov 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

complexity-lowpriority-p2status-in-devtheme-securitytype-bug

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions