🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: linux.debian.bugs.rc
2 messages
2 total messages Started by Bastian Germann Tue, 10 Nov 2026 11:40
Bug#1152740: cherrytree: CVE-2026-118692
#2831
Author: Bastian Germann
Date: Tue, 10 Nov 2026 11:40
203 lines
10049 bytes
--7LUrSow3IMLp4qzW
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline

Control: tags -1 patch

Please find the trixie-security debdiff attached.
Will the Security Team apply it or are we supposed to route via the
Release Team?

--7LUrSow3IMLp4qzW
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=cherrytree_1.2.0+dfsg-1+deb13u1.debdiff

diff -Nru cherrytree-1.2.0+dfsg/debian/changelog cherrytree-1.2.0+dfsg/debian/changelog
--- cherrytree-1.2.0+dfsg/debian/changelog	2025-01-18 22:10:15.000000000 +0100
+++ cherrytree-1.2.0+dfsg/debian/changelog	2026-11-10 01:47:00.000000000 +0100
@@ -1,3 +1,12 @@
+cherrytree (1.2.0+dfsg-1+deb13u1) trixie-security; urgency=high
+
+  * Non-maintainer upload
+
+  [ Sumit Verma ]
+  * Prevent OS command injection (Closes: #1152740, CVE-2026-118692)
+
+ -- Bastian Germann <bage@debian.org>  Tue, 10 Nov 2026 01:47:00 +0100
+
 cherrytree (1.2.0+dfsg-1) unstable; urgency=medium
 
   * New upstream version 1.2.0+dfsg
diff -Nru cherrytree-1.2.0+dfsg/debian/patches/CVE-2026-118692.patch cherrytree-1.2.0+dfsg/debian/patches/CVE-2026-118692.patch
--- cherrytree-1.2.0+dfsg/debian/patches/CVE-2026-118692.patch	1970-01-01 01:00:00.000000000 +0100
+++ cherrytree-1.2.0+dfsg/debian/patches/CVE-2026-118692.patch	2026-11-10 01:43:25.000000000 +0100
@@ -0,0 +1,159 @@
+Description: Prevent OS command injection via custom link actions (CVE-2026-118692)
+ CtActions::link_clicked (web link custom action) and fs::open_filepath /
+ fs::open_folderpath (file / folder link custom actions) built a shell
+ command with fmt::sprintf(customAct, arg) and ran it through std::system(),
+ so a web-link URL or a file/folder path containing $(...), backticks or ';'
+ was interpreted by the shell. When the non-default Custom Link Action option
+ is enabled, a crafted document could thus run arbitrary commands on click.
+ .
+ Backport of upstream commit 0a0638651f31 (not yet in a release). The trusted
+ command template is parsed with Glib::shell_parse_argv(), the untrusted
+ argument is substituted into individual argv elements (or appended when the
+ template has no %s), and the program is run with Glib::spawn_async() without
+ a shell, so shell metacharacters in the argument are never interpreted. The
+ trailing "&" historically used in the default templates for backgrounding is
+ dropped (spawn_async is already asynchronous), so the existing default
+ templates keep working unchanged.
+Author: Sumit Verma <automationcanadian@gmail.com>
+Origin: backport, https://github.com/giuspen/cherrytree/commit/0a0638651f31
+Bug-Debian: https://bugs.debian.org/1152740
+Forwarded: not-needed (fixed upstream)
+Last-Update: 2026-11-06
+---
+--- a/src/ct/ct_actions_others.cc
++++ b/src/ct/ct_actions_others.cc
+@@ -333,13 +333,7 @@
+     if (link_entry.type == CtConst::LINK_TYPE_WEBS) { // link to webpage
+         Glib::ustring clean_weblink = str::replace(link_entry.webs, "amp;", "");
+         if (_pCtConfig->weblinkCustomOn) {
+-            std::string cmd = fmt::sprintf(_pCtConfig->weblinkCustomAct, clean_weblink.raw());
+-            int retr = std::system(cmd.c_str());
+-            if (retr == -1) {
+-                // Internal std::system error
+-                spdlog::error("Error while executing: '{}'; Message: {}", cmd, std::strerror(errno));
+-                return;
+-            }
++            fs::open_custom_action(_pCtConfig->weblinkCustomAct, clean_weblink.raw());
+         }
+         else {
+             fs::open_weblink(clean_weblink);
+--- a/src/ct/ct_filesystem.cc
++++ b/src/ct/ct_filesystem.cc
+@@ -22,6 +22,8 @@
+  */
+ 
+ #include <glibmm/miscutils.h>
++#include <glibmm/shell.h>
++#include <glibmm/spawn.h>
+ #include <giomm/file.h>
+ #include <glib/gstdio.h>
+ #include <curl/curl.h>
+@@ -315,18 +317,76 @@
+     _locale_env_vars_set_for_external_cmd(false/*isPre*/);
+ }
+ 
++static std::vector<std::string> custom_action_build_argv(const std::string& template_cmd, const std::string& target_arg)
++{
++    if (template_cmd.empty()) {
++        return {};
++    }
++    std::vector<std::string> argv;
++    try {
++        argv = Glib::shell_parse_argv(template_cmd);
++    }
++    catch (const Glib::Error& error) {
++        spdlog::error("custom_action_build_argv: failed to parse template '{}': {}", template_cmd, error.what().raw());
++        return {};
++    }
++    if (argv.empty()) {
++        return {};
++    }
++
++    // Strip trailing "&" historically used for shell backgrounding
++    if (argv.back() == "&") {
++        argv.pop_back();
++    }
++    if (argv.empty()) {
++        return {};
++    }
++
++    bool substituted = false;
++    for (auto& arg : argv) {
++        size_t pos = 0;
++        while ((pos = arg.find("%s", pos)) != std::string::npos) {
++            arg.replace(pos, 2, target_arg);
++            pos += target_arg.length();
++            substituted = true;
++        }
++    }
++    if (!substituted) {
++        argv.push_back(target_arg);
++    }
++    return argv;
++}
++
++bool open_custom_action(const std::string& template_cmd, const std::string& target_arg)
++{
++    const std::vector<std::string> argv = custom_action_build_argv(template_cmd, target_arg);
++    if (argv.empty()) {
++        return false;
++    }
++
++    _locale_env_vars_set_for_external_cmd(true/*isPre*/);
++    bool spawned = false;
++    try {
++#if GTKMM_MAJOR_VERSION >= 4
++        Glib::spawn_async("", argv, Glib::SpawnFlags::SEARCH_PATH);
++#else
++        Glib::spawn_async("", argv, Glib::SpawnFlags::SPAWN_SEARCH_PATH);
++#endif
++        spawned = true;
++    }
++    catch (const Glib::Error& error) {
++        spdlog::error("open_custom_action: failed to spawn '{}': {}", argv.front(), error.what().raw());
++    }
++    _locale_env_vars_set_for_external_cmd(false/*isPre*/);
++    return spawned;
++}
++
+ // Open Filepath with External App
+ void open_filepath(const fs::path& filepath, bool open_folder_if_file_not_exists, CtConfig* config)
+ {
+     spdlog::debug("fs::open_filepath {}", filepath.string());
+     if (config->filelinkCustomOn) {
+-        std::string cmd = fmt::sprintf(config->filelinkCustomAct, filepath.string());
+-        _locale_env_vars_set_for_external_cmd(true/*isPre*/);
+-        const int retVal = std::system(cmd.c_str());
+-        _locale_env_vars_set_for_external_cmd(false/*isPre*/);
+-        if (retVal != 0) {
+-            spdlog::error("system({}) returned {}", cmd, retVal);
+-        }
++        open_custom_action(config->filelinkCustomAct, filepath.string());
+     }
+     else {
+         if (open_folder_if_file_not_exists && !fs::exists(filepath)) {
+@@ -347,13 +407,7 @@
+ {
+     spdlog::debug("fs::open_folderpath {}", folderpath.string());
+     if (config->folderlinkCustomOn) {
+-        std::string cmd = fmt::sprintf(config->folderlinkCustomAct, folderpath.string());
+-        _locale_env_vars_set_for_external_cmd(true/*isPre*/);
+-        const int retVal = std::system(cmd.c_str());
+-        _locale_env_vars_set_for_external_cmd(false/*isPre*/);
+-        if (retVal != 0) {
+-            spdlog::error("system({}) returned {}", cmd, retVal);
+-        }
++        open_custom_action(config->folderlinkCustomAct, folderpath.string());
+     }
+     else {
+         _open_path_with_default_app(folderpath);
+--- a/src/ct/ct_filesystem.h
++++ b/src/ct/ct_filesystem.h
+@@ -82,6 +82,7 @@
+ void open_weblink(const std::string& link);
+ void open_filepath(const path& filepath, bool open_folder_if_file_not_exists, CtConfig* config);
+ void open_folderpath(const path& folderpath, CtConfig* config);
++bool open_custom_action(const std::string& template_cmd, const std::string& target_arg);
+ 
+ path prepare_export_folder(const path& dir_place, path new_folder, bool overwrite_existing);
+ 
diff -Nru cherrytree-1.2.0+dfsg/debian/patches/series cherrytree-1.2.0+dfsg/debian/patches/series
--- cherrytree-1.2.0+dfsg/debian/patches/series	2025-01-15 11:44:13.000000000 +0100
+++ cherrytree-1.2.0+dfsg/debian/patches/series	2026-11-10 01:44:02.000000000 +0100
@@ -1,2 +1,3 @@
 remove-Check-New-Version.patch
 skip-googletest.patch
+CVE-2026-118692.patch

--7LUrSow3IMLp4qzW--
Processed: cherrytree: CVE-2026-118692
#2832
Author: Debian Bug Tracking System
Date: Tue, 10 Nov 2026 11:40
11 lines
1950 bytes
Processing control commands:

> tags -1 patch
Bug #1152740 {Done: Bastian Germann <bage@debian.org>} [cherrytree] cherrytree: CVE-2026-118692
Added tag(s) patch.

-- 
1152740: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1152740
Debian Bug Tracking System
Contact owner@bugs.debian.org with problems
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads