CVEReports
CVEReports

Automated vulnerability intelligence platform. Comprehensive reports for high-severity CVEs generated by AI.

Product

  • Home
  • Sitemap
  • RSS Feed

Company

  • About
  • Contact
  • Privacy Policy
  • Terms of Service

© 2026 CVEReports. All rights reserved.

Made with love by Amit Schendel & Alon Barad



GHSA-MJ5R-HH7J-4GXF
5.90.10%

The Name Game: Hijacking OpenClaw Bots via Telegram Username Recycling

Alon Barad
Alon Barad
Software Engineer

Feb 18, 2026·5 min read·4 visits

PoC Available

Executive Summary (TL;DR)

OpenClaw trusted Telegram usernames ('@user') as security principals. Since usernames can be changed or deleted, attackers could claim abandoned handles to impersonate admins. The fix forces the use of immutable numeric user IDs.

A logic flaw in the OpenClaw automation framework allowed attackers to bypass authorization controls by recycling Telegram usernames. Because the system relied on mutable string handles (e.g., '@admin') rather than immutable numeric identifiers for access control, an attacker could claim a relinquished username and inherit all associated privileges. This report details the mechanics of Identity Rebinding in chat operations.

The Hook: Security by Nametag

In the world of identity and access management (IAM), there is one golden rule: never trust a label that can be peeled off. Yet, developers consistently fall into the trap of using human-readable identifiers because, well, they are readable. It is much easier to write allowFrom: ['@TheBoss'] in a config file than it is to look up 182736459.

OpenClaw, a popular automation tool for Telegram, fell squarely into this trap. It is designed to be the glue between your chat ops and your infrastructure—running scripts, managing groups, and handling alerts. To do this, it needs to know who is boss.

Unfortunately, until version 2026.2.14, OpenClaw treated Telegram usernames as immutable truths. It assumed that if a message came from @sysadmin, it must be the system administrator. It failed to account for the chaotic marketplace that is the Telegram namespace, where identities are rented, sold, and discarded like fast fashion.

The Flaw: Identity Rebinding

The vulnerability here is a classic case of Identity Rebinding. In Telegram, a @username is a pointer, not a principal. It is a public alias that points to an underlying, immutable numeric ID (e.g., 123456789).

The critical misunderstanding in the OpenClaw logic was equating the pointer with the principal. Usernames in Telegram are volatile properties. If I change my handle from @hacker to @retired_hacker, the handle @hacker is immediately released back into the public pool (or the Fragment auction block).

This created a race condition of sorts, but one measured in days or weeks rather than milliseconds. If an authorized user changed their handle—perhaps for privacy, or rebranding—and did not immediately update the bot's configuration, their old 'identity' became a master key lying on the sidewalk, waiting for anyone to pick it up. The code performed a string comparison on msg.from.username against the allowlist, completely ignoring the msg.from.id which creates the actual cryptographic binding to the account.

The Code: Regex to the Rescue (Mostly)

The fix required a shift from string-based auth to ID-based auth. The maintainers implemented a check to ensure that the configuration only contains numeric values. Let's look at the validation logic introduced in commit e3b432e481a96b8fd41b91273818e514074e05c3.

The Validator:

function isNumericTelegramUserId(raw: string): boolean {
  return /^\d+$/.test(raw);
}

This simple regex enforces that any entry in the allowFrom array must consist solely of digits. If you try to put @admin in your config after this patch, the system will yell at you (specifically, the openclaw doctor utility will flag it).

However, there is a subtle irony in this fix. While it solves the username spoofing, the regex /^\d+$/ strictly matches positive integers. In the Telegram API, Group IDs and Channel IDs are often negative integers (e.g., -100123456789). If a user attempts to allow a specific group to interact with the bot using this same logic path, this regex might inadvertently block valid group IDs depending on where exactly this helper is applied in the wider stack. It is a classic example of a security patch that might need a patch.

The Exploit: Becoming the Admin

Exploiting this does not require buffer overflows or heap spraying. It requires patience and a bit of social engineering (or just luck). Here is how an attacker creates a verified session from thin air:

  1. Reconnaissance: The attacker identifies an OpenClaw bot. Maybe they see it in a public group, or find a config.json committed to a public GitHub repo (a surprisingly common sin). They note the allowed username: @ProjectLead.

  2. Surveillance: The attacker monitors @ProjectLead. They wait. Humans are fickle. Eventually, @ProjectLead might decide they want a cooler name, or they leave the company, or they simply delete their Telegram account in a rage-quit moment.

  3. The Snatch: The moment @ProjectLead is free, the attacker registers it. Telegram allows this instantly for standard usernames.

  4. Execution: The attacker opens a chat with the bot and types /restart_production. The bot checks msg.from.username, sees @ProjectLead, and happily executes the command. The attacker now controls the ops pipeline.

The Fix: Migration and Enforcement

The remediation is twofold: code enforcement and configuration migration.

First, you must update the package. But updating the code isn't enough—you have to update your config file, or you will be locked out of your own bot. The maintainers provided a migration tool in commit 9e147f00b48e63e7be6964e0e2a97f2980854128.

Running openclaw doctor --fix triggers a script that takes your existing string-based usernames, queries the Telegram API (using getChat), and resolves them to their current numeric IDs. It then rewrites your config file.

> [!WARNING] > You must perform this migration while you still own the usernames! If you lose the username before running the migration, the tool will resolve the username to the new owner (the attacker), permanently hardcoding the attacker's ID into your safe-list.

For manual remediation, use a tool like @userinfobot to find your ID (e.g., 123456789) and replace all instances of @yourname in openclaw.json with that string of digits.

Official Patches

OpenClawOfficial GitHub Advisory

Fix Analysis (2)

Technical Appendix

CVSS Score
5.9/ 10
CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:U/C:L/I:H/A:N
EPSS Probability
0.10%

Affected Systems

OpenClaw Telegram BotsClawdbot instances

Affected Versions Detail

Product
Affected Versions
Fixed Version
openclaw
openclaw
<= 2026.2.132026.2.14
clawdbot
openclaw
<= 2026.1.24-3N/A
AttributeDetail
Attack VectorNetwork
CVSS Score5.9 (Medium)
ImpactAuthorization Bypass
Bug ClassIdentity Rebinding
Exploit MaturityPoC / Logic Flaw
RemediationConfiguration Migration

MITRE ATT&CK Mapping

T1078Valid Accounts
Defense Evasion
T1566Phishing (via Identity Spoofing)
Initial Access
CWE-287
Improper Authentication

Vulnerability Timeline

Patches committed to master
2026-02-14
Version 2026.2.14 Released
2026-02-14
GHSA Advisory Published
2026-02-18

References & Sources

  • [1]GHSA Advisory
  • [2]OSV Entry

Attack Flow Diagram

Press enter or space to select a node. You can then use the arrow keys to move the node around. Press delete to remove it and escape to cancel.
Press enter or space to select an edge. You can then press delete to remove it or escape to cancel.