VYPR
Medium severity5.3NVD Advisory· Published Apr 9, 2026· Updated Apr 15, 2026

CVE-2026-35626

CVE-2026-35626

Description

OpenClaw before 2026.3.22 contains an unauthenticated resource exhaustion vulnerability in voice call webhook handling that buffers request bodies before provider signature checks. Attackers can send large or malicious webhook requests to exhaust server resources without authentication by bypassing signature validation.

Affected packages

Versions sourced from the GitHub Security Advisory.

PackageAffected versionsPatched versions
openclawnpm
< 2026.3.222026.3.22

Affected products

1
  • cpe:2.3:a:openclaw:openclaw:*:*:*:*:*:node.js:*:*
    Range: <2026.3.22

Patches

2
630f1479c44f

build: prepare 2026.3.23-2

https://github.com/openclaw/openclawPeter SteinbergerMar 24, 2026via ghsa
3 files changed · +26 24
  • CHANGELOG.md+24 22 modified
    @@ -8,45 +8,47 @@ Docs: https://docs.openclaw.ai
     
     ### Changes
     
    -- ModelStudio/Qwen: add standard (pay-as-you-go) DashScope endpoints for China and global Qwen API keys alongside the existing Coding Plan endpoints, and relabel the provider group to `Qwen (Alibaba Cloud Model Studio)`. (#43878)
    -- UI/clarity: consolidate button primitives (`btn--icon`, `btn--ghost`, `btn--xs`), refine the Knot theme to a black-and-red palette with WCAG 2.1 AA contrast, add config icons for Diagnostics/CLI/Secrets/ACP/MCP sections, replace the roundness slider with discrete stops, and improve accessibility with aria-labels across usage filters. (#53272) Thanks @BunsDev.
    -- CSP/Control UI: compute SHA-256 hashes for inline `<script>` blocks in the served `index.html` and include them in the `script-src` CSP directive, keeping inline scripts blocked by default while allowing explicitly hashed bootstrap code. (#53307) Thanks @BunsDev.
    -
     ### Fixes
     
    -- Plugins/ClawHub: resolve plugin API compatibility against the active runtime version at install time, and add regression coverage for current `>=2026.3.22` ClawHub package checks so installs no longer fail behind the stale `1.2.0` constant. (#53157) Thanks @futhgar.
    -- CLI/channel auth: auto-select the single login-capable configured channel for `channels login`/`logout` instead of relying on the outbound message-channel resolver, so env-only or non-auth channels no longer cause false ambiguity errors. (#53254) Thanks @BunsDev.
    -- Control UI/auth: preserve operator scopes through the device-auth bypass path, ignore cached under-scoped operator tokens, and show a clear `operator.read` fallback message when a connection really lacks read scope, so operator sessions stop failing or blanking on read-backed pages. (#53110) Thanks @BunsDev.
    -- Plugins/uninstall: accept installed `clawhub:` specs and versionless ClawHub package names as uninstall targets, so `openclaw plugins uninstall clawhub:<package>` works again even when the recorded install was pinned to a version.
    -- Auth/OpenAI tokens: stop live gateway auth-profile writes from reverting freshly saved credentials back to stale in-memory values, and make `models auth paste-token` write to the resolved agent store, so Configure, Onboard, and token-paste flows stop snapping back to expired OpenAI tokens. Fixes #53207. Related to #45516.
    -- Agents/failover: classify generic `api_error` payloads as retryable only when they include transient failure signals, so MiniMax-style backend failures still trigger model fallback without misclassifying billing, auth, or format/context errors. (#49611) Thanks @ayushozha.
    -- Diagnostics/cache trace: strip credential fields from cache-trace JSONL output while preserving non-sensitive diagnostic fields and image redaction metadata.
    -- Docs/Feishu: replace `botName` with `name` in the channel config examples so the docs match the strict account schema for per-account display names. (#52753) Thanks @haroldfabla2-hue.
    -- Doctor/plugins: make `openclaw doctor --fix` remove stale `plugins.allow` and `plugins.entries` refs left behind after plugin removal. Thanks @sallyom
    -- Agents/replay: canonicalize malformed assistant transcript content before session-history sanitization so legacy or corrupted assistant turns stop crashing Pi replay and subagent recovery paths.
    -- ClawHub/skills: keep updating already-tracked legacy Unicode slugs after the ASCII-only slug hardening, so older installs do not get stuck behind `Invalid skill slug` errors during `openclaw skills update`. (#53206) Thanks @drobison00.
    -- Infra/exec trust: preserve shell-multiplexer wrapper binaries for policy checks without breaking approved-command reconstruction, so BusyBox/ToyBox allowlist and audit flows bind to the real wrapper while execution plans stay coherent. (#53134) Thanks @vincentkoc.
    -- LINE/runtime-api: pre-export overlapping runtime symbols before the `line-runtime` star export so jiti no longer throws `TypeError: Cannot redefine property` on startup. (#53221) Thanks @Drickon.
    -- CLI/cron: make `openclaw cron add|edit --at ... --tz <iana>` honor the requested local wall-clock time for offset-less one-shot datetimes, including DST boundaries, and keep `--tz` rejected for `--every`. (#53224) Thanks @RolfHegr.
    -- Commands/auth: stop slash-command authorization from crashing or dropping valid allowlists when channel `allowFrom` resolution hits unresolved SecretRef-backed accounts, and fail closed only for the affected provider inference path. (#52791) Thanks @Lukavyi.
    -
     ## 2026.3.23
     
     ### Breaking
     
     ### Changes
     
    +- ModelStudio/Qwen: add standard (pay-as-you-go) DashScope endpoints for China and global Qwen API keys alongside the existing Coding Plan endpoints, and relabel the provider group to `Qwen (Alibaba Cloud Model Studio)`. (#43878)
    +- UI/clarity: consolidate button primitives (`btn--icon`, `btn--ghost`, `btn--xs`), refine the Knot theme to a black-and-red palette with WCAG 2.1 AA contrast, add config icons for Diagnostics/CLI/Secrets/ACP/MCP sections, replace the roundness slider with discrete stops, and improve accessibility with aria-labels across usage filters. (#53272) Thanks @BunsDev.
    +- CSP/Control UI: compute SHA-256 hashes for inline `<script>` blocks in the served `index.html` and include them in the `script-src` CSP directive, keeping inline scripts blocked by default while allowing explicitly hashed bootstrap code. (#53307) Thanks @BunsDev.
    +
     ### Fixes
     
    +- Plugins/bundled runtimes: ship bundled plugin runtime sidecars like WhatsApp `light-runtime-api.js`, Matrix `runtime-api.js`, and other plugin runtime entry files in the npm package again, so global installs stop failing on missing bundled plugin runtime surfaces.
    +- CLI/channel auth: auto-select the single configured login-capable channel for `channels login`/`logout`, harden channel ids against prototype-chain and control-character abuse, and fall back cleanly to catalog-backed channel installs, so channel auth works again for single-channel setups and on-demand channel installs. (#53254) Thanks @BunsDev.
    +- Auth/OpenAI tokens: stop live gateway auth-profile writes from reverting freshly saved credentials back to stale in-memory values, and make `models auth paste-token` write to the resolved agent store, so Configure, Onboard, and token-paste flows stop snapping back to expired OpenAI tokens. Fixes #53207. Related to #45516.
    +- Control UI/auth: preserve operator scopes through the device-auth bypass path, ignore cached under-scoped operator tokens, and show a clear `operator.read` fallback message when a connection really lacks read scope, so operator sessions stop failing or blanking on read-backed pages. (#53110) Thanks @BunsDev.
    +- Plugins/ClawHub: resolve plugin API compatibility against the active runtime version at install time, and add regression coverage for current `>=2026.3.22` ClawHub package checks so installs no longer fail behind the stale `1.2.0` constant. (#53157) Thanks @futhgar.
    +- Plugins/uninstall: accept installed `clawhub:` specs and versionless ClawHub package names as uninstall targets, so `openclaw plugins uninstall clawhub:<package>` works again even when the recorded install was pinned to a version.
     - Browser/Chrome MCP: wait for existing-session browser tabs to become usable after attach instead of treating the initial Chrome MCP handshake as ready, which reduces user-profile timeouts and repeated consent churn on macOS Chrome attach flows. Fixes #52930. Thanks @vincentkoc.
     - Browser/CDP: reuse an already-running loopback browser after a short initial reachability miss instead of immediately falling back to relaunch detection, which fixes second-run browser start/open regressions on slower headless Linux setups. Fixes #53004. Thanks @vincentkoc.
    +- Agents/web_search: use the active runtime `web_search` provider instead of stale/default selection, so agent turns keep hitting the provider you actually configured. Fixes #53020. Thanks @jzakirov.
    +- Mistral/models: lower bundled Mistral max-token defaults to safe output budgets and teach `openclaw doctor --fix` to repair old persisted Mistral provider configs that still carry context-sized output limits, avoiding deterministic Mistral 422 rejects on fresh and existing setups. Fixes #52599. Thanks @vincentkoc.
     - ClawHub/macOS auth: honor macOS auth config and XDG auth paths for saved ClawHub credentials, so `openclaw skills ...` and gateway skill browsing keep using the signed-in auth state instead of silently falling back to unauthenticated mode. Fixes #53034.
     - ClawHub/macOS: read the local ClawHub login from the macOS Application Support path and still honor XDG config on macOS, so skill browsing uses the logged-in token on both default and XDG-style setups. Fixes #52949. Thanks @scoootscooob.
     - ClawHub/skills: resolve the local ClawHub auth token for gateway skill browsing and switch browse-all requests to search so ClawControl stops falling into unauthenticated 429s and empty authenticated skill lists. Fixes #52949. Thanks @vincentkoc.
    +- Config/warnings: suppress the confusing “newer OpenClaw” warning when a config written by a same-base correction release like `2026.3.23-2` is read by `2026.3.23`, while still warning for truly newer or incompatible versions.
    +- CLI/cron: make `openclaw cron add|edit --at ... --tz <iana>` honor the requested local wall-clock time for offset-less one-shot datetimes, including DST boundaries, and keep `--tz` rejected for `--every`. (#53224) Thanks @RolfHegr.
    +- Commands/auth: stop slash-command authorization from crashing or dropping valid allowlists when channel `allowFrom` resolution hits unresolved SecretRef-backed accounts, and fail closed only for the affected provider inference path. (#52791) Thanks @Lukavyi.
    +- Agents/failover: classify generic `api_error` payloads as retryable only when they include transient failure signals, so MiniMax-style backend failures still trigger model fallback without misclassifying billing, auth, or format/context errors. (#49611) Thanks @ayushozha.
    +- LINE/runtime-api: pre-export overlapping runtime symbols before the `line-runtime` star export so jiti no longer throws `TypeError: Cannot redefine property` on startup. (#53221) Thanks @Drickon.
    +- Telegram/threading: populate `currentThreadTs` in the threading tool-context fallback for Telegram DM topics so thread-aware tools still receive the active topic context when the main thread metadata is missing. (#52217)
    +- Diagnostics/cache trace: strip credential fields from cache-trace JSONL output while preserving non-sensitive diagnostic fields and image redaction metadata.
    +- Docs/Feishu: replace `botName` with `name` in the channel config examples so the docs match the strict account schema for per-account display names. (#52753) Thanks @haroldfabla2-hue.
    +- Doctor/plugins: make `openclaw doctor --fix` remove stale `plugins.allow` and `plugins.entries` refs left behind after plugin removal. Thanks @sallyom
    +- Agents/replay: canonicalize malformed assistant transcript content before session-history sanitization so legacy or corrupted assistant turns stop crashing Pi replay and subagent recovery paths.
    +- ClawHub/skills: keep updating already-tracked legacy Unicode slugs after the ASCII-only slug hardening, so older installs do not get stuck behind `Invalid skill slug` errors during `openclaw skills update`. (#53206) Thanks @drobison00.
    +- Infra/exec trust: preserve shell-multiplexer wrapper binaries for policy checks without breaking approved-command reconstruction, so BusyBox/ToyBox allowlist and audit flows bind to the real wrapper while execution plans stay coherent. (#53134) Thanks @vincentkoc.
     - Plugins/message tool: make Discord `components` and Slack `blocks` optional again, and route Feishu `message(..., media=...)` sends through the outbound media path, so pin/unpin/react flows stop failing schema validation and Feishu file/image attachments actually send. Fixes #52970 and #52962. Thanks @vincentkoc.
     - Gateway/model pricing: stop `openrouter/auto` pricing refresh from recursing indefinitely during bootstrap, so OpenRouter auto routes can populate cached pricing and `usage.cost` again. Fixes #53035. Thanks @vincentkoc.
    -- Mistral/models: lower bundled Mistral max-token defaults to safe output budgets and teach `openclaw doctor --fix` to repair old persisted Mistral provider configs that still carry context-sized output limits, avoiding deterministic Mistral 422 rejects on fresh and existing setups. Fixes #52599. Thanks @vincentkoc.
    -- Agents/web_search: use the active runtime `web_search` provider instead of stale/default selection, so agent turns keep hitting the provider you actually configured. Fixes #53020. Thanks @jzakirov.
     - Models/OpenAI Codex OAuth: bootstrap the env-configured HTTP/HTTPS proxy dispatcher on the stored-credential refresh path before token renewal runs, so expired Codex OAuth profiles can refresh successfully in proxy-required environments instead of locking users out after the first token expiry.
     - Models/OpenAI Codex OAuth and Plugins/MiniMax OAuth: ensure env-configured HTTP/HTTPS proxy dispatchers are initialized before OAuth preflight and token exchange requests so proxy-required environments can complete MiniMax and OpenAI Codex sign-in flows again. (#52228; fixes #51619, #51569) Thanks @openperf.
     - Plugins/memory-lancedb: bootstrap LanceDB into plugin runtime state on first use when the bundled npm install does not already have it, so `plugins.slots.memory="memory-lancedb"` works again after global npm installs without moving LanceDB into OpenClaw core dependencies. Fixes #26100.
    
  • docs/.generated/plugin-sdk-api-baseline.json+1 1 modified
    @@ -2620,7 +2620,7 @@
               "exportName": "resolveCommandAuthorization",
               "kind": "function",
               "source": {
    -            "line": 303,
    +            "line": 440,
                 "path": "src/auto-reply/command-auth.ts"
               }
             },
    
  • docs/.generated/plugin-sdk-api-baseline.jsonl+1 1 modified
    @@ -287,7 +287,7 @@
     {"declaration":"export function parseCommandArgs(command: ChatCommandDefinition, raw?: string | undefined): CommandArgs | undefined;","entrypoint":"command-auth","exportName":"parseCommandArgs","importSpecifier":"openclaw/plugin-sdk/command-auth","kind":"function","recordType":"export","sourceLine":254,"sourcePath":"src/auto-reply/commands-registry.ts"}
     {"declaration":"export function resolveCommandArgChoices(params: { command: ChatCommandDefinition; arg: CommandArgDefinition; cfg?: OpenClawConfig | undefined; provider?: string | undefined; model?: string | undefined; }): ResolvedCommandArgChoice[];","entrypoint":"command-auth","exportName":"resolveCommandArgChoices","importSpecifier":"openclaw/plugin-sdk/command-auth","kind":"function","recordType":"export","sourceLine":316,"sourcePath":"src/auto-reply/commands-registry.ts"}
     {"declaration":"export function resolveCommandArgMenu(params: { command: ChatCommandDefinition; args?: CommandArgs | undefined; cfg?: OpenClawConfig | undefined; }): { arg: CommandArgDefinition; choices: ResolvedCommandArgChoice[]; title?: string | undefined; } | null;","entrypoint":"command-auth","exportName":"resolveCommandArgMenu","importSpecifier":"openclaw/plugin-sdk/command-auth","kind":"function","recordType":"export","sourceLine":346,"sourcePath":"src/auto-reply/commands-registry.ts"}
    -{"declaration":"export function resolveCommandAuthorization(params: { ctx: MsgContext; cfg: OpenClawConfig; commandAuthorized: boolean; }): CommandAuthorization;","entrypoint":"command-auth","exportName":"resolveCommandAuthorization","importSpecifier":"openclaw/plugin-sdk/command-auth","kind":"function","recordType":"export","sourceLine":303,"sourcePath":"src/auto-reply/command-auth.ts"}
    +{"declaration":"export function resolveCommandAuthorization(params: { ctx: MsgContext; cfg: OpenClawConfig; commandAuthorized: boolean; }): CommandAuthorization;","entrypoint":"command-auth","exportName":"resolveCommandAuthorization","importSpecifier":"openclaw/plugin-sdk/command-auth","kind":"function","recordType":"export","sourceLine":440,"sourcePath":"src/auto-reply/command-auth.ts"}
     {"declaration":"export function resolveCommandAuthorizedFromAuthorizers(params: { useAccessGroups: boolean; authorizers: CommandAuthorizer[]; modeWhenAccessGroupsOff?: CommandGatingModeWhenAccessGroupsOff | undefined; }): boolean;","entrypoint":"command-auth","exportName":"resolveCommandAuthorizedFromAuthorizers","importSpecifier":"openclaw/plugin-sdk/command-auth","kind":"function","recordType":"export","sourceLine":8,"sourcePath":"src/channels/command-gating.ts"}
     {"declaration":"export function resolveControlCommandGate(params: { useAccessGroups: boolean; authorizers: CommandAuthorizer[]; allowTextCommands: boolean; hasControlCommand: boolean; modeWhenAccessGroupsOff?: CommandGatingModeWhenAccessGroupsOff | undefined; }): { ...; };","entrypoint":"command-auth","exportName":"resolveControlCommandGate","importSpecifier":"openclaw/plugin-sdk/command-auth","kind":"function","recordType":"export","sourceLine":31,"sourcePath":"src/channels/command-gating.ts"}
     {"declaration":"export function resolveDirectDmAuthorizationOutcome(params: { isGroup: boolean; dmPolicy: string; senderAllowedForCommands: boolean; }): \"disabled\" | \"unauthorized\" | \"allowed\";","entrypoint":"command-auth","exportName":"resolveDirectDmAuthorizationOutcome","importSpecifier":"openclaw/plugin-sdk/command-auth","kind":"function","recordType":"export","sourceLine":120,"sourcePath":"src/plugin-sdk/command-auth.ts"}
    
651dc7450b68

fix(voice-call): harden webhook pre-auth guards

https://github.com/openclaw/openclawPeter SteinbergerMar 23, 2026via ghsa
4 files changed · +245 37
  • CHANGELOG.md+1 0 modified
    @@ -307,6 +307,7 @@ Docs: https://docs.openclaw.ai
     - Gateway/usage: include reset and deleted archived session transcripts in usage totals, session discovery, and archived-only session detail fallback so the Usage view no longer undercounts rotated sessions. (#43215) Thanks @rcrick.
     - Config/env: remove legacy `CLAWDBOT_*` and `MOLTBOT_*` compatibility env names across runtime, installers, and test tooling. Use the matching `OPENCLAW_*` env names instead.
     - Security/exec approvals: treat `time` as a transparent dispatch wrapper during allowlist evaluation and allow-always persistence so approved `time ...` commands bind the inner executable instead of the wrapper path. Thanks @YLChen-007 for reporting.
    +- Voice-call/webhooks: reject missing provider signature headers before body reads, drop the pre-auth body budget to `64 KB` / `5s`, and cap concurrent pre-auth requests per source IP so unauthenticated callers cannot force the old `1 MB` / `30s` buffering path. Thanks @SEORY0 for reporting.
     
     ## 2026.3.13
     
    
  • docs/plugins/voice-call.md+6 0 modified
    @@ -183,6 +183,12 @@ requests are acknowledged but skipped for side effects.
     Twilio conversation turns include a per-turn token in `<Gather>` callbacks, so
     stale/replayed speech callbacks cannot satisfy a newer pending transcript turn.
     
    +Unauthenticated webhook requests are rejected before body reads when the
    +provider's required signature headers are missing.
    +
    +The voice-call webhook uses the shared pre-auth body profile (64 KB / 5 seconds)
    +plus a per-IP in-flight cap before signature verification.
    +
     Example with a stable public host:
     
     ```json5
    
  • extensions/voice-call/src/webhook.test.ts+135 0 modified
    @@ -114,6 +114,23 @@ async function postWebhookForm(server: VoiceCallWebhookServer, baseUrl: string,
       });
     }
     
    +async function postWebhookFormWithHeaders(
    +  server: VoiceCallWebhookServer,
    +  baseUrl: string,
    +  body: string,
    +  headers: Record<string, string>,
    +) {
    +  const requestUrl = requireBoundRequestUrl(server, baseUrl);
    +  return await fetch(requestUrl.toString(), {
    +    method: "POST",
    +    headers: {
    +      "content-type": "application/x-www-form-urlencoded",
    +      ...headers,
    +    },
    +    body,
    +  });
    +}
    +
     describe("VoiceCallWebhookServer stale call reaper", () => {
       beforeEach(() => {
         vi.useFakeTimers();
    @@ -301,6 +318,124 @@ describe("VoiceCallWebhookServer replay handling", () => {
       });
     });
     
    +describe("VoiceCallWebhookServer pre-auth webhook guards", () => {
    +  it("rejects missing signature headers before reading the request body", async () => {
    +    const verifyWebhook = vi.fn(() => ({ ok: true, verifiedRequestKey: "twilio:req:test" }));
    +    const twilioProvider: VoiceCallProvider = {
    +      ...provider,
    +      name: "twilio",
    +      verifyWebhook,
    +    };
    +    const { manager } = createManager([]);
    +    const config = createConfig({ provider: "twilio" });
    +    const server = new VoiceCallWebhookServer(config, manager, twilioProvider);
    +    const readBodySpy = vi.spyOn(
    +      server as unknown as {
    +        readBody: (req: unknown, maxBytes: number, timeoutMs?: number) => Promise<string>;
    +      },
    +      "readBody",
    +    );
    +
    +    try {
    +      const baseUrl = await server.start();
    +      const response = await postWebhookForm(server, baseUrl, "CallSid=CA123&SpeechResult=hello");
    +
    +      expect(response.status).toBe(401);
    +      expect(await response.text()).toBe("Unauthorized");
    +      expect(readBodySpy).not.toHaveBeenCalled();
    +      expect(verifyWebhook).not.toHaveBeenCalled();
    +    } finally {
    +      readBodySpy.mockRestore();
    +      await server.stop();
    +    }
    +  });
    +
    +  it("uses the shared pre-auth body cap before verification", async () => {
    +    const verifyWebhook = vi.fn(() => ({ ok: true, verifiedRequestKey: "twilio:req:test" }));
    +    const twilioProvider: VoiceCallProvider = {
    +      ...provider,
    +      name: "twilio",
    +      verifyWebhook,
    +    };
    +    const { manager } = createManager([]);
    +    const config = createConfig({ provider: "twilio" });
    +    const server = new VoiceCallWebhookServer(config, manager, twilioProvider);
    +
    +    try {
    +      const baseUrl = await server.start();
    +      const response = await postWebhookFormWithHeaders(
    +        server,
    +        baseUrl,
    +        "CallSid=CA123&SpeechResult=".padEnd(70 * 1024, "a"),
    +        { "x-twilio-signature": "sig" },
    +      );
    +
    +      expect(response.status).toBe(413);
    +      expect(await response.text()).toBe("Payload Too Large");
    +      expect(verifyWebhook).not.toHaveBeenCalled();
    +    } finally {
    +      await server.stop();
    +    }
    +  });
    +
    +  it("limits concurrent pre-auth requests per source IP", async () => {
    +    const twilioProvider: VoiceCallProvider = {
    +      ...provider,
    +      name: "twilio",
    +      verifyWebhook: () => ({ ok: true, verifiedRequestKey: "twilio:req:test" }),
    +    };
    +    const { manager } = createManager([]);
    +    const config = createConfig({ provider: "twilio" });
    +    const server = new VoiceCallWebhookServer(config, manager, twilioProvider);
    +
    +    let enteredReads = 0;
    +    let releaseReads!: () => void;
    +    let unblockReadBodies!: () => void;
    +    const enteredEightReads = new Promise<void>((resolve) => {
    +      releaseReads = resolve;
    +    });
    +    const unblockReads = new Promise<void>((resolve) => {
    +      unblockReadBodies = resolve;
    +    });
    +    const readBodySpy = vi.spyOn(
    +      server as unknown as {
    +        readBody: (req: unknown, maxBytes: number, timeoutMs?: number) => Promise<string>;
    +      },
    +      "readBody",
    +    );
    +    readBodySpy.mockImplementation(async () => {
    +      enteredReads += 1;
    +      if (enteredReads === 8) {
    +        releaseReads();
    +      }
    +      await unblockReads;
    +      return "CallSid=CA123&SpeechResult=hello";
    +    });
    +
    +    try {
    +      const baseUrl = await server.start();
    +      const headers = { "x-twilio-signature": "sig" };
    +      const inFlightRequests = Array.from({ length: 8 }, () =>
    +        postWebhookFormWithHeaders(server, baseUrl, "CallSid=CA123", headers),
    +      );
    +      await enteredEightReads;
    +
    +      const rejected = await postWebhookFormWithHeaders(server, baseUrl, "CallSid=CA999", headers);
    +      expect(rejected.status).toBe(429);
    +      expect(await rejected.text()).toBe("Too Many Requests");
    +
    +      unblockReadBodies();
    +
    +      const settled = await Promise.all(inFlightRequests);
    +      expect(settled.every((response) => response.status === 200)).toBe(true);
    +    } finally {
    +      unblockReadBodies();
    +      readBodySpy.mockRestore();
    +      await server.stop();
    +    }
    +  });
    +});
    +
     describe("VoiceCallWebhookServer response normalization", () => {
       it("preserves explicit empty provider response bodies", async () => {
         const responseProvider: VoiceCallProvider = {
    
  • extensions/voice-call/src/webhook.ts+103 37 modified
    @@ -1,12 +1,17 @@
     import http from "node:http";
     import { URL } from "node:url";
    +import {
    +  createWebhookInFlightLimiter,
    +  WEBHOOK_BODY_READ_DEFAULTS,
    +} from "openclaw/plugin-sdk/webhook-ingress";
     import {
       isRequestBodyLimitError,
       readRequestBodyWithLimit,
       requestBodyErrorToText,
     } from "../api.js";
     import { normalizeVoiceCallConfig, type VoiceCallConfig } from "./config.js";
     import type { CoreAgentDeps, CoreConfig } from "./core-bridge.js";
    +import { getHeader } from "./http-headers.js";
     import type { CallManager } from "./manager.js";
     import type { MediaStreamConfig } from "./media-stream.js";
     import { MediaStreamHandler } from "./media-stream.js";
    @@ -16,10 +21,18 @@ import type { TwilioProvider } from "./providers/twilio.js";
     import type { CallRecord, NormalizedEvent, WebhookContext } from "./types.js";
     import { startStaleCallReaper } from "./webhook/stale-call-reaper.js";
     
    -const MAX_WEBHOOK_BODY_BYTES = 1024 * 1024;
    +const MAX_WEBHOOK_BODY_BYTES = WEBHOOK_BODY_READ_DEFAULTS.preAuth.maxBytes;
    +const WEBHOOK_BODY_TIMEOUT_MS = WEBHOOK_BODY_READ_DEFAULTS.preAuth.timeoutMs;
     const STREAM_DISCONNECT_HANGUP_GRACE_MS = 2000;
     const TRANSCRIPT_LOG_MAX_CHARS = 200;
     
    +type WebhookHeaderGateResult =
    +  | { ok: true }
    +  | {
    +      ok: false;
    +      reason: string;
    +    };
    +
     function sanitizeTranscriptForLog(value: string): string {
       const sanitized = value
         .replace(/[\u0000-\u001f\u007f]/g, " ")
    @@ -70,6 +83,7 @@ export class VoiceCallWebhookServer {
       private coreConfig: CoreConfig | null;
       private agentRuntime: CoreAgentDeps | null;
       private stopStaleCallReaper: (() => void) | null = null;
    +  private readonly webhookInFlightLimiter = createWebhookInFlightLimiter();
     
       /** Media stream handler for bidirectional audio (when streaming enabled) */
       private mediaStreamHandler: MediaStreamHandler | null = null;
    @@ -350,6 +364,7 @@ export class VoiceCallWebhookServer {
           clearTimeout(timer);
         }
         this.pendingDisconnectHangups.clear();
    +    this.webhookInFlightLimiter.clear();
     
         if (this.stopStaleCallReaper) {
           this.stopStaleCallReaper();
    @@ -444,49 +459,100 @@ export class VoiceCallWebhookServer {
           return { statusCode: 405, body: "Method Not Allowed" };
         }
     
    -    let body = "";
    +    const headerGate = this.verifyPreAuthWebhookHeaders(req.headers);
    +    if (!headerGate.ok) {
    +      console.warn(`[voice-call] Webhook rejected before body read: ${headerGate.reason}`);
    +      return { statusCode: 401, body: "Unauthorized" };
    +    }
    +
    +    const inFlightKey = req.socket.remoteAddress ?? "";
    +    if (!this.webhookInFlightLimiter.tryAcquire(inFlightKey)) {
    +      console.warn(`[voice-call] Webhook rejected before body read: too many in-flight requests`);
    +      return { statusCode: 429, body: "Too Many Requests" };
    +    }
    +
         try {
    -      body = await this.readBody(req, MAX_WEBHOOK_BODY_BYTES);
    -    } catch (err) {
    -      if (isRequestBodyLimitError(err, "PAYLOAD_TOO_LARGE")) {
    -        return { statusCode: 413, body: "Payload Too Large" };
    -      }
    -      if (isRequestBodyLimitError(err, "REQUEST_BODY_TIMEOUT")) {
    -        return { statusCode: 408, body: requestBodyErrorToText("REQUEST_BODY_TIMEOUT") };
    +      let body = "";
    +      try {
    +        body = await this.readBody(req, MAX_WEBHOOK_BODY_BYTES, WEBHOOK_BODY_TIMEOUT_MS);
    +      } catch (err) {
    +        if (isRequestBodyLimitError(err, "PAYLOAD_TOO_LARGE")) {
    +          return { statusCode: 413, body: "Payload Too Large" };
    +        }
    +        if (isRequestBodyLimitError(err, "REQUEST_BODY_TIMEOUT")) {
    +          return { statusCode: 408, body: requestBodyErrorToText("REQUEST_BODY_TIMEOUT") };
    +        }
    +        throw err;
           }
    -      throw err;
    -    }
     
    -    const ctx: WebhookContext = {
    -      headers: req.headers as Record<string, string | string[] | undefined>,
    -      rawBody: body,
    -      url: url.toString(),
    -      method: "POST",
    -      query: Object.fromEntries(url.searchParams),
    -      remoteAddress: req.socket.remoteAddress ?? undefined,
    -    };
    +      const ctx: WebhookContext = {
    +        headers: req.headers as Record<string, string | string[] | undefined>,
    +        rawBody: body,
    +        url: url.toString(),
    +        method: "POST",
    +        query: Object.fromEntries(url.searchParams),
    +        remoteAddress: req.socket.remoteAddress ?? undefined,
    +      };
     
    -    const verification = this.provider.verifyWebhook(ctx);
    -    if (!verification.ok) {
    -      console.warn(`[voice-call] Webhook verification failed: ${verification.reason}`);
    -      return { statusCode: 401, body: "Unauthorized" };
    -    }
    -    if (!verification.verifiedRequestKey) {
    -      console.warn("[voice-call] Webhook verification succeeded without request identity key");
    -      return { statusCode: 401, body: "Unauthorized" };
    -    }
    +      const verification = this.provider.verifyWebhook(ctx);
    +      if (!verification.ok) {
    +        console.warn(`[voice-call] Webhook verification failed: ${verification.reason}`);
    +        return { statusCode: 401, body: "Unauthorized" };
    +      }
    +      if (!verification.verifiedRequestKey) {
    +        console.warn("[voice-call] Webhook verification succeeded without request identity key");
    +        return { statusCode: 401, body: "Unauthorized" };
    +      }
     
    -    const parsed = this.provider.parseWebhookEvent(ctx, {
    -      verifiedRequestKey: verification.verifiedRequestKey,
    -    });
    +      const parsed = this.provider.parseWebhookEvent(ctx, {
    +        verifiedRequestKey: verification.verifiedRequestKey,
    +      });
    +
    +      if (verification.isReplay) {
    +        console.warn("[voice-call] Replay detected; skipping event side effects");
    +      } else {
    +        this.processParsedEvents(parsed.events);
    +      }
     
    -    if (verification.isReplay) {
    -      console.warn("[voice-call] Replay detected; skipping event side effects");
    -    } else {
    -      this.processParsedEvents(parsed.events);
    +      return normalizeWebhookResponse(parsed);
    +    } finally {
    +      this.webhookInFlightLimiter.release(inFlightKey);
         }
    +  }
     
    -    return normalizeWebhookResponse(parsed);
    +  private verifyPreAuthWebhookHeaders(headers: http.IncomingHttpHeaders): WebhookHeaderGateResult {
    +    if (this.config.skipSignatureVerification) {
    +      return { ok: true };
    +    }
    +    switch (this.provider.name) {
    +      case "telnyx": {
    +        const signature = getHeader(headers, "telnyx-signature-ed25519");
    +        const timestamp = getHeader(headers, "telnyx-timestamp");
    +        if (signature && timestamp) {
    +          return { ok: true };
    +        }
    +        return { ok: false, reason: "missing Telnyx signature or timestamp header" };
    +      }
    +      case "twilio":
    +        if (getHeader(headers, "x-twilio-signature")) {
    +          return { ok: true };
    +        }
    +        return { ok: false, reason: "missing X-Twilio-Signature header" };
    +      case "plivo": {
    +        const hasV3 =
    +          Boolean(getHeader(headers, "x-plivo-signature-v3")) &&
    +          Boolean(getHeader(headers, "x-plivo-signature-v3-nonce"));
    +        const hasV2 =
    +          Boolean(getHeader(headers, "x-plivo-signature-v2")) &&
    +          Boolean(getHeader(headers, "x-plivo-signature-v2-nonce"));
    +        if (hasV3 || hasV2) {
    +          return { ok: true };
    +        }
    +        return { ok: false, reason: "missing Plivo signature headers" };
    +      }
    +      default:
    +        return { ok: true };
    +    }
       }
     
       private processParsedEvents(events: NormalizedEvent[]): void {
    @@ -515,7 +581,7 @@ export class VoiceCallWebhookServer {
       private readBody(
         req: http.IncomingMessage,
         maxBytes: number,
    -    timeoutMs = 30_000,
    +    timeoutMs = WEBHOOK_BODY_TIMEOUT_MS,
       ): Promise<string> {
         return readRequestBodyWithLimit(req, { maxBytes, timeoutMs });
       }
    

Vulnerability mechanics

Generated by null/stub on May 9, 2026. Inputs: CWE entries + fix-commit diffs from this CVE's patches. Citations validated against bundle.

References

6

News mentions

0

No linked articles in our index yet.