webhook: case-sensitive signature-header lookup 500s behind ASGI; strict encrypted pre-verify deadlocks url_verification handshake
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Idoneità per principianti
- 58/100
Direzione di ricerca
Individua _verify_sign e il ramo url_verification, quindi riproduci i casi segnalati nella suite di test con header in minuscolo e payload di handshake crittografati e non firmati. Il lavoro è completato quando le richieste ASGI legittimamente firmate non restituiscono più 500 e le richieste url_verification in chiaro o crittografate convalidano il proprio token e completano la challenge.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Two concrete webhook bugs observed on 1.2.0 behind ASGI servers
Related to #11 but these are straight bugs rather than hardening gaps, so filing separately.
1. _verify_sign header lookup is case-sensitive → TypeError/500 behind ASGI
Starlette/FastAPI (per the ASGI spec) hand the application lowercase header names. _verify_sign looks up X-Lark-Request-Timestamp / X-Lark-Request-Nonce / X-Lark-Signature case-sensitively, gets None, and then None + None + encrypt_key raises TypeError: unsupported operand type(s) for +: 'NoneType' and 'NoneType' → every legitimately signed request 500s.
Reproduced with the real SDK (no mocks) in our test suite: passing lowercase headers reproduces the 500; re-canonicalizing the three header names before calling the SDK makes the same request pass. Suggested fix: case-insensitive header lookup (e.g. normalize to lower on both sides).
2. strict-mode encrypted pre-verification rejects Feishu's own url_verification handshake
The "save request URL" challenge that the Feishu console sends during first-time webhook configuration is not signed (platform behavior). With an encrypt key configured, the strict-mode encrypted pre-verification rejects the encrypted-but-unsigned handshake before the url_verification branch is reached — so an integrator using strict mode + encryption can never complete the console's URL-verification step. First-time webhook setup deadlocks.
Our workaround is to detect the handshake (plaintext and encrypted forms, both the legacy flat body and the v2/p2 schema), validate verification_token, and answer the challenge ourselves without forwarding it to the SDK. Suggested fix: exempt url_verification from the signature requirement (it carries the verification token as its own proof), or provide a documented hook for it.
Both behaviors reproduced on lark-channel-sdk==1.2.0; happy to share the test cases.
- Lingua principale
- Python
- Stelle
- 17
- Fork
- 8
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Preparare l'ambiente
Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.
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 larksuite/channel-sdk-python
-
webhook: signature verification silently no-ops without encrypt_key; no timestamp-freshness or replay checksForse già presa @Xuxchloris l’ha presa 61 giorni fa. Aperta
Difficoltà 5/5 Più di una settimana Idoneità per principianti 35/100
-
merge_streaming_text drops characters for pure-delta streaming producersForse già presa @Xuxchloris l’ha presa 61 giorni fa. Aperta
Difficoltà 4/5 3-5 giorni Idoneità per principianti 58/100
-
Long threaded reply leaks out of a topic/thread chat: reply_to dropped on chunks after the firstForse già presa @Ydz0616 l’ha presa 99 giorni fa. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 35/100
Tutte le issue di larksuite/channel-sdk-python
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 62/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 74/100
WingedGuardian/GENesis-AGI#3375 ·
I maintainer di solito rispondono entro 1 giorno
-
curriculum documentation quality
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
githubnext/gh-aw-workshop#4601 ·
I maintainer di solito rispondono entro 1 giorno
-
approved Good First Issue scope: docs
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 85/100
hiero-ledger/hiero-sdk-python#2730 · 3 commenti ·
I maintainer di solito rispondono entro 1 giorno