-
Notifications
You must be signed in to change notification settings - Fork 13.7k
refactor: remove unnecessary ReactElement type annotations in functional components #40819
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
Changes from all commits
Commits
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
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
3 changes: 1 addition & 2 deletions
3
apps/meteor/client/views/room/Header/Omnichannel/BackButton.tsx
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
4 changes: 2 additions & 2 deletions
4
apps/meteor/client/views/room/MessageList/MessageListErrorBoundary.tsx
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
4 changes: 2 additions & 2 deletions
4
apps/meteor/client/views/room/MessageList/providers/MessageHighlightProvider.tsx
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
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
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
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
4 changes: 1 addition & 3 deletions
4
apps/meteor/client/views/room/body/LoadingMessagesIndicator.tsx
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 |
|---|---|---|
| @@ -1,7 +1,5 @@ | ||
| import type { ReactElement } from 'react'; | ||
|
|
||
| import LoadingIndicator from '../../../components/LoadingIndicator'; | ||
|
|
||
| const LoadingMessagesIndicator = (): ReactElement => <LoadingIndicator />; | ||
| const LoadingMessagesIndicator = () => <LoadingIndicator />; | ||
|
|
||
| export default LoadingMessagesIndicator; |
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
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
3 changes: 1 addition & 2 deletions
3
apps/meteor/client/views/room/composer/ComposerAirGappedRestricted.tsx
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
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.
In
DropTargetOverlay.tsx, when a user performs a drag-and-drop operation, the application checks if the dragged data contains bothtext/uri-listandtext/html. If it does, it parses the HTML data usingdocument.createRange().createContextualFragment(...), queries all<img>elements, and performs a client-sidefetchrequest to thesrcattribute of each image. The fetched data is then converted into aFileobject and automatically added to the list of files to be uploaded to the current chat room.An attacker can exploit this to exfiltrate sensitive data from the Rocket.Chat server (same-origin endpoints requiring the user's active session/cookies) or from any accessible local/intranet services (e.g., local development servers, router admin pages, cloud metadata endpoints).
By hosting a malicious website or sending a crafted message/email that prompts the user to drag an element from the attacker's controlled page into the Rocket.Chat client, the attacker can force the client to:
Steps to Reproduce
<img>tag, and executesfetch('http://localhost:3000/api/v1/me')with the victim's session cookies.Trace
graph TD subgraph SG0 ["apps/meteor/client/hooks/useFormatDateAndTime.ts"] useFormatDateAndTime["Returns a date and time formatting function based on user preferences and system settings."] end style SG0 fill:#2a2a2a,stroke:#444,color:#aaa subgraph SG1 ["apps/meteor/client/lib/utils/dateFormat.ts"] momentFormatToDateFns["momentFormatToDateFns"] flushLiteral["flushLiteral"] safeFormat["Safely formats a date using date-fns with fallback."] formatDate["Formats a date based on a format string."] end style SG1 fill:#2a2a2a,stroke:#444,color:#aaa subgraph SG2 ["apps/meteor/client/views/room/Room.tsx"] Room["Main component for rendering a chat room, handling E2EE setup, message lists, and contextual bars."] end style SG2 fill:#2a2a2a,stroke:#444,color:#aaa subgraph SG3 ["apps/meteor/client/views/room/body/DropTargetOverlay.tsx"] DropTargetOverlay{{"Overlay component that handles file drag-and-drop events, including processing dropped files and image URLs."}} end style SG3 fill:#2a2a2a,stroke:#444,color:#aaa subgraph SG4 ["apps/meteor/client/views/room/body/RoomBody.tsx"] RoomBody["Main container component for the chat room, managing message lists, composer, UI state, and room-specific features."] end style SG4 fill:#2a2a2a,stroke:#444,color:#aaa DropTargetOverlay --> useFormatDateAndTime useFormatDateAndTime --> formatDate formatDate --> safeFormat safeFormat --> momentFormatToDateFns momentFormatToDateFns --> flushLiteral RoomBody --> DropTargetOverlay Room --> RoomBodyFix with AI
Triage: Reply
!fp <reason>(false positive),!valid(confirmed), or!accepted_risk <reason>. Any other reply is saved as a triage note.Reason is optional but improves future scans — e.g.
!fp internal endpoint, not user-facing.View finding in Hacktron