Skip to content

Commit

Permalink
Merge pull request #1003 from thomasgl-orange/execFile
Browse files Browse the repository at this point in the history
prevent arbitrary command execution via URL when using --defaultURLHandler
  • Loading branch information
jijojosephk authored Oct 31, 2023
2 parents 38c1eee + 2df4342 commit 6d08b83
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 3 deletions.
4 changes: 2 additions & 2 deletions app/mainAppWindow/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ const { StreamSelector } = require('../streamSelector');
const { LucidLog } = require('lucid-log');
const { SpellCheckProvider } = require('../spellCheckProvider');
const { httpHelper } = require('../helpers');
const exec = require('child_process').exec;
const execFile = require('child_process').execFile;
const TrayIconChooser = require('../browser/tools/trayIconChooser');
// eslint-disable-next-line no-unused-vars
const { AppConfiguration } = require('../appConfiguration');
Expand Down Expand Up @@ -360,7 +360,7 @@ function secureOpenLink(details) {

function openInBrowser(details) {
if (config.defaultURLHandler.trim() !== '') {
exec(`${config.defaultURLHandler.trim()} "${details.url}"`, openInBrowserErrorHandler);
execFile(config.defaultURLHandler.trim(), [details.url], openInBrowserErrorHandler);
} else {
shell.openExternal(details.url);
}
Expand Down
7 changes: 7 additions & 0 deletions com.github.IsmaelMartinez.teams_for_linux.appdata.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,13 @@
<url type="bugtracker">https://github.com/IsmaelMartinez/teams-for-linux/issues</url>
<launchable type="desktop-id">com.github.IsmaelMartinez.teams_for_linux.desktop</launchable>
<releases>
<release version="1.3.17" date="2023-10-30">
<description>
<ul>
<li>Fix: Avoid calling child_process.exec with untrusted string</li>
</ul>
</description>
</release>
<release version="1.3.16" date="2023-10-30">
<description>
<ul>
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "teams-for-linux",
"version": "1.3.16",
"version": "1.3.17",
"main": "app/index.js",
"description": "Unofficial client for Microsoft Teams for Linux",
"homepage": "https://github.com/IsmaelMartinez/teams-for-linux",
Expand Down

0 comments on commit 6d08b83

Please sign in to comment.