-
Notifications
You must be signed in to change notification settings - Fork 13.8k
Release 8.5.1 #40893
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Release 8.5.1 #40893
Changes from all commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
b7f28c3
Bump 8.5.1
rocketchat-github-ci b3c635d
fix: imported fixes 06-11-26 (#40891)
dionisio-bot[bot] 7b97294
fix: add missing authorization check to fingerprint endpoint (#40904)
dionisio-bot[bot] eef20be
fix: escape HTML in exported data (#40917)
dionisio-bot[bot] d1cb79f
chore(deps): bump `tmp` dependency (#40930)
dionisio-bot[bot] d74b011
chore(deps): bump ip-address, ws, grpc-js (#40933)
dionisio-bot[bot] fe9ec41
chore(deps): bump protobufjs (#40929)
dionisio-bot[bot] 8772c17
chore(deps): bump shell-quote (#40932)
dionisio-bot[bot] 7a28743
chore(deps): bump hono (#40931)
dionisio-bot[bot] f24b953
chore(deps): bump axios to solve CVEs from may 2026 (#40934)
dionisio-bot[bot] 4ff7cd6
Revert "refactor: Remove unused `description` from attachments render…
dionisio-bot[bot] 01a1846
fix: `description` being used as alternative text for images (#40938)
dionisio-bot[bot] File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 | ||
| --- | ||
|
|
||
| Bump @rocket.chat/meteor version. |
This file contains hidden or 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 | ||
| --- | ||
|
|
||
| Escapes HTML tags in exported data |
This file contains hidden or 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) |
This file contains hidden or 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 | ||
| --- | ||
|
|
||
| Fixes missing permission check on the `POST /api/v1/fingerprint` endpoint |
This file contains hidden or 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,7 @@ | ||
| --- | ||
| '@rocket.chat/federation-matrix': patch | ||
| '@rocket.chat/core-typings': patch | ||
| '@rocket.chat/meteor': patch | ||
| --- | ||
|
|
||
| Fixes an issue where `description` was incorrectly being used as alternative text for image attachments |
59 changes: 54 additions & 5 deletions
59
.github/actions/update-version-durability/package-lock.json
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains hidden or 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 hidden or 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 hidden or 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,133 @@ | ||
| import { generateKeyPairSync, sign } from 'node:crypto'; | ||
|
|
||
| import { serverFetch } from '@rocket.chat/server-fetch'; | ||
| import { Response } from 'node-fetch'; | ||
|
|
||
| import { handleIdentityToken } from './handleIdentityToken'; | ||
|
|
||
| jest.mock('@rocket.chat/server-fetch', () => ({ | ||
| serverFetch: jest.fn(), | ||
| })); | ||
|
|
||
| const { publicKey, privateKey } = generateKeyPairSync('rsa', { | ||
| modulusLength: 2048, | ||
| }); | ||
|
|
||
| const jwkPublicKey = publicKey.export({ format: 'jwk' }); | ||
|
|
||
| const toBase64Url = (obj: unknown) => Buffer.from(JSON.stringify(obj)).toString('base64url'); | ||
|
|
||
| describe('handleIdentityToken', () => { | ||
| const mockClientId = 'com.yourcompany.app'; | ||
|
|
||
| beforeEach(() => { | ||
| jest.clearAllMocks(); | ||
| jest.useFakeTimers().setSystemTime(new Date('2024-01-01T00:00:00Z')); | ||
| }); | ||
|
|
||
| afterEach(() => { | ||
| jest.useRealTimers(); | ||
| }); | ||
|
|
||
| it('should throw an error if the token has the wrong audience', async () => { | ||
| const header = toBase64Url({ alg: 'RS256', kid: 'mock-key-id' }); | ||
| const payload = toBase64Url({ | ||
| iss: 'https://appleid.apple.com', | ||
| aud: 'wrong.client.id', | ||
| exp: Math.floor(Date.now() / 1000) + 3600, | ||
| sub: 'user123', | ||
| }); | ||
|
|
||
| const mockToken = `${header}.${payload}.dummySignature`; | ||
|
|
||
| await expect(handleIdentityToken(mockToken, mockClientId)).rejects.toThrow('identityToken is not a valid Apple JWT or has expired'); | ||
| }); | ||
|
|
||
| it('should successfully validate a valid token', async () => { | ||
| const headerB64 = toBase64Url({ alg: 'RS256', kid: 'mock-key-id' }); | ||
| const payloadB64 = toBase64Url({ | ||
| iss: 'https://appleid.apple.com', | ||
| aud: mockClientId, | ||
| exp: Math.floor(Date.now() / 1000) + 3600, | ||
| sub: 'user123', | ||
| }); | ||
|
|
||
| const signatureBytes = sign('RSA-SHA256', Buffer.from(`${headerB64}.${payloadB64}`), privateKey); | ||
| const signatureB64 = signatureBytes.toString('base64url'); | ||
|
|
||
| const validMockToken = `${headerB64}.${payloadB64}.${signatureB64}`; | ||
|
|
||
| if (!jwkPublicKey.n || !jwkPublicKey.e) { | ||
| throw new Error('Generated test key is missing modulus or exponent'); | ||
| } | ||
|
|
||
| const mockJwksPayload = { | ||
| keys: [ | ||
| { | ||
| kty: 'RSA', | ||
| kid: 'mock-key-id', | ||
| use: 'sig', | ||
| alg: 'RS256', | ||
| n: jwkPublicKey.n, | ||
| e: jwkPublicKey.e, | ||
| }, | ||
| ], | ||
| }; | ||
|
|
||
| jest.mocked(serverFetch).mockResolvedValue( | ||
| new Response(JSON.stringify(mockJwksPayload), { | ||
| status: 200, | ||
| headers: { 'Content-Type': 'application/json' }, | ||
| }), | ||
| ); | ||
|
|
||
| const result = await handleIdentityToken(validMockToken, mockClientId); | ||
|
|
||
| expect(result.id).toBe('user123'); | ||
| expect(result.iss).toBe('https://appleid.apple.com'); | ||
| }); | ||
|
|
||
| it('should accept default mobile audience when client id setting is empty', async () => { | ||
| const headerB64 = toBase64Url({ alg: 'RS256', kid: 'mock-key-id' }); | ||
| const payloadB64 = toBase64Url({ | ||
| iss: 'https://appleid.apple.com', | ||
| aud: 'chat.rocket.ios', | ||
| exp: Math.floor(Date.now() / 1000) + 3600, | ||
| sub: 'user123', | ||
| }); | ||
|
|
||
| const signatureBytes = sign('RSA-SHA256', Buffer.from(`${headerB64}.${payloadB64}`), privateKey); | ||
| const signatureB64 = signatureBytes.toString('base64url'); | ||
|
|
||
| const validMockToken = `${headerB64}.${payloadB64}.${signatureB64}`; | ||
|
|
||
| if (!jwkPublicKey.n || !jwkPublicKey.e) { | ||
| throw new Error('Generated test key is missing modulus or exponent'); | ||
| } | ||
|
|
||
| const mockJwksPayload = { | ||
| keys: [ | ||
| { | ||
| kty: 'RSA', | ||
| kid: 'mock-key-id', | ||
| use: 'sig', | ||
| alg: 'RS256', | ||
| n: jwkPublicKey.n, | ||
| e: jwkPublicKey.e, | ||
| }, | ||
| ], | ||
| }; | ||
|
|
||
| jest.mocked(serverFetch).mockResolvedValue( | ||
| new Response(JSON.stringify(mockJwksPayload), { | ||
| status: 200, | ||
| headers: { 'Content-Type': 'application/json' }, | ||
| }), | ||
| ); | ||
|
|
||
| const result = await handleIdentityToken(validMockToken, ''); | ||
|
|
||
| expect(result.id).toBe('user123'); | ||
| expect(result.aud).toBe('chat.rocket.ios'); | ||
| }); | ||
| }); | ||
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Test case may not be testing audience validation as intended.
This test uses
'dummySignature'without mocking the JWKS endpoint. ThehandleIdentityTokenfunction will fail at signature verification before reaching audience validation, so the error "identityToken is not a valid Apple JWT or has expired" is thrown due to signature failure, not audience mismatch.To properly test audience validation, the JWKS mock should be set up to return the test public key so signature verification passes, then audience validation fails.
🧪 Proposed fix to properly test audience validation
it('should throw an error if the token has the wrong audience', async () => { - const header = toBase64Url({ alg: 'RS256', kid: 'mock-key-id' }); - const payload = toBase64Url({ + const headerB64 = toBase64Url({ alg: 'RS256', kid: 'mock-key-id' }); + const payloadB64 = toBase64Url({ iss: 'https://appleid.apple.com', aud: 'wrong.client.id', exp: Math.floor(Date.now() / 1000) + 3600, sub: 'user123', }); - const mockToken = `${header}.${payload}.dummySignature`; + const signatureBytes = sign('RSA-SHA256', Buffer.from(`${headerB64}.${payloadB64}`), privateKey); + const signatureB64 = signatureBytes.toString('base64url'); + const mockToken = `${headerB64}.${payloadB64}.${signatureB64}`; + + if (!jwkPublicKey.n || !jwkPublicKey.e) { + throw new Error('Generated test key is missing modulus or exponent'); + } + + const mockJwksPayload = { + keys: [{ kty: 'RSA', kid: 'mock-key-id', use: 'sig', alg: 'RS256', n: jwkPublicKey.n, e: jwkPublicKey.e }], + }; + + jest.mocked(serverFetch).mockResolvedValue( + new Response(JSON.stringify(mockJwksPayload), { status: 200, headers: { 'Content-Type': 'application/json' } }), + ); await expect(handleIdentityToken(mockToken, mockClientId)).rejects.toThrow('identityToken is not a valid Apple JWT or has expired'); });🤖 Prompt for AI Agents