Skip to content
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

Vulnerability Report: Remote Code Execution in the Dot Desktop Application #28

Open
EDMPL opened this issue Dec 29, 2024 · 0 comments
Open

Comments

@EDMPL
Copy link

EDMPL commented Dec 29, 2024

Hi, sorry for reporting it here. I want to report a security vulnerability that I've found in the application.

Tested on: MacOS
Affected Version: 0.9.3

Description

A critical vulnerability has been identified in the Dot Electron desktop application. The issue stems from an improperly sanitized user input in the chat box that leads to Cross-Site Scripting (XSS) vulnerability. Since the nodeIntegration attribute is set to true, it is possible to call the NodeJS API and laverage the issue to Remote Code Execution (RCE). By exploiting this XSS vulnerability, an attacker can execute arbitrary system-level commands, posing a significant security risk to end users.

Affected Code:

Lack of Sanitization of User Input and LLM Output (Root Cause):

userBubble.innerHTML = `<strong>${message}</strong>`;

botBubble.innerHTML = marked.parse(message);

nodeIntegration set to true (Please disable it if its not needed):

nodeIntegration: true,

nodeIntegration: true,

nodeIntegration: true,

Simple PoC:
Payload (remove the [blank]): <img[blank]src=x[blank]onerror="alert(require('child_process').execSync('id').toString());">

Screenshot 2024-12-30 at 00 03 28

Recommendation:
Escape special characters or HTML Tags in the chat box. If its really needed, create a whitelist of allowed HTML tags that could not lead to issue like XSS.

Simple Example:
{
msg = msg.replaceAll(/</g, "<");
msg = msg.replaceAll(/>/g, ">");
add more sanitization here.....
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant