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

Ouverte
#1,595 1 commentaire 0 réactions 0 personnes assignées Voir sur GitHub

Les mainteneurs répondent en général sous 1 jour

@sahiljagtap08 y travaille déjà.

Depuis le 8/10/2026.

  • #1589 par @sahiljagtap08 — ouverte

Évaluation

Difficulté
2/5
Temps estimé
1-3 heures
Accessibilité débutants
25/100
Type d'issue
Bug
Clarté
Clairement spécifiée
Activité
Active
Stack technique
python
Domaine
backend

Piste de recherche

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.

Rédigé par le modèle d'indexation à partir du texte de l'issue.

Description

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.

Langage dominant
Python
Étoiles
1.3k
Forks
300
Merge moyen
19 h 33 min
PR mergées (30 j)
25

Préparer son environnement

Par où commencer

  1. Lisez l'issue en entier, puis le guide de contribution du projet.
  2. Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
  3. Forkez le dépôt et travaillez sur une branche.
  4. Ouvrez une pull request qui référence le numéro de l'issue.

Autres issues de slackapi/bolt-python

Toutes les issues de slackapi/bolt-python

Issues similaires

Plus d'issues Python

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.