Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

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

Open
#11 0 comments 0 reactions 0 assignees View on GitHub

@Xuxchloris is already working on this.

Since Aug 14, 2026.

  • #15 by @Xuxchloris — open

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
35/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Quiet
Tech stack
fastapi, python
Domain
api, backend, security

Research direction

The issue identifies _verify_sign as the no-op path and points to _verify_webhook_request plus its tests in dsh-feishu-bridge as a reference. Read those entry points first; completion requires an agreed SDK scope and tests covering the selected handling for missing keys, timestamp freshness, and replay deduplication.

Written by the indexing model from the issue text.

Description

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.

Dominant language
Python
Stars
17
Forks
8
PR merge metrics
No merged PRs in 30d

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from larksuite/channel-sdk-python

All issues in larksuite/channel-sdk-python

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.