Skip to content

Conversation

@deepak0x
Copy link
Contributor

@deepak0x deepak0x commented Jan 15, 2026

This pr address the escape json body in api calls to prevent injection

Closes #1067

Video/Screenshots

Screenshot from 2026-01-16 02-37-38

PR Test Details

Note: The PR will be ready for live testing at https://rocketchat.github.io/EmbeddedChat/pulls/pr-<pr_number> after approval. Contributors are requested to replace <pr_number> with the actual PR number.

… to prevent injection

- Replaced template literal JSON construction with JSON.stringify() in all API methods
- Fixes vulnerability where user input containing quotes would break JSON structure
- Affected methods: updateMessage, deleteMessage, updateUserUsername, reactToMessage, reportMessage, starMessage, unstarMessage, pinMessage, unpinMessage, updateUserNameThroughSuggestion
@deepak0x deepak0x force-pushed the fix/json-injection-issue-1 branch from c1f58c6 to ce480d0 Compare January 16, 2026 14:05
Copy link
Collaborator

@Spiral-Memory Spiral-Memory left a comment

Choose a reason for hiding this comment

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

Great find @deepak0x
LGTM

@deepak0x
Copy link
Contributor Author

Thanks 😊

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bug: Critical JSON Injection in API Request Construction

2 participants