Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

webhook: signature verification silently no-ops without encrypt_key; no timestamp-freshness or replay checks

Aperta
#11 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

@Xuxchloris ci sta già lavorando.

Dal 14/8/2026.

  • #15 di @Xuxchloris — aperta

Valutazione

Difficoltà
5/5
Tempo stimato
Più di una settimana
Idoneità per principianti
35/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Tranquilla
Stack tecnologico
fastapi, python
Ambito
api, backend, security

Direzione di ricerca

L’issue identifica _verify_sign come il percorso no-op e indica _verify_webhook_request e i relativi test in dsh-feishu-bridge come riferimento. Leggi prima questi punti di ingresso; per completare il lavoro sono necessari un ambito SDK concordato e test che coprano la gestione selezionata per le chiavi mancanti, la freschezza dei timestamp e la deduplicazione dei replay.

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

Descrizione

Context

We run lark-channel-sdk==1.2.0 inside two FastAPI-based webhook bridges. While security-reviewing the webhook path we found that delegating request verification entirely to the SDK leaves several gaps. Reporting them here so other integrators are aware and so they can be considered for hardening — happy to provide more detail or test cases.

Observed on 1.2.0

  1. Signature verification silently no-ops when no encrypt key is configured. _verify_sign returns without checking anything if encrypt_key is unset. That may be by design (Feishu only signs when encryption is enabled), but the caller gets no signal that inbound requests are effectively unauthenticated — an integrator who reads "the SDK verifies signatures" can ship an open webhook without realizing it.
  2. No timestamp-freshness check. Even with encrypt_key configured and the signature verified, X-Lark-Request-Timestamp is never checked against a window, so an arbitrarily old (captured) request still verifies.
  3. No replay deduplication. There is no (timestamp, nonce) dedup, so a captured legitimate request can be replayed indefinitely and will pass verification every time.

Combined effect: a captured request is replayable forever, and in the no-encrypt-key configuration any forged request is accepted.

Suggestions

  • Fail loudly (or require an explicit opt-out) when webhook mode runs without an encrypt key, instead of silently skipping verification.
  • Reject timestamps outside a configurable window (we use ±300s, rejecting the exact boundary so replay-cache TTLs stay strictly positive).
  • Document that replay dedup is the integrator's responsibility, or provide a small (timestamp, nonce) cache with TTL tied to the timestamp's remaining validity.

What we did meanwhile

We now verify signature + timestamp window + replay dedup at our own boundary before the SDK sees the request, e.g. https://github.com/wz-heng/dsh-feishu-bridge (see _verify_webhook_request and its tests). Not a criticism of the SDK's scope — just flagging that today's behavior is easy to over-trust.

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

  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 larksuite/channel-sdk-python

Tutte le issue di larksuite/channel-sdk-python

Issue simili

Altre issue su Python

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.