Skip to content

feat(security): audit open ingress control-plane tool exposure#100965

Merged
steipete merged 2 commits into
openclaw:mainfrom
hugenshen:codex/audit-control-plane-exposure
Jul 11, 2026
Merged

feat(security): audit open ingress control-plane tool exposure#100965
steipete merged 2 commits into
openclaw:mainfrom
hugenshen:codex/audit-control-plane-exposure

Conversation

@hugenshen

@hugenshen hugenshen commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

What Problem This Solves

gateway and cron are persistent control-plane write surfaces:

  • gateway can apply/patch live config (config.apply, config.patch, update.run)
  • cron can create scheduled jobs that survive the originating chat/task

src/security/dangerous-tools.ts already classifies both as high-risk / owner-only core tools, and public docs recommend denying them on untrusted surfaces. But the security audit had a visibility gap: existing exposure-matrix checks flagged elevated and runtime/filesystem tools on open ingress, not control-plane tools (gateway, cron).

Risk: an operator can run openclaw security audit, see exec/runtime warnings, and still miss that open group/DM ingress can reach agents with gateway or cron enabled.


Why This Change Was Made

Add a new exposure-matrix finding that mirrors the exec/runtime pattern:

  1. Detect open inbound policies (listOpenInboundPolicies)
  2. For each agent scope, resolve effective tool policies
  3. If gateway and/or cron are allowed, emit security.exposure.open_groups_with_control_plane_tools (critical)

User Impact

  • Runtime: none
  • Operators: openclaw security audit may now report a new critical finding when open ingress and control-plane tools overlap

Evidence

pnpm test src/security/audit-trust-model.test.ts
node --import tsx scripts/proof-audit-control-plane-exposure.mjs
Test Files  1 passed (1)
     Tests  1 passed (1)

Real behavior proof

  • Behavior or issue addressed: Open ingress could reach gateway/cron without a dedicated security-audit finding.
  • Real environment tested: macOS (Darwin), Node.js v22.22.0.
  • Exact steps or command run after this patch:
    1. node --import tsx scripts/proof-audit-control-plane-exposure.mjs
    2. pnpm test src/security/audit-trust-model.test.ts
  • Evidence after fix:
$ node --import tsx scripts/proof-audit-control-plane-exposure.mjs
=== openclaw security audit exposure matrix (programmatic) ===

-- open group + coding profile --
[critical] security.exposure.open_groups_with_control_plane_tools: Open group/DM policy with gateway/cron control-plane tools exposed
Found inbound policy="open" at:
- channels.whatsapp.groupPolicy
Control-plane tool exposure contexts:
- agents.defaults (profile=coding; controlPlane=[cron])

-- open DM + tools.allow gateway --
[critical] security.exposure.open_groups_with_control_plane_tools: Open group/DM policy with gateway/cron control-plane tools exposed
Control-plane tool exposure contexts:
- agents.defaults (profile=none; controlPlane=[gateway])

-- open group + deny gateway/cron --
(no control-plane finding)

ALL PROOF ASSERTIONS PASSED
  • Observed result after fix: Open group with tools.profile="coding" emits a critical control-plane finding naming cron; open DM with explicit gateway allow is flagged; deny list suppresses the finding.
  • What was not tested: Full openclaw security audit CLI against a live config file on disk; proof uses the production exposure-matrix collector directly.

Checklist

  • New finding only fires on open inbound policies
  • Per-agent scope reporting (agents.defaults + agents.list.*)
  • Critical severity for persistent control-plane exposure
  • Regression tests for allow / deny / non-open ingress
  • Real behavior proof attached

AI-assisted disclosure

  • AI-assisted (Cursor agent)
  • Human-run Real behavior proof from local setup

@hugenshen
hugenshen requested a review from a team as a code owner July 6, 2026 15:02
@clawsweeper

clawsweeper Bot commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed July 7, 2026, 10:53 AM ET / 14:53 UTC.

Summary
The PR adds a critical security-audit exposure-matrix finding for open DM/group ingress that can reach gateway or cron, documents the check ID, and adds trust-model regression cases.

PR surface: Source +57, Tests +68, Docs +1. Total +126 across 3 files.

Reproducibility: yes. at source level: current main's exposure-matrix collector lacks a gateway/cron control-plane check while the CLI consumes that collector. The PR body includes after-fix terminal output from the production collector path, but I did not run tests in this read-only review.

Review metrics: 1 noteworthy metric.

  • Audit output contract: 1 critical check ID added. Security audit check IDs are operator-facing and can be consumed by suppressions, scripts, dashboards, and docs before merge.

Merge readiness
Overall: 🐚 platinum hermit
Proof: 🐚 platinum hermit
Patch quality: 🐚 platinum hermit
Result: ready for maintainer review.

Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch.

Rank-up moves:

Risk before merge

  • [P1] The live PR is currently dirty/merge-conflicting, so the exact merge result still needs a rebase or conflict resolution before final merge review.
  • [P1] The PR adds a new critical, machine-readable security-audit check ID that may affect operator suppressions, scripts, dashboards, or docs consumers after upgrade.
  • [P1] The broader open PR at security(audit): flag reachable plugin command chat surfaces #100945 overlaps the same control-plane audit contract with additional plugin command-surface scope, so maintainers should choose the canonical scope before landing both paths.

Maintainer options:

  1. Confirm focused contract before merge (recommended)
    Have security owners accept the new check ID/scope, then rebase the branch and rerun the focused trust-model validation before merge.
  2. Accept audit-output compatibility risk
    Maintainers may intentionally accept that existing audit consumers can see a new critical check ID after upgrade because the finding improves operator visibility.
  3. Pause behind the broader audit PR
    If the broader PR should own the final contract, keep this PR paused until that replacement is proof-positive and viable.

Next step before merge

  • [P2] Manual review is required because the PR has a protected security label, changes an operator-facing audit-output contract, overlaps another open audit PR, and is currently merge-conflicting.

Maintainer decision needed

  • Question: Should this focused security.exposure.open_groups_with_control_plane_tools check be the canonical control-plane audit contract, or should that contract be folded into security(audit): flag reachable plugin command chat surfaces #100945?
  • Rationale: The PR changes security-audit output consumed by operators, carries a protected security label, and overlaps another open contributor PR with broader audit scope.
  • Likely owner: steipete — They have the clearest feature-history signal for the existing exposure-matrix audit behavior this PR extends.
  • Options:
    • Land focused check after rebase (recommended): Accept this PR as the narrow control-plane exposure fix, resolve the merge conflict, and leave plugin command-surface auditing to separate work.
    • Fold into broader audit PR: Use security(audit): flag reachable plugin command chat surfaces #100945 as the canonical audit contract only after it has sufficient proof and matching docs.
    • Rename or rescope before merge: Ask the contributor to align the check ID and wording with the broader proposal before continuing merge review.

Security
Cleared: Cleared: the diff adds security-audit diagnostics, docs, and tests without changing dependencies, workflows, secrets handling, permissions, or runtime enforcement.

Review details

Best possible solution:

Land a rebased, maintainer-approved focused audit contract, or explicitly fold this control-plane check into the broader audit PR if security owners choose that as the canonical path.

Do we have a high-confidence way to reproduce the issue?

Yes, at source level: current main's exposure-matrix collector lacks a gateway/cron control-plane check while the CLI consumes that collector. The PR body includes after-fix terminal output from the production collector path, but I did not run tests in this read-only review.

Is this the best way to solve the issue?

Yes for the focused gap: extending the existing exposure matrix is the narrow owner-boundary fix for this diagnostic. The merge-ready solution still needs maintainer-confirmed check ID/scope and a rebase because the live PR is dirty.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against 72ca911e3c33.

Label changes

Label justifications:

  • P2: This is a normal-priority security-audit improvement with no runtime enforcement change and a bounded operator-facing blast radius.
  • merge-risk: 🚨 compatibility: The PR adds a new critical security-audit check ID that existing audit consumers may need to recognize after upgrade.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (terminal): Sufficient terminal proof: the PR body shows after-fix output from a macOS Node run of the production exposure-matrix collector plus the focused test result; full CLI proof would improve confidence but is not required for this collector-only change.
  • proof: sufficient: Contributor real behavior proof is sufficient. Sufficient terminal proof: the PR body shows after-fix output from a macOS Node run of the production exposure-matrix collector plus the focused test result; full CLI proof would improve confidence but is not required for this collector-only change.
Evidence reviewed

PR surface:

Source +57, Tests +68, Docs +1. Total +126 across 3 files.

View PR surface stats
Area Files Added Removed Net
Source 1 58 1 +57
Tests 1 68 0 +68
Docs 1 1 0 +1
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 3 127 1 +126

What I checked:

Likely related people:

  • steipete: Introduced the existing open-group runtime/filesystem exposure-matrix pattern this PR extends and the nearby multi-user trust-model audit behavior. (role: security audit feature-history contributor; confidence: high; commits: 049b8b14bc78, 4d124e4a9b75; files: src/security/audit-extra.sync.ts)
  • Takhoffman: Authored the data-driven tool catalog history that defines cron as part of the coding profile and gateway as an automation tool, which the new audit check relies on. (role: adjacent tool-catalog contributor; confidence: medium; commits: 9e1a13bf4c6a; files: src/agents/tool-catalog.ts)
  • VectorPeak: Current line blame for the audit collector, docs catalog, dangerous-tool constants, and tool catalog points at a broad recent commit, though the commit subject is not specific to this audit feature. (role: recent line-blame contributor; confidence: low; commits: cd5c3fc3b779; files: src/security/audit-extra.sync.ts, docs/gateway/security/audit-checks.md, src/security/dangerous-tools.ts)
What the crustacean ranks mean
  • 🦀 challenger crab: rare, exceptional readiness with strong proof, clean implementation, and convincing validation.
  • 🦞 diamond lobster: very strong readiness with only minor maintainer review expected.
  • 🐚 platinum hermit: good normal PR, likely mergeable with ordinary maintainer review.
  • 🦐 gold shrimp: useful signal, but proof or patch confidence is still limited.
  • 🦪 silver shellfish: thin signal; proof, validation, or implementation needs work.
  • 🧂 unranked krab: not merge-ready because proof is missing/unusable or there are serious correctness or safety concerns.
  • 🌊 off-meta tidepool: rating does not apply to this item.

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.

How this review workflow works
  • 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.
Review history (3 earlier review cycles)
  • reviewed 2026-07-06T15:35:21.792Z sha 0b72cd5 :: needs real behavior proof before merge. :: [P2] Document the new audit check ID
  • reviewed 2026-07-06T17:27:13.190Z sha d4b5abb :: found issues before merge. :: [P2] Document the new audit check ID | [P2] Remove the checked-in PR body file
  • reviewed 2026-07-07T14:33:10.708Z sha a671c12 :: needs maintainer review before merge. :: none

@clawsweeper clawsweeper Bot added rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. P2 Normal backlog priority with limited blast radius. labels Jul 6, 2026
@openclaw-barnacle openclaw-barnacle Bot added scripts Repository scripts size: M and removed size: S labels Jul 6, 2026
@hugenshen

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event repository_dispatch).
Result: the existing ClawSweeper review comment will be edited in place when the review finishes.

@clawsweeper clawsweeper Bot added proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. and removed rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. labels Jul 6, 2026
@hugenshen
hugenshen force-pushed the codex/audit-control-plane-exposure branch from d4b5abb to a671c12 Compare July 7, 2026 14:21
@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation gateway Gateway runtime security Security documentation labels Jul 7, 2026
@clawsweeper clawsweeper Bot added 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. and removed rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Jul 7, 2026
@hugenshen
hugenshen force-pushed the codex/audit-control-plane-exposure branch from a671c12 to dcfefa9 Compare July 7, 2026 14:40
@openclaw-barnacle openclaw-barnacle Bot added size: S and removed scripts Repository scripts size: M labels Jul 7, 2026
@steipete steipete self-assigned this Jul 11, 2026
@steipete
steipete force-pushed the codex/audit-control-plane-exposure branch from dcfefa9 to 9ddbd72 Compare July 11, 2026 19:26
@openclaw-barnacle openclaw-barnacle Bot added agents Agent runtime and tooling size: M and removed size: S labels Jul 11, 2026
@steipete
steipete merged commit 589f1c0 into openclaw:main Jul 11, 2026
115 of 117 checks passed
@steipete

Copy link
Copy Markdown
Contributor

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Jul 12, 2026
…law#100965)

* fix(security): audit open control-plane exposure

Co-authored-by: NIO <[email protected]>

* chore: keep sweep changelog neutral

---------

Co-authored-by: Peter Steinberger <[email protected]>
Co-authored-by: NIO <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agents Agent runtime and tooling docs Improvements or additions to documentation gateway Gateway runtime merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. P2 Normal backlog priority with limited blast radius. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. security Security documentation 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.

2 participants