fix(security): harden msteams webhook ingress timeouts#25960
Merged
steipete merged 1 commit intoopenclaw:mainfrom Mar 2, 2026
Merged
Conversation
steipete
added a commit
that referenced
this pull request
Mar 2, 2026
Contributor
|
Landed via temp rebase onto main.
Thanks @bmendonca3! |
This was referenced Mar 2, 2026
john-ver
pushed a commit
to apmcoin/apmclaw
that referenced
this pull request
Mar 9, 2026
dustin-olenslager
pushed a commit
to dustin-olenslager/ironclaw-supreme
that referenced
this pull request
Mar 24, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Harden the MS Teams webhook HTTP ingress against slow-body socket-hold DoS by applying explicit server timeouts when the provider starts.
Change Type
Scope
extensions/msteams/src/monitor.tsextensions/msteams/src/monitor.test.tsSecurity Impact
Before this change, the webhook server inherited Node defaults (
timeout=0, long request/header windows), allowing unauthenticated clients to hold webhook sockets with partial request bodies before auth middleware runs. This can exhaust available connections and degrade/deny legitimate Teams traffic.This change applies explicit ingress limits:
Repro + Verification
Deterministic local repro (pre-fix)
express.json()before auth middleware (matching monitor middleware order).POST /api/messageswith largeContent-Lengthplus partial JSON body.Observed pre-fix defaults/evidence:
requestTimeout: 300000headersTimeout: 60000keepAliveTimeout: 5000Regression tests
pnpm vitest run extensions/msteams/src/monitor.test.ts --maxWorkers=1pnpm vitest run extensions/msteams/src/inbound.test.ts extensions/msteams/src/monitor.test.ts --maxWorkers=1Evidence
Dedupe searches and related items reviewed:
msteams slowlorissearch: no matching issue/PRmsteams requestTimeoutsearch: no matching issue/PRmsteams headersTimeoutsearch: no matching issue/PRmsteams server.timeoutsearch: no matching issue/PRHuman Verification
Compatibility / Migration
No config schema changes and no migration required.
Failure Recovery
If timeout values need adjustment for specific environments, this change is isolated to MS Teams monitor startup and can be quickly tuned/reverted in one file.
Risks and Mitigations
Risk:
Mitigations:
Greptile Summary
Added HTTP server timeout hardening to the MS Teams webhook ingress to prevent slowloris-style attacks and slow-body DoS vectors. The implementation introduces three configurable timeout controls: inactivity timeout (30s default), request timeout (30s default), and headers timeout (15s default, clamped to request timeout). The new
applyMSTeamsWebhookTimeoutsfunction is applied to the HTTP server on line 306 ofmonitor.ts, providing defense-in-depth protection against malicious webhook requests that could exhaust server resources.applyMSTeamsWebhookTimeoutsfunction with proper timeout clamping logicConfidence Score: 5/5
Last reviewed commit: 9aa11eb