Skip to content

fix(googlechat): inherit shared defaults for multi-account webhook auth#38492

Merged
Takhoffman merged 4 commits intomainfrom
issue-38369-guided
Mar 7, 2026
Merged

fix(googlechat): inherit shared defaults for multi-account webhook auth#38492
Takhoffman merged 4 commits intomainfrom
issue-38369-guided

Conversation

@Takhoffman
Copy link
Copy Markdown
Contributor

@Takhoffman Takhoffman commented Mar 7, 2026

Summary

  • make Google Chat account resolution inherit shared values from channels.googlechat.accounts.default for named accounts
  • preserve precedence so top-level channel config and per-account config still override inherited defaults
  • add regression tests covering inherited defaults and override precedence

Why

Fixes a regression where multi-account Google Chat setups can stop processing inbound webhook events when shared audience/webhook settings live under accounts.default.

Fixes #38369

Verification

  • pnpm install --frozen-lockfile
  • pnpm build
  • pnpm check
  • pnpm test:macmini

@aisle-research-bot
Copy link
Copy Markdown

aisle-research-bot Bot commented Mar 7, 2026

🔒 Aisle Security Analysis

We found 1 potential security issue(s) in this PR:

# Severity Title
1 🟡 Medium Named Google Chat accounts inherit access-control settings from accounts.default (policy/allowlists)

1. 🟡 Named Google Chat accounts inherit access-control settings from accounts.default (policy/allowlists)

Property Value
Severity Medium
CWE CWE-284
Location extensions/googlechat/src/accounts.ts:74-89

Description

mergeGoogleChatAccountConfig now merges most of channels.googlechat.accounts.default into every non-default account. While intended to share webhook/audience defaults, the implementation inherits all remaining fields, including security-relevant access-control settings (DM/group policies and allowlists).

Impact in multi-account deployments:

  • A named account that previously fell back to safe defaults (e.g., dm.policy defaulting to "pairing") will now silently inherit accounts.default.dm / groupPolicy / allowlists.
  • If accounts.default is configured more permissively (e.g., dm.policy: "open" or dm.allowFrom: ["*"]), then every named account without an explicit override becomes equally permissive, potentially allowing unauthorized Google Chat users/spaces to trigger automations/commands on those accounts.

Vulnerable code:

const {
  enabled: _ignoredEnabled,
  dangerouslyAllowNameMatching: _ignoredDangerouslyAllowNameMatching,
  serviceAccount: _ignoredServiceAccount,
  serviceAccountRef: _ignoredServiceAccountRef,
  serviceAccountFile: _ignoredServiceAccountFile,
  ...defaultAccountShared
} = defaultAccountConfig;

return { ...defaultAccountShared, ...base, ...account } as GoogleChatAccountConfig;

This is security-sensitive because account.config is later used to enforce inbound access policy (DM/group allowlists, mention-gating, etc.), so inherited permissive defaults change the authorization behavior of other accounts.

Recommendation

Limit what is inherited from accounts.default to an explicit allowlist of fields that are safe/intended to be shared (e.g., webhook/audience routing fields), rather than inheriting almost everything.

For example:

const defaultAccountConfig = resolveAccountConfig(cfg, DEFAULT_ACCOUNT_ID) ?? {};
const sharedFromDefault: Partial<GoogleChatAccountConfig> = {
  audienceType: defaultAccountConfig.audienceType,
  audience: defaultAccountConfig.audience,
  webhookPath: defaultAccountConfig.webhookPath,
  webhookUrl: defaultAccountConfig.webhookUrl,// optionally: botUser if it is truly shared
};

return { ...sharedFromDefault, ...base, ...account } as GoogleChatAccountConfig;

Alternatively, if broader inheritance is desired, explicitly exclude access-control and policy keys (e.g., dm, dms, groupPolicy, groupAllowFrom, groups, requireMention, allowBots, etc.) so named accounts keep their own safe defaults unless configured.


Analyzed PR: #38492 at commit 5592999

Last updated on: 2026-03-07T03:54:25Z

@openclaw-barnacle openclaw-barnacle Bot added channel: googlechat Channel integration: googlechat size: S maintainer Maintainer-authored PR labels Mar 7, 2026
@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps Bot commented Mar 7, 2026

Greptile Summary

This PR fixes a regression in multi-account Google Chat webhook authentication by making mergeGoogleChatAccountConfig inherit shared fields from accounts.default for named accounts. The new merge order — { ...defaultAccountConfig, ...base, ...account } — correctly gives accounts.default the lowest priority while still allowing top-level and per-account values to override it.

  • Core fix is sound: named accounts can now inherit shared audience, audienceType, and webhookPath from accounts.default without duplicating those fields, which matches the stated regression scenario.
  • Precedence is correct: the two regression tests confirm that top-level channel config beats accounts.default, and per-account config beats both — consistent with the documented intent.
  • enabled inheritance is a footgun: because the inheritance is unconditional, setting enabled: false inside accounts.default (e.g. to disable the anonymous/default account) will silently disable every named account too. This was not possible before the change. The fix would be to strip lifecycle-only fields (enabled, name) from the inherited defaults before merging, or at minimum to document this behavior.
  • Minor inefficiency: when resolving the default account itself, resolveAccountConfig is called twice with DEFAULT_ACCOUNT_ID; the result stored in account is never used in that branch.

