Skip to content

fix: Imported fixes 06-19-26 - #41017

Merged
dionisio-bot[bot] merged 4 commits into
developfrom
imported-fixes-2026-06-19
Jun 20, 2026
Merged

fix: Imported fixes 06-19-26#41017
dionisio-bot[bot] merged 4 commits into
developfrom
imported-fixes-2026-06-19

Conversation

@jonasflorencio

@jonasflorencio jonasflorencio commented Jun 19, 2026

Copy link
Copy Markdown
Member

Proposed changes (including videos or screenshots)

All approvals have already been given in the private fork.

Issue(s)

VLN-477

Steps to test or reproduce

N/A

Further comments

@coderabbitai ignore

@jonasflorencio
jonasflorencio requested review from a team as code owners June 19, 2026 16:33
@dionisio-bot

dionisio-bot Bot commented Jun 19, 2026

Copy link
Copy Markdown
Contributor

Looks like this PR is ready to merge! 🎉
If you have any trouble, please check the PR guidelines

@changeset-bot

changeset-bot Bot commented Jun 19, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 873d95b

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 3 packages
Name Type
@rocket.chat/meteor Patch
@rocket.chat/core-typings Patch
@rocket.chat/rest-typings Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@coderabbitai

coderabbitai Bot commented Jun 19, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Walkthrough

This security hotfix enforces a message-impersonate permission check for incoming webhook integrations. The implicit bot role assignment (addUserRolesAsync) is removed from addIncomingIntegration and updateIncomingIntegration, replaced with explicit hasPermissionAsync checks. A permission gate is also inserted in executeIntegrationRest. The admin UI hint and a new i18n string surface the requirement, and E2E tests cover the new enforcement paths.

Changes

Incoming Webhook message-impersonate Enforcement

Layer / File(s) Summary
Add/Update integration: permission check replaces bot-role grant
apps/meteor/app/integrations/server/methods/incoming/addIncomingIntegration.ts, apps/meteor/app/integrations/server/methods/incoming/updateIncomingIntegration.ts
Removes addUserRolesAsync import and bot-role assignment from both methods. User lookup changes to findOneByUsername with _id projection; a hasPermissionAsync('message-impersonate') check follows; missing user or failed check throws error-invalid-user or error-invalid-post-as-user.
API execution: permission gate in executeIntegrationRest
apps/meteor/app/integrations/server/api/api.ts
Imports hasPermissionAsync and adds an async permission gate before processing webhook payloads; returns API.v1.failure('error-user-lacks-message-impersonate-permission') when the assigned user lacks the permission.
UI hint and i18n string
apps/meteor/client/views/admin/integrations/incoming/IncomingWebhookForm.tsx, packages/i18n/src/locales/en.i18n.json
Updates the "Post as" FieldHint to use the new translation key with { permission: 'message-impersonate' }, and adds the User_must_exist_and_have_permission key to the English locale.
E2E tests for permission enforcement
apps/meteor/tests/end-to-end/api/incoming-integrations.ts
Adds negative-case tests for creation, execution, and update (users without message-impersonate are rejected with the correct error codes). Refactors existing update test lifecycle to use a dynamically provisioned senderUser. Explicitly assigns the bot role to nonMemberUser and admin in message-delivery tests.
Changeset
.changeset/dull-trams-follow.md
Adds a patch release entry for @rocket.chat/meteor noting the security hotfix.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Suggested labels

type: bug

Suggested reviewers

  • ggazzo
  • tassoevan
🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (1 warning, 1 inconclusive)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Title check ❓ Inconclusive The title 'fix: Imported fixes 06-19-26' is vague and generic, lacking specific information about the actual changes (security hotfix for message-impersonate permission enforcement). Consider using a more descriptive title that reflects the main security change, such as 'fix: Enforce message-impersonate permission for webhook integrations' to better communicate the PR's purpose.
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

Warning

Review ran into problems

🔥 Problems

Errors were encountered while retrieving linked issues.

Errors (2)
  • VLN-477: Request failed with status code 401
  • FIXES-2026: Request failed with status code 401

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
.changeset/dull-trams-follow.md (1)

1-6: ⚠️ Potential issue | 🟡 Minor

Update the security documentation URL to the current canonical address.

The referenced URL https://docs.rocket.chat/docs/security-fixes-and-updates is outdated and no longer maintains an active documentation page. The current canonical URL for Rocket.Chat security fixes is:

https://docs.rocket.chat/docs/rocketchat-security-fixes-updates-and-advisories

