RocketChat / RocketChat/Rocket.Chat

Replace the X-FRAME-OPTIONS by frame-ancestors

Open
#18,486 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
46.1k
Forks
13.9k
Avg merge
3d 3h
Merged PRs (30d)
130

Description

Description:

We have the ability to limit pages to embed Rocket.Chat inside an Iframe in /admin/General with the setting Iframe_X_Iframe_Option.

In #17471, you have replaced the obsolete X-FRAME-OPTIONS header on Livechat route.

I took a look inside the code, everything is good but it could be better if we can refactor app/cors/server/cors.js:61 as well. This line of code also uses X-Frame-Options and also needs to be refactored.

Steps to reproduce:

Goto /admin/General
image

Expected behavior:

X-FRAME-OPTIONS is replaced by frame-ancestors

Actual behavior:

Threre is still the X-FRAME-OPTIONS

Server Setup Information:
  • Version of Rocket.Chat Server: 3.1.1
  • Operating System: Windows 10
  • Deployment Method: tar
  • Number of Running Instances: 1
  • DB Replicaset Oplog:
  • NodeJS Version:
  • MongoDB Version:
Client Setup Information
  • Desktop App or Browser Version:
  • Operating System:
Additional context
Relevant logs:

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in app/cors/server/cors.js at line 61 and review how the Iframe_X_Iframe_Option setting affects the response for /admin/General. Replace the remaining X-FRAME-OPTIONS behavior with frame-ancestors, then verify that the admin setting produces the expected header and no longer produces X-FRAME-OPTIONS.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
security
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.