Repository navigation
fix(slack): bound HTTP bodies before Bolt - #136508
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
Codex review: needs maintainer review before merge. Reviewed September 2, 2026, 3:31 PM ET / 19:31 UTC. ClawSweeper reviewWhat this changesThis PR reads Slack HTTP webhook bodies under existing size, timeout, and concurrency limits before passing the buffered request to Bolt for signature verification. Merge readinessKeep this PR open for maintainer review. It repairs the released and current-main Slack HTTP path, but the exact Bolt 5.0.0 raw-body contract could not be independently rechecked in this dependency-less, offline checkout. Priority: P2 Review scores
Verification
How this fits togetherSlack HTTP webhooks enter the Slack plugin through registered Gateway routes, then Bolt verifies their signature and dispatches events. The new handler sits between route dispatch and Bolt to bound unauthenticated request bodies. flowchart LR
A[Slack webhook] --> B[Slack HTTP route]
B --> C[Bounded body handler]
C --> D{Body and capacity valid?}
D -->|No| E[HTTP rejection]
D -->|Yes| F[Bolt signature verification]
F --> G[Slack event processing]
Decision needed
Why: The behavioral correctness of the rawBody handoff depends on an external implementation that was unavailable for direct inspection in this read-only offline checkout. Before merge
Agent review detailsSecurityNone. PR surfaceSource +30, Tests +303. Total +333 across 5 files. View PR surface stats
Review metrics
Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Keep the single bounded pre-auth read and response-scoped capacity lease, after a dependency-hydrated maintainer check confirms that Bolt 5.0.0 consumes the supplied Buffer without reading the request stream again. Do we have a high-confidence way to reproduce the issue? No live reproduction was run in this read-only checkout. Current main makes the premature guard-disposal path source-traceable, but demonstrating Bolt’s asynchronous body read requires the unavailable pinned dependency. Is this the best way to solve the issue? Unclear pending the Bolt contract check. The producer-side bounded read is the right owner boundary and the added real-HTTP tests cover the intended flow, provided Bolt 5.0.0 honors the supplied raw Buffer as claimed. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 0df437f0071c. LabelsLabel changes:
Label 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 (1 earlier review cycle)
|
b46538c to
2a76f52
Compare
Addressed the requested rank-up proof in I verified the contract directly in installed I also created a local-only merge of the exact amended head with current |
(cherry picked from commit c11ea06)
What Problem This Solves
Slack HTTP mode could stop enforcing OpenClaw's request size and timeout limits while Bolt
was still buffering a chunked body asynchronously.
Why This Change Was Made
OpenClaw now reads the Slack webhook body under the existing 1 MiB and 30-second bounds
before invoking Bolt, then supplies the exact buffered body through Bolt's supported
rawBodyrequest field. A per-account in-flight limit also bounds concurrent pre-auth bodyreads and remains held until the response completes.
User Impact
Oversized Slack webhook bodies receive
413, stalled bodies receive408, and excessconcurrent requests receive
429before Bolt begins signature verification. Valid signedSlack requests continue through Bolt unchanged.
Evidence
harness's simulated
401instead of OpenClaw's expected413.URL-verification request.
concurrency capacity.
upstream/main564e544aac738d4677f3f6813af018e6a87cd759; it merged cleanly and was never pushed.pnpm check:changedpassed formatting, extension and extension-test typechecks,lint, dependency and boundary guards, dead-export scans, and import-cycle checks.
pnpm buildpassed on the merged tree under Nodev24.15.0.rawBodycontract, verified in the installed dependency source:node_modules/@slack/bolt/dist/receivers/BufferedIncomingMessage.d.ts:5-7declaresrawBody: Buffer;HTTPModuleFunctions.js:98-117treats a request whoserawBodyis aBufferas already buffered and returns it without invokingraw-bodyagain;HTTPModuleFunctions.js:60-68then verifies the exact bytes frombufferedReq.rawBody.HTTPReceiver.js:294-307starts its parse/verify closure without returning the promise, which is why the previous wrapper's guard was disposed early; the handler now reads within OpenClaw's bounds, supplies those bytes asrawBody, and holds the concurrency lease through response completion.