Update line 6 to reference the correct, currently maintained security documentation.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.changeset/dull-trams-follow.md around lines 1 - 6, The security
documentation URL referenced in the changeset file is outdated and needs to be
updated to the current canonical address. Replace the URL
`https://docs.rocket.chat/docs/security-fixes-and-updates` with
`https://docs.rocket.chat/docs/rocketchat-security-fixes-updates-and-advisories`
in the Security Hotfix section to ensure the reference points to the currently
maintained documentation page.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Outside diff comments:
In @.changeset/dull-trams-follow.md:
- Around line 1-6: The security documentation URL referenced in the changeset
file is outdated and needs to be updated to the current canonical address.
Replace the URL `https://docs.rocket.chat/docs/security-fixes-and-updates` with
`https://docs.rocket.chat/docs/rocketchat-security-fixes-updates-and-advisories`
in the Security Hotfix section to ensure the reference points to the currently
maintained documentation page.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 1308870d-9fd1-43e1-a6fc-a276f9a243e2

📥 Commits

Reviewing files that changed from the base of the PR and between 9ab1cf6 and 25b25a3.

📒 Files selected for processing (7)
  • .changeset/dull-trams-follow.md
  • apps/meteor/app/integrations/server/api/api.ts
  • apps/meteor/app/integrations/server/methods/incoming/addIncomingIntegration.ts
  • apps/meteor/app/integrations/server/methods/incoming/updateIncomingIntegration.ts
  • apps/meteor/client/views/admin/integrations/incoming/IncomingWebhookForm.tsx
  • apps/meteor/tests/end-to-end/api/incoming-integrations.ts
  • packages/i18n/src/locales/en.i18n.json
📜 Review details
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (4)
  • GitHub Check: 📦 Build Packages
  • GitHub Check: CodeQL-Build
  • GitHub Check: cubic · AI code reviewer
  • GitHub Check: Hacktron Security Check
🧰 Additional context used
📓 Path-based instructions (1)
**/*.{ts,tsx,js}

📄 CodeRabbit inference engine (.cursor/rules/playwright.mdc)

**/*.{ts,tsx,js}: Write concise, technical TypeScript/JavaScript with accurate typing in Playwright tests
Avoid code comments in the implementation

Files:

  • apps/meteor/client/views/admin/integrations/incoming/IncomingWebhookForm.tsx
  • apps/meteor/app/integrations/server/api/api.ts
  • apps/meteor/tests/end-to-end/api/incoming-integrations.ts
  • apps/meteor/app/integrations/server/methods/incoming/addIncomingIntegration.ts
  • apps/meteor/app/integrations/server/methods/incoming/updateIncomingIntegration.ts
🧠 Learnings (5)
📚 Learning: 2026-03-16T21:50:37.589Z
Learnt from: amitb0ra
Repo: RocketChat/Rocket.Chat PR: 39676
File: .changeset/migrate-users-register-openapi.md:3-3
Timestamp: 2026-03-16T21:50:37.589Z
Learning: For changes related to OpenAPI migrations in Rocket.Chat/OpenAPI, when removing endpoint types and validators from rocket.chat/rest-typings (e.g., UserRegisterParamsPOST, /v1/users.register) document this as a minor changeset (not breaking) per RocketChat/Rocket.Chat-Open-API#150 Rule 7. Note that the endpoint type is re-exposed via a module augmentation .d.ts in the consuming package (e.g., packages/web-ui-registration/src/users-register.d.ts). In reviews, ensure the changeset clearly states: this is a non-breaking change, the major version should not be bumped, and the changeset reflects a minor version bump. Do not treat this as a breaking change during OpenAPI migrations.

Applied to files:

  • .changeset/dull-trams-follow.md
📚 Learning: 2026-03-27T14:52:56.865Z
Learnt from: dougfabris
Repo: RocketChat/Rocket.Chat PR: 39892
File: apps/meteor/client/views/room/contextualBar/Threads/Thread.tsx:150-155
Timestamp: 2026-03-27T14:52:56.865Z
Learning: In Rocket.Chat, there are two different `ModalBackdrop` components with different prop APIs. During review, confirm the import source: (1) `rocket.chat/fuselage` `ModalBackdrop` uses `ModalBackdropProps` based on `BoxProps` (so it supports `onClick` and other Box/DOM props) and does not have an `onDismiss` prop; (2) `rocket.chat/ui-client` `ModalBackdrop` uses a narrower props interface like `{ children?: ReactNode; onDismiss?: () => void }` and handles Escape keypress and outside mouse-up, and it does not forward arbitrary DOM props such as `onClick`. Flag mismatched props (e.g., `onDismiss` passed to the fuselage component or `onClick` passed to the ui-client component) and ensure the usage matches the correct component being imported.

Applied to files:

  • apps/meteor/client/views/admin/integrations/incoming/IncomingWebhookForm.tsx
📚 Learning: 2026-05-06T12:21:44.083Z
Learnt from: juliajforesti
Repo: RocketChat/Rocket.Chat PR: 40256
File: apps/meteor/client/components/CreateDiscussion/CreateDiscussion.tsx:121-149
Timestamp: 2026-05-06T12:21:44.083Z
Learning: Field wrappers in rocket.chat/fuselage-forms (Field, FieldLabel, FieldRow, FieldError, FieldHint) auto-create htmlFor/id associations, aria-describedby, and role="alert" for errors. Do not manually set htmlFor, id, aria-describedby, or role attributes when using these wrappers. This automatic wiring does not apply to plain rocket.chat/fuselage components, which require explicit ID wiring per the accessibility docs. In code reviews, prefer using fuselage-forms wrappers for form fields and verify there is no unnecessary manual ID/aria wiring in files that use these wrappers. If a component uses plain fuselage components, ensure proper id wiring as per docs.

Applied to files:

  • apps/meteor/client/views/admin/integrations/incoming/IncomingWebhookForm.tsx
  • apps/meteor/app/integrations/server/api/api.ts
  • apps/meteor/tests/end-to-end/api/incoming-integrations.ts
  • apps/meteor/app/integrations/server/methods/incoming/addIncomingIntegration.ts
  • apps/meteor/app/integrations/server/methods/incoming/updateIncomingIntegration.ts
📚 Learning: 2026-02-26T19:25:44.063Z
Learnt from: gabriellsh
Repo: RocketChat/Rocket.Chat PR: 38778
File: packages/ui-voip/src/providers/useMediaSession.ts:192-192
Timestamp: 2026-02-26T19:25:44.063Z
Learning: In the Rocket.Chat repository, do not reference Biome lint rules in code review feedback. Biome is not used even if biome.json exists; only reference Biome rules if there is explicit, project-wide usage documented. For TypeScript files, review lint implications without Biome guidance unless the project enables Biome rules.

Applied to files:

  • apps/meteor/app/integrations/server/api/api.ts
  • apps/meteor/tests/end-to-end/api/incoming-integrations.ts
  • apps/meteor/app/integrations/server/methods/incoming/addIncomingIntegration.ts
  • apps/meteor/app/integrations/server/methods/incoming/updateIncomingIntegration.ts
📚 Learning: 2026-02-26T19:25:44.063Z
Learnt from: gabriellsh
Repo: RocketChat/Rocket.Chat PR: 38778
File: packages/ui-voip/src/providers/useMediaSession.ts:192-192
Timestamp: 2026-02-26T19:25:44.063Z
Learning: In this repository (RocketChat/Rocket.Chat), Biome lint rules are not used even if a biome.json exists. When reviewing TypeScript files (e.g., packages/ui-voip/src/providers/useMediaSession.ts), ensure lint suggestions do not reference Biome-specific rules. Rely on general ESLint/TypeScript lint rules and project conventions instead.

Applied to files:

  • apps/meteor/app/integrations/server/api/api.ts
  • apps/meteor/tests/end-to-end/api/incoming-integrations.ts
  • apps/meteor/app/integrations/server/methods/incoming/addIncomingIntegration.ts
  • apps/meteor/app/integrations/server/methods/incoming/updateIncomingIntegration.ts
🔇 Additional comments (6)
apps/meteor/app/integrations/server/methods/incoming/addIncomingIntegration.ts (1)

85-91: LGTM!

apps/meteor/app/integrations/server/methods/incoming/updateIncomingIntegration.ts (1)

146-152: LGTM!

apps/meteor/app/integrations/server/api/api.ts (1)

20-20: LGTM!

Also applies to: 172-179

packages/i18n/src/locales/en.i18n.json (1)

5752-5752: LGTM!

apps/meteor/client/views/admin/integrations/incoming/IncomingWebhookForm.tsx (1)

211-213: LGTM!

apps/meteor/tests/end-to-end/api/incoming-integrations.ts (1)

10-11: LGTM!

Also applies to: 211-233, 391-416, 909-921, 932-932, 951-970, 1184-1184, 1186-1186

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

3 issues found across 7 files

Reply with feedback, questions, or to request a fix.

Re-trigger cubic

Comment thread apps/meteor/app/integrations/server/api/api.ts
Comment thread apps/meteor/tests/end-to-end/api/incoming-integrations.ts Outdated
Comment thread apps/meteor/tests/end-to-end/api/incoming-integrations.ts
@codecov

codecov Bot commented Jun 19, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 70.11%. Comparing base (9ab1cf6) to head (873d95b).
⚠️ Report is 4 commits behind head on develop.

Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff             @@
##           develop   #41017      +/-   ##
===========================================
- Coverage    70.14%   70.11%   -0.04%     
===========================================
  Files         3359     3359              
  Lines       129609   129609              
  Branches     22452    22472      +20     
===========================================
- Hits         90919    90875      -44     
- Misses       35379    35420      +41     
- Partials      3311     3314       +3     
Flag Coverage Δ
e2e 59.32% <ø> (-0.02%) ⬇️
e2e-api 46.23% <ø> (-0.89%) ⬇️
unit 70.05% <ø> (-0.01%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@hacktron-app hacktron-app Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1 issue found across 1 file

Severity Count
HIGH 1

View full scan results

Comment thread apps/meteor/app/integrations/server/api/api.ts
gabriellsh

This comment was marked as duplicate.

gabriellsh
gabriellsh previously approved these changes Jun 19, 2026

@gabriellsh gabriellsh left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FE 👍

@nazabucciarelli nazabucciarelli added this to the 8.6.0 milestone Jun 19, 2026
@nazabucciarelli nazabucciarelli added the stat: QA assured Means it has been tested and approved by a company insider label Jun 19, 2026
@dionisio-bot dionisio-bot Bot added the stat: ready to merge PR tested and approved waiting for merge label Jun 19, 2026
@nazabucciarelli
nazabucciarelli dismissed stale reviews from gabriellsh and themself via 873d95b June 19, 2026 18:30
@nazabucciarelli nazabucciarelli removed the stat: QA assured Means it has been tested and approved by a company insider label Jun 19, 2026
@dionisio-bot dionisio-bot Bot removed the stat: ready to merge PR tested and approved waiting for merge label Jun 19, 2026
@nazabucciarelli nazabucciarelli added the stat: QA assured Means it has been tested and approved by a company insider label Jun 19, 2026
@dionisio-bot dionisio-bot Bot added the stat: ready to merge PR tested and approved waiting for merge label Jun 19, 2026
@dionisio-bot
dionisio-bot Bot added this pull request to the merge queue Jun 19, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Jun 20, 2026
@nazabucciarelli nazabucciarelli removed the stat: QA assured Means it has been tested and approved by a company insider label Jun 20, 2026
@dionisio-bot dionisio-bot Bot removed the stat: ready to merge PR tested and approved waiting for merge label Jun 20, 2026
@nazabucciarelli nazabucciarelli added stat: ready to merge PR tested and approved waiting for merge stat: QA assured Means it has been tested and approved by a company insider labels Jun 20, 2026
@dionisio-bot
dionisio-bot Bot added this pull request to the merge queue Jun 20, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Jun 20, 2026
@scuciatto scuciatto modified the milestone: 8.6.0 Jun 20, 2026
@dionisio-bot dionisio-bot Bot added stat: ready to merge PR tested and approved waiting for merge and removed stat: ready to merge PR tested and approved waiting for merge labels Jun 20, 2026
@dionisio-bot
dionisio-bot Bot added this pull request to the merge queue Jun 20, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Jun 20, 2026
@scuciatto scuciatto removed this from the 8.6.0 milestone Jun 20, 2026
@dionisio-bot dionisio-bot Bot removed the stat: ready to merge PR tested and approved waiting for merge label Jun 20, 2026
@scuciatto scuciatto added this to the 8.6.0 milestone Jun 20, 2026
@dionisio-bot dionisio-bot Bot added the stat: ready to merge PR tested and approved waiting for merge label Jun 20, 2026
@dionisio-bot
dionisio-bot Bot added this pull request to the merge queue Jun 20, 2026
Merged via the queue into develop with commit 886bb3d Jun 20, 2026
80 of 85 checks passed
@dionisio-bot
dionisio-bot Bot deleted the imported-fixes-2026-06-19 branch June 20, 2026 14:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

stat: QA assured Means it has been tested and approved by a company insider stat: ready to merge PR tested and approved waiting for merge type: bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants