Skip to content

feat(security): warn on inert mutable allowFrom entries - #131129

Merged
steipete merged 2 commits into
mainfrom
steipete/sender-auth-stage5-audit
Aug 27, 2026
Merged

steipete merged 2 commits into
mainfrom
steipete/sender-auth-stage5-audit

Conversation

@steipete

Copy link
Copy Markdown
Contributor

Closes #131099. RFC stage 5 of the sender-authentication-strength design (openclaw/rfcs#51), following the landed kernel (#123782 → d561469) and SDK contract (#123793 → ea552df).

What Problem This Solves

An allowFrom entry that only matches through a mutable-class alias (display name, tag, email-as-alias) can never authorize a sender while name matching is disabled — the shipped default — and nothing tells the operator: the entry is silently inert, the worst failure class this repo tracks. In the opposite direction, an operator who enabled dangerouslyAllowNameMatching has no way to see how many entries would stop authorizing before turning it back off. The existing audit wording also conflates the two weak identifier classes the landed scale distinguishes.

Why This Change Was Made

  • Classifier seam at the owner boundary. ChannelSecurityDmPolicy gains an optional classifyEntryAuthentication; channels derive it in one line from their existing ingress identity via the new identityEntryAuthenticationClassifier helper (exported through openclaw/plugin-sdk/channel-ingress-runtime, +1 export and +1 callable budget with in-line justification; packaged consumer imports and calls it). The helper reuses the kernel's canonical per-field strength resolution — one resolution path, no duplicate policy.
  • Two operator-visible findings in security audit (the inert warning also reaches doctor through the existing seam):
    • channels.<id>.allowFrom.mutable_entries_inert (warn, default path): "N of M entries in <path>allowFrom only match mutable identifiers … silently inert", remediation: use stable sender IDs.
    • The existing dangerous_name_matching_enabled info finding now carries the lockout preview ("N of M entries … would stop authorizing if disabled") and widened wording distinguishing mutable aliases from asserted-but-unauthenticated identifiers, naming both rejection reason codes.
    • Counts and config paths only — no raw entry values in any finding.
  • Five channels wired (Discord, Slack, Google Chat, Mattermost, IRC); their identity declarations moved into dedicated ingress-identity.ts owner modules so security adapters stop importing monitor/send implementations (~380 lines moved, not new logic). Teams (no resolveDmPolicy), Feishu (no mutable fields), and Twitch (no security adapter) are ineligible and unchanged.
  • Connected repairs found while testing (pathfinder): Discord's older name_based_entries finding printed raw configured names/tags — it now reports counts by source path (net-negative fix); and symbolic accessGroup: references were falsely classified as mutable by both the new audit and the older shared detector — the canonical parser now excludes them in both owners, with failing-before regressions.

No new config, no schema change, no admission behavior change.

User Impact

openclaw security audit (and openclaw doctor, for the inert case) now tells operators which allowlist entries silently do nothing and what the cost of disabling name matching would be — before it locks anyone out. Plugin authors get one supported helper to classify their own entries.

Evidence

  • Compiled-CLI proof on a synthetic config (isolated state dir): name matching off reports "1 of 2 entries inert"; on reports the "1 of 2 depend on mutable matching" preview; no raw identifiers in output.
  • Regression proof: removing only Discord's one-line classifier wiring fails 6 of 7 new audit tests; access-group false-positive regressions failed before the parser exclusion and pass after; Discord raw-value leak asserted against serialized findings.
  • Focused suites: message-access + security + Discord audit/dm-command 382 tests; eight-plugin sweep 10,575 tests across 684 files; post-rebase rerun green.
  • pnpm plugin-sdk:surface:check (exports 4348, callables 2584, exactly +1 each), full check:changed (42 steps), pnpm build with packaged-consumer compile, plugin startup profiling for the five touched channels.
  • Structured Codex autoreview: no accepted/actionable findings (worker pass and fresh post-rebase pass).
  • Production LOC +548/−439 (net +109, of which ~380 moved lines; new logic in helper + audit is net +55) | tests +248 | docs +21.

Report configured entries that cannot authorize with name matching disabled,
and preview lockout counts before disabling mutable matching. Distinguish
mutable aliases from exact identifiers with unproven ownership in audit text.

Reuse channel ingress declarations through one SDK classifier without changing
admission policy. Keep Discord audit findings redacted and exclude symbolic
access-group references from mutable-identifier warnings.

Refs #131099.
@clawsweeper

clawsweeper Bot commented Aug 27, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

@steipete
steipete marked this pull request as ready for review August 27, 2026 18:59
@steipete
steipete requested a review from a team as a code owner August 27, 2026 18:59
@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation channel: discord Channel integration: discord channel: googlechat Channel integration: googlechat channel: mattermost Channel integration: mattermost channel: slack Channel integration: slack gateway Gateway runtime security Security documentation scripts Repository scripts channel: irc size: XL maintainer Maintainer-authored PR labels Aug 27, 2026
@steipete
steipete merged commit a509254 into main Aug 27, 2026
197 checks passed
@steipete
steipete deleted the steipete/sender-auth-stage5-audit branch August 27, 2026 19:33
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Aug 28, 2026
)

* feat(security): warn on inert mutable allowFrom entries

Report configured entries that cannot authorize with name matching disabled,
and preview lockout counts before disabling mutable matching. Distinguish
mutable aliases from exact identifiers with unproven ownership in audit text.

Reuse channel ingress declarations through one SDK classifier without changing
admission policy. Keep Discord audit findings redacted and exclude symbolic
access-group references from mutable-identifier warnings.

Refs openclaw#131099.

* test(security): keep entry-authentication audit coverage in its lanes
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

channel: discord Channel integration: discord channel: googlechat Channel integration: googlechat channel: irc channel: mattermost Channel integration: mattermost channel: slack Channel integration: slack docs Improvements or additions to documentation gateway Gateway runtime maintainer Maintainer-authored PR scripts Repository scripts security Security documentation size: XL

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Sender auth strength stage 5: allowFrom lockout-preview finding + widened audit wording

1 participant