SignatureVerifier.is_valid raises instead of returning False for a malformed timestamp, signature or body
I maintainer di solito rispondono entro 1 giorno
Valutazione
- Difficoltà
- 2/5
- Tempo stimato
- 1-3 ore
- Idoneità per principianti
- 57/100
- Tipo di issue
- Bug
- Chiarezza
- Specificata chiaramente
- Stato di attività
- Attiva
- Stack tecnologico
- python
- Ambito
- backend-api-design, security
Direzione di ricerca
Start with SignatureVerifier.is_valid() and its existing tests, including test_is_valid_none; the issue names the malformed timestamp, signature, and body cases. Confirm each currently raises, then make sure the tests expect False for all three while preserving the missing-value behavior.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
SignatureVerifier.is_valid() (and is_valid_request()) returns False for missing values, but three kinds of malformed input from the request raise instead:
from slack_sdk.signature import SignatureVerifier
v = SignatureVerifier("secret")
v.is_valid("body", "abc", "v0=aa") # ValueError: invalid literal for int() with base 10: 'abc'
v.is_valid("body", "1531420618", "v0=é") # TypeError: comparing strings with non-ASCII characters is not supported
v.is_valid(b"\xff\xfe", "1531420618", "v0=aa") # UnicodeDecodeError (body is decoded before the signature is compared)
(For the last two, use a timestamp inside the 5 minute window.)
The timestamp and signature come straight from the X-Slack-Request-Timestamp and X-Slack-Signature headers, so anyone can send them. In bolt-python, RequestVerification.process calls is_valid directly, so such a request does not get the 401 invalid request response; the exception goes through the generic error path in App.dispatch and ends as a 500.
It is not a way around the check, the request is still rejected. But the method is documented as "Verifies if the given signature is valid" and test_is_valid_none already expects False for missing values, so returning False for these seems to be the intended contract.
I have a small fix with tests (catch the three cases in is_valid and return False). Happy to open a PR if that works for you.
Checked on main at b935494.
- Lingua principale
- Python
- Stelle
- 4k
- Fork
- 874
- Merge medio
- 13h 22m
- PR unite (30g)
- 64
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Ha un modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di slackapi/python-slack-sdk
-
`WebClient` raises `JSONDecodeError` instead of `SlackApiError` on a malformed JSON body when retry handlers are setForse già presa @agustin18 l’ha presa 13 giorni fa. Apertabug semver:major web-client
Difficoltà 2/5 1-3 ore Idoneità per principianti 30/100
slackapi/python-slack-sdk#2070 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 3/5 Mezza giornata Idoneità per principianti 42/100
slackapi/python-slack-sdk#2066 ·
I maintainer di solito rispondono entro 1 giorno
-
Add missing Web API methods that are documented on docs.slack.dev to WebClientForse già presa @zimeg l’ha presa 19 giorni fa. Apertaenhancement web-client
Difficoltà 4/5 3-5 giorni Idoneità per principianti 35/100
slackapi/python-slack-sdk#2014 · 2 commenti · 2 reazioni · 2 assegnatari ·
I maintainer di solito rispondono entro 1 giorno
-
Installation and Bot reject ISO 8601 timestamps with a negative UTC offset or a Z suffixForse già presa @hello-ashleyintech l’ha presa 44 giorni fa. Apertaauto-triage-stale bug
slackapi/python-slack-sdk#1989 · 2 commenti · 1 assegnatario ·
I maintainer di solito rispondono entro 1 giorno
-
chat_postMessage silently forwards thread_id to the API, so a threaded reply posts to the channelForse di nuovo libera Una pull request per questa issue è stata chiusa senza essere unita. Apertaauto-triage-skip enhancement
Difficoltà 4/5 3-5 giorni Idoneità per principianti 48/100
slackapi/python-slack-sdk#1923 · 2 commenti ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di slackapi/python-slack-sdk
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
bad-antics/lateralus-lang#1623 ·
I maintainer di solito rispondono entro 1 giorno
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 74/100
fossguild/thelifesnake#82 ·
I maintainer di solito rispondono entro 1 giorno
-
Unfitted DialectClassifier crashes with a confusing ValueError: raise a clear "not fitted" errorApertagood first issue
Difficoltà 2/5 1-3 ore Idoneità per principianti 88/100
omarelshamy25x/shamy-arabic-nlp#111 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
pietbarber/Manage2Soar#1189 ·
I maintainer di solito rispondono entro 1 giorno
-
BUG: write_netcdf fails on Tutorial 3 BEM output with pandas CategoricalDtype DOF coordinatesForse già presa @dtgaebe l’ha presa oggi. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
sandialabs/WecOptTool#467 ·