Confidence Score: 3/5

  • Safe to merge for the primary use case, but the unconditional inheritance of enabled: false from accounts.default introduces a subtle regression risk for users who disable just the default account.
  • The fix correctly addresses the stated regression and the precedence logic is sound. However, the enabled field inheritance side-effect is a real behavioral change that could silently disable all named accounts in edge-case configurations, warranting attention before merging.
  • extensions/googlechat/src/accounts.ts — specifically the enabled field propagation in mergeGoogleChatAccountConfig

Last reviewed commit: 3a621e6

Comment thread extensions/googlechat/src/accounts.ts Outdated
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 3a621e6d7e

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread extensions/googlechat/src/accounts.ts Outdated
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: eb75ca6332

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread extensions/googlechat/src/accounts.ts
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 62744e9b3e

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread extensions/googlechat/src/accounts.ts
@Takhoffman Takhoffman self-assigned this Mar 7, 2026
@Takhoffman Takhoffman merged commit a01978b into main Mar 7, 2026
29 of 30 checks passed
@Takhoffman Takhoffman deleted the issue-38369-guided branch March 7, 2026 03:11
joshavant pushed a commit that referenced this pull request Mar 7, 2026
…th (#38492)

* fix(googlechat): inherit shared defaults from accounts.default

* fix(googlechat): do not inherit default enabled state

* fix(googlechat): avoid inheriting default credentials

* fix(googlechat): keep dangerous auth flags account-local
vincentkoc pushed a commit to BryanTegomoh/openclaw-upstream that referenced this pull request Mar 8, 2026
…th (openclaw#38492)

* fix(googlechat): inherit shared defaults from accounts.default

* fix(googlechat): do not inherit default enabled state

* fix(googlechat): avoid inheriting default credentials

* fix(googlechat): keep dangerous auth flags account-local
jenawant pushed a commit to jenawant/openclaw that referenced this pull request Mar 10, 2026
…th (openclaw#38492)

* fix(googlechat): inherit shared defaults from accounts.default

* fix(googlechat): do not inherit default enabled state

* fix(googlechat): avoid inheriting default credentials

* fix(googlechat): keep dangerous auth flags account-local
V-Gutierrez pushed a commit to V-Gutierrez/openclaw-vendor that referenced this pull request Mar 17, 2026
…th (openclaw#38492)

* fix(googlechat): inherit shared defaults from accounts.default

* fix(googlechat): do not inherit default enabled state

* fix(googlechat): avoid inheriting default credentials

* fix(googlechat): keep dangerous auth flags account-local
alexey-pelykh pushed a commit to remoteclaw/remoteclaw that referenced this pull request Mar 20, 2026
…th (openclaw#38492)

* fix(googlechat): inherit shared defaults from accounts.default

* fix(googlechat): do not inherit default enabled state

* fix(googlechat): avoid inheriting default credentials

* fix(googlechat): keep dangerous auth flags account-local

(cherry picked from commit a01978b)
alexey-pelykh pushed a commit to remoteclaw/remoteclaw that referenced this pull request Mar 20, 2026
…th (openclaw#38492)

* fix(googlechat): inherit shared defaults from accounts.default

* fix(googlechat): do not inherit default enabled state

* fix(googlechat): avoid inheriting default credentials

* fix(googlechat): keep dangerous auth flags account-local

(cherry picked from commit a01978b)
lovewanwan pushed a commit to lovewanwan/openclaw that referenced this pull request Apr 28, 2026
…th (openclaw#38492)

* fix(googlechat): inherit shared defaults from accounts.default

* fix(googlechat): do not inherit default enabled state

* fix(googlechat): avoid inheriting default credentials

* fix(googlechat): keep dangerous auth flags account-local
ogt-redknie pushed a commit to ogt-redknie/OPENX that referenced this pull request May 2, 2026
…th (openclaw#38492)

* fix(googlechat): inherit shared defaults from accounts.default

* fix(googlechat): do not inherit default enabled state

* fix(googlechat): avoid inheriting default credentials

* fix(googlechat): keep dangerous auth flags account-local
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request May 9, 2026
…th (openclaw#38492)

* fix(googlechat): inherit shared defaults from accounts.default

* fix(googlechat): do not inherit default enabled state

* fix(googlechat): avoid inheriting default credentials

* fix(googlechat): keep dangerous auth flags account-local
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

channel: googlechat Channel integration: googlechat maintainer Maintainer-authored PR size: S

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Google Chat agents don't respond to messages in v2026.3.2 (regression from v2026.2.26)

1 participant