🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.debian.bugs.rc
Article #2831

Bug#1152740: cherrytree: CVE-2026-118692

#2831
From: 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--
Technical Details
Message-ID: <NXSmJ-b0r8-7@gated-at.bofh.it>
Path: mbox-mo1.pugleaf.net!news-lax.pugleaf.net!news-ams.pugleaf.net!news.tcpreset.net!newsfeed.bofh.team!newsfeed.xs3.de!news.samoylyk.net!gothmog.csi.it!news.servidellagleba.it!bofh.it!news.nic.it!robomod
References: <NXInn-aULu-3@gated-at.bofh.it>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-lax.pugleaf.net!news-ams.pugleaf.net!news.tcpreset.net!newsfeed.bofh.team!newsfeed.xs3.de!news.samoylyk.net!gothmog.csi.it!news.servidellagleba.it!bofh.it!news.nic.it!robomod
From: Bastian Germann <bage@debian.org>
Newsgroups: linux.debian.bugs.rc
Subject: Bug#1152740: cherrytree: CVE-2026-118692
Date: Tue, 10 Nov 2026 12:40:01 +0100
Message-ID: <NXSmJ-b0r8-7@gated-at.bofh.it>
References: <NXInn-aULu-3@gated-at.bofh.it>
X-Mailbox-Line: From debian-bugs-rc-request@lists.debian.org  Tue Nov 10 11:33:09 2026
Old-Return-Path: <debbugs@buxtehude.debian.org>
X-Spam-Flag: NO
X-Spam-Score: -1.7
Reply-To: Bastian Germann <bage@debian.org>, 1152740@bugs.debian.org
Resent-To: debian-bugs-dist@lists.debian.org
Resent-Cc: winnie@debian.org
X-Debian-Pr-Message: followup 1152740
X-Debian-Pr-Package: cherrytree
X-Debian-Pr-Keywords: security upstream
X-Debian-Pr-Source: cherrytree
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="7LUrSow3IMLp4qzW"
Content-Disposition: inline
X-Debian-User: bage
X-Debian-Message: from BTS
X-Mailing-List: <debian-bugs-rc@lists.debian.org> archive/latest/837807
List-ID: <debian-bugs-rc.lists.debian.org>
List-URL: <https://lists.debian.org/debian-bugs-rc/>
Approved: robomod@news.nic.it
Lines: 203
Organization: linux.* mail to news gateway
Sender: robomod@news.nic.it
X-Original-Date: Tue, 10 Nov 2026 12:31:06 +0100
X-Original-Message-ID: <avMAelPCKv6B92Uv@duagon-BXN3S64.localdomain>
X-Original-References: <CAFkxLsQyTA44jC_u5q_EKHRH+4h3Jpm8-D2N5LV66aJAgVsW+A@mail.gmail.com>