openclaw - 💡(How to fix) Fix Security: allowBots=true in group channels allows bot-to-bot relay without owner present — add requireOwnerPresent guard [1 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
openclaw/openclaw#59284Fetched 2026-04-08 02:26:26
View on GitHub
Comments
0
Participants
1
Timeline
0
Reactions
0

When allowBots: true is set on a Slack channel config, the inbound message handler allows other bots to route messages to the agent — even if the authorized owner user is not a member of that channel. No human oversight is present to catch the relay.

Root Cause

In extensions/slack/src/monitor/message-handler/prepare.ts, the authorizeSlackInboundMessage function drops bot messages only when allowBots=false. When allowBots=true, bot messages proceed through authorization with the same path as human messages.

The ownerAuthorized check resolved at line ~431 is only used for control command gating (resolveControlCommandGate) — it does not gate general message routing. A bot whose sender ID is not in allowFrom can still successfully route a message as long as it clears channelUserAuthorized (channel-level users allowlist, if configured, or open by default).

This means: a rogue bot (or another agent) in a Slack channel with allowBots: true can relay messages to the OpenClaw agent indefinitely, with no human present to oversee it.

Code Example

{
  "channels": {
    "slack": {
      "channels": {
        "C0XXXXXXX": {
          "allowBots": true
        }
      }
    }
  }
}

---

{
  "channels": {
    "slack": {
      "channels": {
        "C0XXXXXXX": {
          "allowBots": true,
          "requireOwnerPresent": true
        }
      }
    }
  }
}

---

requireOwnerPresent?: boolean;

---

requireOwnerPresent?: boolean;
RAW_BUFFERClick to expand / collapse

Summary

When allowBots: true is set on a Slack channel config, the inbound message handler allows other bots to route messages to the agent — even if the authorized owner user is not a member of that channel. No human oversight is present to catch the relay.

Root Cause

In extensions/slack/src/monitor/message-handler/prepare.ts, the authorizeSlackInboundMessage function drops bot messages only when allowBots=false. When allowBots=true, bot messages proceed through authorization with the same path as human messages.

The ownerAuthorized check resolved at line ~431 is only used for control command gating (resolveControlCommandGate) — it does not gate general message routing. A bot whose sender ID is not in allowFrom can still successfully route a message as long as it clears channelUserAuthorized (channel-level users allowlist, if configured, or open by default).

This means: a rogue bot (or another agent) in a Slack channel with allowBots: true can relay messages to the OpenClaw agent indefinitely, with no human present to oversee it.

Reproduction

  1. Configure a Slack channel with allowBots: true:
{
  "channels": {
    "slack": {
      "channels": {
        "C0XXXXXXX": {
          "allowBots": true
        }
      }
    }
  }
}
  1. Ensure the authorized owner (from allowFrom) is not a member of that channel.
  2. Have another bot post a message in that channel.
  3. Observe: OpenClaw routes the message and responds, with no authorized human present.

Proposed Fix

Add a requireOwnerPresent config option (per-channel and/or global under channels.slack) that, when enabled, checks whether the authorized owner is a member of the channel before routing any message (bot or human).

Config surface (proposed):

{
  "channels": {
    "slack": {
      "channels": {
        "C0XXXXXXX": {
          "allowBots": true,
          "requireOwnerPresent": true
        }
      }
    }
  }
}

Implementation sketch:

  • In resolveSlackConversationContext (or authorizeSlackInboundMessage), after resolving channelConfig, check if requireOwnerPresent is set.
  • If set, call conversations.members to check whether any user from allowFrom is a member of the channel.
  • Cache the result per channel (TTL ~60s) to avoid per-message API calls.
  • If no authorized owner is present → drop with logVerbose('slack: drop message (owner not present in channel)') and return null.

Alternatively, consider making requireOwnerPresent: true the default when allowBots: true is set on a channel, to fail-safe rather than fail-open.

Related Types

Relevant field to add to SlackChannelConfigEntry in channel-config.ts:

requireOwnerPresent?: boolean;

And in SlackChannelConfigResolved:

requireOwnerPresent?: boolean;

Severity

Medium–High. An attacker controlling another bot in a shared Slack workspace could relay arbitrary prompts to an OpenClaw agent running with tool access (exec, file writes, etc.), with no authorized human in the loop to notice.

Notes

  • The allowBots feature is legitimate and necessary (e.g. receiving notifications from CI bots, webhook bots). The fix should not disable it — only add the owner-presence guard as an opt-in (or opt-out-of-default) control.
  • Member caching is important: conversations.members is rate-limited. A per-channel in-memory cache with a short TTL (30–60s) is sufficient.
  • This was surfaced during a live deployment where the OpenClaw agent was in a Slack MPDM with another agent (Hermes). The owner was present in the group, but the vulnerability was visible: if the owner left, the bot relay would continue unguarded.

extent analysis

TL;DR

To fix the issue, add a requireOwnerPresent config option to check if the authorized owner is a member of the channel before routing any message when allowBots: true is set.

Guidance

  • Implement the proposed requireOwnerPresent config option in the SlackChannelConfigEntry and SlackChannelConfigResolved types.
  • Modify the authorizeSlackInboundMessage function to check for the requireOwnerPresent option and verify the owner's presence in the channel using the conversations.members API.
  • Cache the result per channel with a short TTL (e.g., 60s) to avoid excessive API calls.
  • Consider making requireOwnerPresent: true the default when allowBots: true is set to fail-safe rather than fail-open.

Example

{
  "channels": {
    "slack": {
      "channels": {
        "C0XXXXXXX": {
          "allowBots": true,
          "requireOwnerPresent": true
        }
      }
    }
  }
}

Notes

  • The fix should not disable the legitimate allowBots feature, but rather add an opt-in (or opt-out-of-default) control to ensure owner presence.
  • Member caching is crucial to avoid rate limits on the conversations.members API.

Recommendation

Apply the proposed workaround by adding the requireOwnerPresent config option and implementing the necessary checks to ensure owner presence in the channel. This will prevent unauthorized bot relays and mitigate the security risk.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING