Skip to content

Cocotais Bot has builtin .echo command injection

Moderate severity GitHub Reviewed Published May 17, 2025 in cocotais/cocotais-bot • Updated May 19, 2025

Package

npm cocotais-bot (npm)

Affected versions

>= 1.5.0-test2-hotfix, < 1.6.2

Patched versions

1.6.2

Description

Summary


A command echoing feature in the framework allows users to indirectly trigger privileged behavior by injecting special platform tags. Specifically, an unauthorized user can use the /echo <qqbot-at-everyone /> command to cause the bot to send a message that mentions all members in the chat, bypassing any permission controls. This can lead to spam, disruption, or abuse of notification systems.


Details


The framework provides a command /echo that causes the bot to repeat any user-provided message verbatim in the group chat. However, the bot fails to sanitize or filter platform-specific control elements such as <qqbot-at-everyone />, which, when included in a message, mentions everyone (i.e., @全体成员). While normal users are forbidden from using this tag in normal chats, the bot, which has higher privileges, is allowed to do so.

Since the /echo command blindly echoes any content, a user can exploit this by sending:


/echo <qqbot-at-everyone />


The bot will then send a message containing <qqbot-at-everyone />, causing the platform to interpret it as an @全体成员 command, effectively allowing an unauthorized user to @everyone via the bot.


PoC



  1. Set up a chatbot using the affected framework.
  2. Join the chat that includes the bot as a regular user with no permission to use @全体成员.
  3. Send the following message in the chat:
    
/echo <qqbot-at-everyone />
  1. The bot will respond by repeating the message, and the platform will interpret <qqbot-at-everyone /> as an @全体成员 mention.
  2. All the chat members receive a notification, despite the user lacking that permission.
    
    

References

Published by the National Vulnerability Database May 17, 2025
Published to the GitHub Advisory Database May 19, 2025
Reviewed May 19, 2025
Last updated May 19, 2025

Severity

Moderate

CVSS overall score

This score calculates overall vulnerability severity from 0 to 10 and is based on the Common Vulnerability Scoring System (CVSS).
/ 10

CVSS v3 base metrics

Attack vector
Network
Attack complexity
Low
Privileges required
None
User interaction
None
Scope
Unchanged
Confidentiality
None
Integrity
Low
Availability
Low

CVSS v3 base metrics

Attack vector: More severe the more the remote (logically and physically) an attacker can be in order to exploit the vulnerability.
Attack complexity: More severe for the least complex attacks.
Privileges required: More severe if no privileges are required.
User interaction: More severe when no user interaction is required.
Scope: More severe when a scope change occurs, e.g. one vulnerable component impacts resources in components beyond its security scope.
Confidentiality: More severe when loss of data confidentiality is highest, measuring the level of data access available to an unauthorized user.
Integrity: More severe when loss of data integrity is the highest, measuring the consequence of data modification possible by an unauthorized user.
Availability: More severe when the loss of impacted component availability is highest.
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:L

EPSS score

Exploit Prediction Scoring System (EPSS)

This score estimates the probability of this vulnerability being exploited within the next 30 days. Data provided by FIRST.
(13th percentile)

Weaknesses

CVE ID

CVE-2025-47948

GHSA ID

GHSA-mj2c-8hxf-ffvq

Source code

Credits

Loading Checking history
See something to contribute? Suggest improvements for this vulnerability.