SslCheck returns 401 for a matching verification_token and 200 for a wrong one

Aperta
#1,595 1 commento 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

@sahiljagtap08 ci sta già lavorando.

Dal 8/10/2026.

  • #1589 di @sahiljagtap08 — aperta

Valutazione

Difficoltà
2/5
Tempo stimato
1-3 ore
Idoneità per principianti
25/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
python
Ambito
backend

Direzione di ricerca

The inverted check is in slack_bolt/middleware/ssl_check/ssl_check.py (SslCheck.process) and async_ssl_check.py, which call _verify_token_if_needed on req.body. Read those two methods and reproduce with the snippet in the issue, using both matching and wrong tokens and a body with no token field. Work is already under way in PR #1589, so check that first and avoid duplicating it. Done means matching tokens return 200, wrong or missing tokens return 401, and the sync and async tests pass.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

auto-triage-stale
Reproducible in:
The slack_bolt version
slack_bolt==1.30.0
slack_sdk==3.45.0
Python runtime version
Python 3.12.5
OS info
macOS 27.0
Steps to reproduce:

Set a verification token on the app and send Slack's SSL check request to it.

from slack_bolt import App
from slack_bolt.request import BoltRequest

app = App(signing_secret="secret", token="xoxb-...", verification_token="my-token")

req = BoltRequest(
    body="ssl_check=1&token=my-token",
    headers={"content-type": ["application/x-www-form-urlencoded"]},
)
print(app.dispatch(req).status)
  1. Run the snippet above with the correct token. Status is 401.
  2. Change the body token to wrong-token. Status is 200.
  3. Remove the token field from the body. KeyError: 'token' is raised.
Expected result:

Matching token returns 200. Wrong or missing token returns 401.

Actual result:

The check is inverted in slack_bolt/middleware/ssl_check/ssl_check.py (SslCheck.process) and async_ssl_check.py:

if self._verify_token_if_needed(req.body):
    return self._build_error_response()
return self._build_success_response()

_verify_token_if_needed returns True when the token matches, so a matching token produces the error response. It also reads body["token"] directly, which raises when the field is missing.

I have a fix with sync and async tests in #1589.

Requirements

I have read the Contributing guidelines and Code of Conduct.

Lingua principale
Python
Stelle
1.3k
Fork
300
Merge medio
19h 33m
PR unite (30g)
25

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di slackapi/bolt-python

Tutte le issue di slackapi/bolt-python

Issue simili

Altre issue su Python

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.