openclaw - 💡(How to fix) Fix Security: dangerouslyAllowNameMatching enables user impersonation via display name spoofing [2 comments, 2 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#54288Fetched 2026-04-08 01:29:35
View on GitHub
Comments
2
Participants
2
Timeline
9
Reactions
0
Timeline (top)
closed ×2commented ×2labeled ×2locked ×1

The dangerouslyAllowNameMatching feature, when enabled, allows matching users by display name rather than stable user ID. Since display names are user-controllable on all messaging platforms (Telegram, Discord, Slack, etc.), this enables authorization bypass via impersonation.

Root Cause

The dangerouslyAllowNameMatching feature, when enabled, allows matching users by display name rather than stable user ID. Since display names are user-controllable on all messaging platforms (Telegram, Discord, Slack, etc.), this enables authorization bypass via impersonation.

RAW_BUFFERClick to expand / collapse

Summary

The dangerouslyAllowNameMatching feature, when enabled, allows matching users by display name rather than stable user ID. Since display names are user-controllable on all messaging platforms (Telegram, Discord, Slack, etc.), this enables authorization bypass via impersonation.

Impact

An attacker sets their display name to match an authorized user and gains full agent access, completely bypassing the allowlist model.

Location

dist/dangerous-name-matching-BQW4HoPt.js

Suggested Fix

  1. Remove this feature entirely, or
  2. Add extremely prominent warnings at config time AND runtime
  3. Never match on display names for authorization decisions — use stable platform user IDs only

extent analysis

Fix Plan

To address the authorization bypass vulnerability, we will remove the dangerouslyAllowNameMatching feature and ensure that authorization decisions are based on stable platform user IDs only.

Step-by-Step Solution

  • Remove the dangerouslyAllowNameMatching feature from the codebase.
  • Update the authorization logic to use stable platform user IDs for matching authorized users.
  • Add prominent warnings in the configuration and runtime logs to alert administrators about the potential risks of using display names for authorization.

Example Code Changes

// Before
if (dangerouslyAllowNameMatching && displayName === authorizedUserDisplayName) {
  // Grant access
}

// After
if (platformUserId === authorizedUserPlatformUserId) {
  // Grant access
}

In the updated code, we removed the dangerouslyAllowNameMatching check and instead verified the platformUserId against the authorizedUserPlatformUserId.

Verification

To verify that the fix worked, test the authorization logic with different scenarios, including:

  • An attacker attempting to impersonate an authorized user by setting their display name to match.
  • An authorized user accessing the system with their stable platform user ID.

Extra Tips

  • Always prioritize using stable and unique identifiers for authorization decisions.
  • Regularly review and update your codebase to ensure that security features are not compromised by user-controllable inputs.

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