Files
openclaw/extensions/mattermost
Alix-007 2d26492fea fix(mattermost): bound successful REST JSON/text response reads (#96033)
* fix(mattermost): bound successful REST JSON/text response reads

The Mattermost REST client already bounds error bodies
(readResponseTextLimited) and streams guarded responses without buffering,
but the success path still called `await res.json()` / `await res.text()`,
reading the whole body into memory before parsing. A self-hosted or
compromised Mattermost server can return an arbitrarily large (or
never-terminating, content-length-less) JSON/text body and force the plugin
to buffer it unbounded.

Read successful JSON through the shared readProviderJsonResponse (16 MiB cap,
cancels the stream and throws a bounded error on overflow, same as the
provider HTTP path) and cap non-JSON success bodies with readResponseTextLimited.
uploadMattermostFile's file-info JSON is bounded the same way.

Symmetric follow-up to the #95103 / #95108 response-limit campaign.

AI-assisted.

* fix(mattermost): bound probe success JSON reads

* fix(mattermost): reject oversized success text bodies

(cherry picked from commit 9241b9701d)
2026-08-06 18:51:43 +08:00
..

Mattermost OpenClaw channel

Official OpenClaw channel plugin for Mattermost.

Install

openclaw plugins install @openclaw/mattermost

Docs

See docs/channels/mattermost.md in the OpenClaw repository, or the published docs at https://docs.openclaw.ai/channels/mattermost.