-
Notifications
You must be signed in to change notification settings - Fork 10.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
392 additions
and
154 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
'@rocket.chat/meteor': patch | ||
--- | ||
|
||
Security Hotfix (https://docs.rocket.chat/docs/security-fixes-and-updates) |
20 changes: 20 additions & 0 deletions
20
apps/meteor/app/lib/server/functions/getModifiedHttpHeaders.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
export const getModifiedHttpHeaders = (httpHeaders: Record<string, any>) => { | ||
const modifiedHttpHeaders = { ...httpHeaders }; | ||
|
||
if ('x-auth-token' in modifiedHttpHeaders) { | ||
modifiedHttpHeaders['x-auth-token'] = '[redacted]'; | ||
} | ||
|
||
if (modifiedHttpHeaders.cookie) { | ||
const cookies = modifiedHttpHeaders.cookie.split('; '); | ||
const modifiedCookies = cookies.map((cookie: string) => { | ||
if (cookie.startsWith('rc_token=')) { | ||
return 'rc_token=[redacted]'; | ||
} | ||
return cookie; | ||
}); | ||
modifiedHttpHeaders.cookie = modifiedCookies.join('; '); | ||
} | ||
|
||
return modifiedHttpHeaders; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.