Skip to content

[Bug]: Matrix probe trusts configured userId without authenticating token #123763

Closed

Description

@steipete

Bug type

Behavior bug (incorrect output/state without crash)

Beta release blocker

No

Summary

Matrix channel credential probes can report ok: true for an invalid access token when userId is configured, because the configured identity bypasses authenticated /account/whoami resolution.

Steps to reproduce

  1. Configure a Matrix account with a homeserver, a userId, and an invalid access token.
  2. Run the Matrix account probe through openclaw channels status --probe.
  3. Observe that the probe client is seeded with the configured userId, so its wrapper getUserId() returns that local value without calling /account/whoami.
  4. The probe returns ok: true even though the token cannot authenticate.

The focused regression reproduces this by modeling the Matrix wrapper contract: a seeded identity resolves locally, while an unseeded identity attempts authenticated resolution and receives HTTP 401.

Expected behavior

The probe must authenticate the access token through /account/whoami. Invalid tokens return ok: false with status/error, valid matching identities return ok: true, and a valid token belonging to a different configured user returns ok: false.

Actual behavior

With a configured userId, the probe trusts the local identity getter and returns ok: true without authenticating the token.

OpenClaw version

Current main at e44dde218f1629d87f585bf8bfeabda85e1a21f3.

Operating system

macOS 26.6.1 (25G76)

Install method

Source checkout (pnpm workspace)

Model

N/A — channel status probe; no model request.

Provider / routing chain

OpenClaw Matrix plugin → local controlled Matrix HTTP endpoint.

Additional provider/model setup details

No provider or model route is involved. The controlled proof uses only synthetic access-token strings and sends no Matrix messages.

Logs

Before: Matrix probe regression 1 failed / 7 because the authenticated identity path was never reached.
After: Matrix probe 7/7; Matrix account paths 2/2; Gateway channel status 15/15.
Controlled HTTP proof:
- invalid token: ok=false, status=401, error="Invalid access token"
- valid matching identity: ok=true, userId=@bot:example.org
- valid mismatched identity: ok=false, error="Matrix access token user does not match configured userId"
- observed requests: 3 GET /_matrix/client/v3/account/whoami; sends=0

Screenshots, recordings, and evidence

Dependency contract: [email protected] getUserId() returns the configured credential identity, while whoami() performs the authenticated request.

Impact and severity

  • Affected: operators using Matrix accounts with configured userId values.
  • Severity: medium; explicit credential health checks can be false-green.
  • Frequency: deterministic whenever the configured token is invalid but userId is present.
  • Consequence: operators can be told the Matrix channel works even though authenticated Matrix operations fail.

Additional information

The defect was made visible by the shared channel probe runner refactor in #113540. The repair belongs entirely to the Matrix plugin probe and requires no core status policy, configuration, public SDK, auth storage, migration, or dependency changes.

Activity

  1. added
    bug
    on Aug 14, 2026
  2. self-assigned this
    on Aug 14, 2026
  3. added
    maintainer
    on Aug 14, 2026
  4. added
    clawsweeper:linked-pr-open
    clawsweeper:no-new-fix-pr
    clawsweeper:source-repro
    impact:auth-provider
    issue-rating: 🦞 diamond lobster
    P2
    on Aug 14, 2026
  5. clawsweeper commented on Aug 14, 2026

    @clawsweeper
    Contributor

    Codex review: keeping this open for maintainer follow-up; there is still a little grit to resolve. Reviewed August 14, 2026, 2:36 PM ET / 18:36 UTC.

    Summary
    Keep open: current main still lets the Matrix probe report success without authenticating a configured token, and the focused linked repair PR is the existing fix path. The maintainer label also requires human handling rather than automated closure.

    Reproducibility: yes. —current source provides a high-confidence path: configure a Matrix user ID and invalid token, then run the live channel probe; the probe seeds and returns the local identity before its whoami branch.

    Root-cause cluster
    Relationship: canonical
    Canonical: #123763
    Summary: This issue is the canonical report; the linked open Matrix repair PR is its focused fix candidate.

    Members:

    Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything.

    Next step
    The linked open repair PR already owns the focused change, and this issue’s maintainer label prevents an automated duplicate repair lane.

    Review details

    Best possible solution:

    Land the focused owner-plugin repair at #123766, preserving an authenticated whoami check and configured-versus-authenticated identity comparison, then close this issue through the linked relationship.

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

    Yes—current source provides a high-confidence path: configure a Matrix user ID and invalid token, then run the live channel probe; the probe seeds and returns the local identity before its whoami branch.

    Is this the best way to solve the issue?

    Yes—the linked repair targets the Matrix probe owner, while keeping normal setup behavior intact; changing shared channel-status policy or globally forcing whoami would be broader and incorrect.

    AGENTS.md: found and applied where relevant.

    Codex review notes: model internal, reasoning high; reviewed against 0bdf11c9dc51.

    Label changes

    Label justifications:

    • P2: A deterministic false-green credential probe affects Matrix operators but has bounded channel-specific blast radius.
    • impact:auth-provider: The failure concerns Matrix access-token authentication and identity validation.
    Evidence reviewed

    What I checked:

    Likely related people:

    • Dallin Romney: Current probe and Matrix client identity lines blame to the commit that introduced the present file layout. (role: current Matrix probe contributor; confidence: high; commits: 83d53044a4a3; files: extensions/matrix/src/matrix/probe.ts, extensions/matrix/src/matrix/sdk/client-core.ts, extensions/matrix/src/matrix/sdk/client-base.ts)
    • steipete: The history records Peter Steinberger on the shared channel-probe refactor cited by the issue, and the supplied context identifies steipete as author of the linked focused repair. (role: shared probe refactor contributor and linked repair author; confidence: medium; commits: 92a35b599ad0; files: extensions/matrix/src/matrix/probe.ts)
    • ToToKr: Earlier Matrix health-probe work addressed probe-only client behavior and device identity preservation. (role: prior Matrix probe contributor; confidence: medium; commits: d4c443bc1e4a; files: extensions/matrix/src/matrix/probe.ts)
    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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

P2bugclawsweeper:linked-pr-openclawsweeper:no-new-fix-prclawsweeper:source-reproimpact:auth-providerissue-rating: 🦞 diamond lobstermaintainer

Type

No type

Fields

Priority

None yet

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions