Repository navigation
fix(feishu): enforce exact signed webhook request boundaries - #118758
Conversation
|
Codex review: needs real behavior proof before merge. Reviewed August 3, 2026, 5:05 PM ET / 21:05 UTC. ClawSweeper reviewWhat this changesThe PR restricts signed Feishu webhook callbacks to the configured canonical POST request target and adds schema validation plus Doctor migration for legacy webhook-path values. Merge readiness⛔ Blocked until stronger real behavior proof is added - 5 items remain Keep open for two bounded pre-merge updates: document the newly strict Feishu webhook-path contract, and refresh the real localhost proof on the final branch head. The prior runtime-normalization blocker is repaired: the listener now rejects noncanonical persisted paths instead of silently changing an operator’s live endpoint. Priority: P1 Review scores
Verification
How this fits togetherThe Feishu plugin resolves account configuration, starts a local webhook listener in webhook mode, and forwards accepted signed requests to the Lark event dispatcher. This change filters the raw request target and method before signature verification and payload handling, while Doctor owns repair of legacy configuration. flowchart LR
A[Feishu account configuration] --> B[Schema validation]
A --> C[Doctor repair]
B --> D[Webhook listener]
C --> D
E[Signed HTTP request] --> F[Exact target and POST check]
D --> F
F --> G[Signature verification]
G --> H[Lark event dispatch]
Before merge
Findings
Agent review detailsSecurityNone. PR surfaceSource +93, Tests +602. Total +695 across 7 files. View PR surface stats
Review metrics
Stored data modelPersistent data-model change detected: Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Keep the exact raw-route and Doctor-only migration design, add concise public documentation for canonical webhookPath values and Do we have a high-confidence way to reproduce the issue? Yes. The final source supplies a clear route and startup-validation path, and the branch contains a raw-TCP signed localhost harness for it; this read-only review did not execute the harness. Is this the best way to solve the issue? Yes, with the documentation and final-head proof gap closed. Rejecting noncanonical configuration at schema/startup boundaries while retaining normalization exclusively in Doctor is the maintainable owner split; runtime normalization would silently alter an operator’s endpoint. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 76cc60a452dc. LabelsLabel justifications:
EvidenceWhat I checked:
Likely related people:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (6 earlier review cycles)
|
…0803-feishu-webhook-route-boundary
…0803-feishu-webhook-route-boundary
|
Merged via squash.
|
* origin/main: (90 commits) fix(googlechat): recover durable lanes after oversized attachments (#118986) test(qa): cover runtime telemetry evidence (#118950) fix(gateway): resolve SQLite usage details (#118918) test(cron): cover durable scheduler state (#118981) test(gateway): cover node exec approval relay (#118825) test(qa): add Active Memory recall coverage (#118963) test(qa): promote package-backed Docker artifact proof (#118826) test(qa): cover diagnostic event boundary (#118844) test(gateway): cover WebSocket runtime contracts (#118797) fix(signal): drain accepted websocket messages before shutdown (#118975) fix(plugins): remove stale load paths during uninstall (#118930) test(qa): cover bundled runtime discovery (#118922) chore(clawhub): cover plugin release policy contracts (#118971) test(qa): cover support export and stability (#118956) fix(feishu): enforce exact signed webhook request boundaries (#118758) feat(sms): add Twilio MMS support (#118664) test(gateway): prove TLS certificate pinning (#118812) test(qa): cover tool policy and sandbox gates (#118925) fix(cli): keep update dry-run state immutable (#118856) fix(scripts): honor last repeated CLI flag value (#118710) ... # Conflicts: # pnpm-workspace.yaml
…r-admin-20260803 * origin/main: (89 commits) fix(googlechat): align doctor policy ownership with canonical account configuration (#118972) test(tui): prove editor input through PTY (#118982) fix(memory): persist trusted owner provenance at canonical transcript boundary (#118987) test(qa): cover health monitor and cache boundaries (#118961) fix(macos): restore dashboard frame double-click zoom (#118976) fix(googlechat): recover durable lanes after oversized attachments (#118986) test(qa): cover runtime telemetry evidence (#118950) fix(gateway): resolve SQLite usage details (#118918) test(cron): cover durable scheduler state (#118981) test(gateway): cover node exec approval relay (#118825) test(qa): add Active Memory recall coverage (#118963) test(qa): promote package-backed Docker artifact proof (#118826) test(qa): cover diagnostic event boundary (#118844) test(gateway): cover WebSocket runtime contracts (#118797) fix(signal): drain accepted websocket messages before shutdown (#118975) fix(plugins): remove stale load paths during uninstall (#118930) test(qa): cover bundled runtime discovery (#118922) chore(clawhub): cover plugin release policy contracts (#118971) test(qa): cover support export and stability (#118956) fix(feishu): enforce exact signed webhook request boundaries (#118758) ...
…w#118758) * fix(feishu): enforce exact signed webhook request targets * fix(feishu): preserve explicitly configured signed webhook query targets * fix(feishu): preserve shipped relative webhook paths * fix(feishu): normalize and migrate legacy webhook callback paths * fix(feishu): preserve transformed webhook schema defaults * fix(feishu): require canonical webhook paths before runtime startup * docs(feishu): document canonical webhook routes and doctor recovery
Summary
Verification
Actual signed Feishu localhost route proof
Actual HTTP requests against the installed signed owner/server and real Lark dispatch establish exact configured-query compatibility:
Prefix collisions, mismatched configured query parameters, and unsupported methods remain denied; the shipped exact configured query continues to dispatch.
Actual signed localhost webhook and shipped-schema proof
Exact head:
6cae7d6e42089917485ce0cbd156a621ab2da6d3. This executes the installed official Lark SDK/EventDispatcher over real localhost TCP with real SHA256 signatures—not a route mock. Every malformed/foreign/raw route is rejected, and exactly one canonical signed route dispatches once:{ "sdk": "@larksuiteoapi/[email protected]", "transport": "actual localhost TCP + SHA256 signed POST + installed EventDispatcher", "requestsPerCase": [ "wrong-route", "foreign-authority", "raw-fragment", "canonical-wire" ], "expectedPerCase": { "statuses": [ 404, 404, 404, 200 ], "acceptedDispatcherCalls": 1, "acceptedHealthEvents": 1 }, "cases": [ "root-relative", "account-relative", "root-fragment", "relative-fragment", "empty-fragment", "query-fragment", "fragment-only", "fragment-question", "query-only-fragment", "dot-segments", "encoded-dot-segments", "backslash", "backslash-traversal", "external-authority", "backslash-authority", "absolute-https", "absolute-http", "raw-space", "query-space", "unicode", "unicode-emoji", "unicode-query", "tab-control", "crlf-controls", "nul-control", "encoded-hash", "encoded-slash", "encoded-backslash", "encoded-nul", "invalid-percent", "dangling-percent", "exact-empty-query", "empty-query-fragment", "relative-trailing", "canonical-trailing", "empty-root", "whitespace-account" ], "summary": { "cases": 37, "signedRequests": 148, "failed": 0 } }Actual installed Zod 4 input-schema producer, unchanged shipped generated metadata, runtime default, and root/account doctor migration:
{ "zod": { "version": "4.4.3", "source": "node_modules/zod/v4/core/to-json-schema.js:83-90", "types": "node_modules/zod/v4/classic/schemas.d.ts:46-49", "defaultBefore": { "type": "string" }, "prefaultAfter": { "default": "/feishu/events", "type": "string" } }, "metadata": { "generated": { "default": "/feishu/events", "type": "string" }, "live": { "default": "/feishu/events", "type": "string" }, "byteEqual": true, "sha256": "ac5a67759e5853c63e8b9d46c4162ce84a507b3bff5d6f028127811062d8b868" }, "missing": { "schema": "/feishu/events", "runtime": "/feishu/events" }, "doctor": { "hook#fragment": { "root": "/hook", "account": "/hook", "notes": 2 }, "/hook?": { "root": "/hook?", "account": "/hook?", "notes": 0 }, "/hook?#": { "root": "/hook", "account": "/hook", "notes": 2 }, "https://operator.example/hook/?tenant=alpha#fragment": { "root": "/hook/?tenant=alpha", "account": "/hook/?tenant=alpha", "notes": 2 }, "/café": { "root": "/caf%C3%A9", "account": "/caf%C3%A9", "notes": 2 }, "mailto:[email protected]": { "root": "rejected", "account": "rejected", "doctorRoot": "/feishu/events", "doctorAccount": "/feishu/events", "notes": 2 }, "//[": { "root": "rejected", "account": "rejected", "doctorRoot": "/feishu/events", "doctorAccount": "/feishu/events", "notes": 2 }, "allIdempotent": true } }The tracked generated metadata artifact remains byte-identical while the one-word producer
.defaultrepair restores its shipped/feishu/eventspublic default. Six focused owner/doctor/webhook suites pass 207/207 tests. Hostedcheck-bundled-channel-config-metadatanow passes on the exact current head.Exact final-head signed Feishu localhost proof
{ "head": "6cae7d6e42089917485ce0cbd156a621ab2da6d3", "transport": "installed @larksuiteoapi/node-sdk EventDispatcher + SHA256 + actual localhost raw TCP", "cases": 8, "malformedRootOrAccountCases": 5, "canonicalCases": 3, "statuses": { "hostileFragment": 404, "invalidSignature": 401, "invalidMethod": 405, "validSignedCanonical": 200 }, "dispatcherCallsPerAcceptedRequest": 1, "healthActivityPerAcceptedRequest": 1, "malformedStartupRejectedBeforeListen": true, "recoveryHint": "openclaw doctor --fix", "malformedDoctorChangesEach": 1, "canonicalDoctorChangesEach": 0, "canonicalCasesPreserved": [ "/hook?", "/hook%23fragment", "omitted-default" ], "publicDefault": "/feishu/events", "runtimeDefault": "/feishu/events", "allListenersClosedAfterAbort": true, "failed": 0 }Final-head focused owner suites:
node scripts/run-vitest.mjs extensions/feishu/src/config-schema.test.ts extensions/feishu/src/monitor.webhook-e2e.test.ts extensions/feishu/src/doctor-contract.test.ts=> 3 files, 157/157 passed, including 37 signed/raw target cases, encrypted challenge, durable ACK ordering, lifecycle shutdown, and doctor-only migration.