Skip to content

fix(slack): bound HTTP bodies before Bolt - #136508

Merged
drobison00 merged 1 commit into
openclaw:mainfrom
drobison00:fix/fix-990
Sep 8, 2026
Merged

drobison00 merged 1 commit into
openclaw:mainfrom
drobison00:fix/fix-990

Conversation

@drobison00

@drobison00 drobison00 commented Sep 2, 2026 •

Copy link
Copy Markdown
Contributor

Devin Robison · GPT-5 Codex · via @drobison00

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
rawBody request field. A per-account in-flight limit also bounds concurrent pre-auth body
reads and remains held until the response completes.

User Impact

Oversized Slack webhook bodies receive 413, stalled bodies receive 408, and excess
concurrent requests receive 429 before Bolt begins signature verification. Valid signed
Slack requests continue through Bolt unchanged.

Evidence

  • Captured a frozen-base regression where a 1.5 MiB chunked body reached Bolt and returned the
    harness's simulated 401 instead of OpenClaw's expected 413.
  • Added real-Bolt coverage for oversized chunked input, a stalled body, and a valid signed
    URL-verification request.
  • Added boundary coverage for the installed Slack provider handler and the default pre-auth
    concurrency capacity.
  • Built a local-only merge of this exact head with upstream/main
    564e544aac738d4677f3f6813af018e6a87cd759; it merged cleanly and was never pushed.
  • Focused merged-tree regression suite: 2 files, 6 tests passed.
  • Full merged-tree Slack suite: 147 files, 2,692 tests passed.
  • Path-scoped pnpm check:changed passed formatting, extension and extension-test typechecks,
    lint, dependency and boundary guards, dead-export scans, and import-cycle checks.
  • pnpm build passed on the merged tree under Node v24.15.0.
  • Bolt 5.0.0 rawBody contract, verified in the installed dependency source: node_modules/@slack/bolt/dist/receivers/BufferedIncomingMessage.d.ts:5-7 declares rawBody: Buffer; HTTPModuleFunctions.js:98-117 treats a request whose rawBody is a Buffer as already buffered and returns it without invoking raw-body again; HTTPModuleFunctions.js:60-68 then verifies the exact bytes from bufferedReq.rawBody. HTTPReceiver.js:294-307 starts 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 as rawBody, and holds the concurrency lease through response completion.

@clawsweeper

clawsweeper Bot commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

@openclaw-barnacle openclaw-barnacle Bot added channel: slack Channel integration: slack size: M maintainer Maintainer-authored PR labels Sep 2, 2026
@clawsweeper

clawsweeper Bot commented Sep 2, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed September 2, 2026, 3:31 PM ET / 19:31 UTC.

ClawSweeper review

What this changes

This PR reads Slack HTTP webhook bodies under existing size, timeout, and concurrency limits before passing the buffered request to Bolt for signature verification.

Merge readiness

⚠️ Ready for maintainer review - 3 items remain

Keep 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
Reviewed head: 2a76f52b0c6767a90dfddfb2a10c26365d26b56d
Owner decision: Required. See Decision needed.

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) The patch has coherent producer-boundary ownership and focused real-HTTP coverage, with one maintainer-owned dependency-contract check remaining.
Proof confidence 🌊 off-meta tidepool Not applicable: Repository state identifies the author as a MEMBER, so the external-contributor proof gate does not apply; the PR nevertheless records real HTTP scenarios, while local dependency absence prevented independent rerun or Bolt-source inspection.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: Repository state identifies the author as a MEMBER, so the external-contributor proof gate does not apply; the PR nevertheless records real HTTP scenarios, while local dependency absence prevented independent rerun or Bolt-source inspection.
Evidence reviewed 7 items Current main retains the vulnerable handoff shape: Current main installs a passive body guard, calls Bolt's request listener, and disposes the guard when that void-returning call completes; it does not itself await Bolt's later body consumption.
Introduced handler owns the pre-auth boundary: The proposed handler acquires the existing in-flight lifecycle, reads the body under the Slack limits, supplies rawBody, and waits for the response before release.
Shared guard supplies the bounded lifecycle: The existing Plugin SDK helper performs method and capacity admission, while its body reader translates overflow and timeout into HTTP rejections.
Findings None None.
Security None None.

How this fits together

Slack 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]
Loading

Decision needed

Question Recommendation
Should this PR merge on its recorded Bolt 5.0.0 contract evidence, or should a maintainer first recheck that exact dependency source in a hydrated environment? Recheck the pinned Bolt contract: Inspect the installed Bolt 5.0.0 rawBody and verification path, then merge if it matches the PR’s cited behavior.

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

  • Resolve merge risk (P1) - A mismatch between Bolt 5.0.0's actual rawBody semantics and the cited behavior could reject valid signed Slack webhooks or weaken the intended pre-auth boundary; this checkout could not independently inspect that dependency.
  • Complete next step (P2) - Confirm the pinned Bolt 5.0.0 rawBody and signature-verification contract in a dependency-hydrated environment before merge.
Agent review details

Security

None.

PR surface

Source +30, Tests +303. Total +333 across 5 files.

View PR surface stats
Area Files Added Removed Net
Source 2 57 27 +30
Tests 3 304 1 +303
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 5 361 28 +333

Review metrics

Metric Value Why it matters
Production versus test delta production +57/-27; tests and test support +304/-1 The net production growth replaces the previous wrapper with a response-scoped bounded ingress owner; most added lines are boundary regression coverage.

Merge-risk options

Maintainer options:

  1. Confirm Bolt 5.0.0 raw-body behavior (recommended)
    Recheck the pinned dependency’s rawBody shortcut and signature-verification path in a dependency-hydrated environment before merging.
  2. Accept the versioned evidence
    A maintainer may accept the PR’s recorded exact-version source citations and HTTP coverage if independent reinspection is not needed.

Technical review

Best 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.

Labels

Label changes:

  • add P2: This is a focused repair for Slack HTTP ingress resource and delivery behavior.
  • add merge-risk: 🚨 message-delivery: An incorrect request-to-Bolt handoff could cause otherwise valid signed Slack events to be rejected.
  • add merge-risk: 🚨 security-boundary: The patch changes the body handling immediately before Slack signature verification, and its dependency contract was not independently inspectable here.
  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: Repository state identifies the author as a MEMBER, so the external-contributor proof gate does not apply; the PR nevertheless records real HTTP scenarios, while local dependency absence prevented independent rerun or Bolt-source inspection.

Label justifications:

  • P2: This is a focused repair for Slack HTTP ingress resource and delivery behavior.
  • merge-risk: 🚨 message-delivery: An incorrect request-to-Bolt handoff could cause otherwise valid signed Slack events to be rejected.
  • merge-risk: 🚨 security-boundary: The patch changes the body handling immediately before Slack signature verification, and its dependency contract was not independently inspectable here.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: Repository state identifies the author as a MEMBER, so the external-contributor proof gate does not apply; the PR nevertheless records real HTTP scenarios, while local dependency absence prevented independent rerun or Bolt-source inspection.

Evidence

What I checked:

Likely related people:

  • Peter Steinberger: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • Sarah Fortune: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)

Rank-up moves

Optional improvements that raise the rating; they are not merge blockers.

  • Recheck the installed @slack/bolt 5.0.0 rawBody and signature-verification path before merge.

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

Workflow

  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

History

Review history (1 earlier review cycle)
  • reviewed 2026-09-02T18:37:50.230Z sha b46538c9814421e57bb391644dfe56e72374cffa :: needs maintainer review before merge. :: none

@drobison00

Copy link
Copy Markdown
Contributor Author

Devin Robison · GPT-5 Codex · via @drobison00

Addressed the requested rank-up proof in 2a76f52b0c6767a90dfddfb2a10c26365d26b56d.

I verified the contract directly in installed @slack/bolt 5.0.0 source:
BufferedIncomingMessage.d.ts:5-7 declares rawBody: Buffer, and
HTTPModuleFunctions.js:98-117 returns a request that already has that buffer without invoking
raw-body again. Bolt's normal verification path then reads those exact bytes at
HTTPModuleFunctions.js:60-68. That is the path the Slack handler uses after enforcing
OpenClaw's 1 MiB, 30-second, and per-account concurrency bounds.

I also created a local-only merge of the exact amended head with current upstream/main
564e544aac738d4677f3f6813af018e6a87cd759. It merged cleanly. The focused regression suite
passed all 6 tests, the full Slack suite passed 147 files / 2,692 tests, path-scoped
check:changed passed, and the full build passed under Node 24.15.0. The scratch merge was never
pushed, and the branch remains a single commit on its frozen fork base.

@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. merge-risk: 🚨 message-delivery 🚨 May drop, duplicate, misroute, suppress, or wrongly target messages. merge-risk: 🚨 security-boundary 🚨 May affect sandboxing, authorization, credentials, or sensitive data. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Sep 2, 2026
@drobison00
drobison00 enabled auto-merge (squash) September 8, 2026 18:10
@drobison00
drobison00 merged commit c11ea06 into openclaw:main Sep 8, 2026
108 of 109 checks passed
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 9, 2026
necromman pushed a commit to necromman/openclaw that referenced this pull request Sep 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

channel: slack Channel integration: slack maintainer Maintainer-authored PR merge-risk: 🚨 message-delivery 🚨 May drop, duplicate, misroute, suppress, or wrongly target messages. merge-risk: 🚨 security-boundary 🚨 May affect sandboxing, authorization, credentials, or sensitive data. P2 Normal backlog priority with limited blast radius. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: M status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant