#1152740 cherrytree: CVE-2026-118692, CVE-2026-118693: OS command injection and local file disclosure:

Package:
cherrytree
Source:
cherrytree
Description:
hierarchical note taking application
Submitter:
Dilanka Kaushal Hewage
Date:
2026-11-10 11:33:02 UTC
Severity:
normal
Tags:
#1152740#5
Date:
2026-10-31 21:18:14 UTC
From:
To:
Dear Maintainer,

Two vulnerabilities affect cherrytree, both fixed upstream on 2026-10-31 in
commit 0a0638651:

- CVE-2026-118692: OS command injection in CtActions::link_clicked
(src/ct/ct_actions_others.cc). With the custom web-link action enabled
(weblink_custom_on), a note's link URL is substituted into a shell command
string and run via std::system with no escaping, so a crafted URL inside a
shared, synced, or imported document executes arbitrary commands as the
user when the link is clicked.
- CVE-2026-118693: path traversal / local file disclosure in
CtStorageXmlHelper::_create_image_from_xml, which trusts an unvalidated
embedded-file "filename" when a document is opened.

Affected: upstream through 1.7.2, including the version currently in
Debian/Kali (1.2.0+dfsg-1+b2).
Fixed: upstream master, commit 0a0638651. No fixed upstream release has
been tagged yet at the time of filing; a release above v1.7.2 is expected
to carry the fix. Please update the package once a fixed upstream release
is available, or backport commit 0a0638651.

References:
https://www.cve.org/CVERecord?id=CVE-2026-118692
https://www.cve.org/CVERecord?id=CVE-2026-118693
https://github.com/giuspen/cherrytree/commit/0a0638651
https://r3vpwnx.space/research/cherrytree-weblink-cmdinjection/

Thanks,
Dilanka Kaushal Hewage (r3vpwnx)

#1152740#12
Date:
2026-11-06 03:53:19 UTC
From:
To:
Hi,

Both CVEs in this report were fixed upstream on 2026-10-31. Neither fix is
in a release yet (newest tag is v1.7.2, and both advisories read "through
1.7.2").

CVE-2026-118692 (OS command injection via the custom web-link action,
upstream issue #2945) is fixed by commit 0a0638651f31. Instead of
fmt::sprintf(template, url) followed by std::system(), the fix parses the
template with Glib::shell_parse_argv(), substitutes the URL into individual
argv elements, and runs it with Glib::spawn_async() (no shell). The same
change also covers the file-link and folder-link custom actions, which
share the std::system sink.

CVE-2026-118693 (arbitrary local file read via a crafted embedded-file
name, upstream issue #2944) is fixed by commit 61fca359a431, which
validates the embedded-file "filename" attribute instead of trusting it.

Affected shipped versions (verified in the source): bookworm 0.99.48 and
trixie/sid/forky 1.2.0 both carry the vulnerable code (link_clicked
sprintf+system; open_filepath/open_folderpath sprintf+system; and
_create_image_from_xml reading "filename").

Attached are backports of the CVE-2026-118692 fix, adapted to the shipped
versions (the upstream commit does not cherry-pick: it was refactored into
ct_filesystem.cc, while the shipped versions have the call inline):

CVE-2026-118692-cherrytree-1.2.0.patch trixie / sid / forky (1.2.0+dfsg-1)
CVE-2026-118692-cherrytree-0.99.48.patch bookworm (0.99.48+dfsg-1)

Both are DEP-3 and touch three files (ct_actions_others.cc,
ct_filesystem.cc, ct_filesystem.h). They route all three custom-action
sinks (web, file, folder link) through a new helper that parses the trusted
template with Glib::shell_parse_argv, substitutes the untrusted argument
into argv elements, and spawns with Glib::spawn_async -- no shell. The
existing default templates keep working: the helper drops the historical
trailing "&". ct_config.h is left unchanged.

Verification:
- Both patches apply cleanly to the packaged sources (patch -p1).
- I unit-tested the ported helper in isolation against the real
g_shell_parse_argv: an argument containing $(...), backticks or ';'
stays a single argv element for every template shape tested; and on a
live payload, the old std::system path runs the injected command while
the new argv+spawn path does not.
- I did not rebuild the full GTK application; the change uses only
Glib/spdlog calls already present in these files.

I can provide a backport for CVE-2026-118693 as well if that would help.

Regards,
Sumit

#1152740#17
Date:
2026-11-06 03:58:14 UTC
From:
To:
Hi,

A correction to my previous message regarding CVE-2026-118693.

There I listed "_create_image_from_xml reading the filename attribute" as
making the shipped versions affected. On closer inspection that is not
accurate: the attribute is read, but in 0.99.48 and 1.2.0 it is never used
to open a file, so the arbitrary read described in the CVE is not reachable
there.

- 0.99.48 has no multifile support; _create_image_from_xml takes the
embedded-file bytes only from base64 in the XML. The filename is kept
for display and as the save-dialog default, but never opens a file.
- 1.2.0 takes the bytes from base64 (single-file) or from the multifile
store keyed by the sha256sum attribute (CtStorageMultiFile::read_blob
matches on sha256sum), never from a path built from "filename".

The read fixed by 61fca359a431 lives in newer code:
CtImageEmbFile::_checkNonEmptyRawBlob reads multifile_dir/_fileName when the
in-document blob is empty. That function is not present in 0.99.48 or 1.2.0.

So I would suggest CVE-2026-118693 is not-affected for bookworm 0.99.48 and
trixie/sid/forky 1.2.0. The only related weakness I can find in these
versions is a possible traversal in the temporary filename when a user
explicitly opens an embedded file (CtActions::embfile_open reuses the stored
name unsanitised); upstream's sanitize_filename also covers that, and I can
send a small hardening backport if you consider it in scope.

CVE-2026-118692 and the backports attached to my previous message are
unaffected by this correction.

Regards,
Sumit

#1152740#22
Date:
2026-11-10 00:49:52 UTC
From:
To:
I am uploading a LowNMU to sponsor the patch.
The changes are in git.

#1152740#25
Date:
2026-11-10 00:48:46 UTC
From:
To:
Hello,

Bug #1152740 in cherrytree reported by you has been fixed in the
Git repository and is awaiting an upload. You can see the commit
message below and you can check the diff of the fix at:

https://salsa.debian.org/debian/cherrytree/-/commit/e702d084217b476e720cdf42751538e783a40842

(this message was generated automatically)
-- 
Greetings

https://bugs.debian.org/1152740

#1152740#32
Date:
2026-11-10 01:05:23 UTC
From:
To:
We believe that the bug you reported is fixed in the latest version of
cherrytree, which is due to be installed in the Debian FTP archive.

A summary of the changes between this version and the previous one is
attached.

Thank you for reporting the bug, which will now be closed.  If you
have further comments please address them to 1152740@bugs.debian.org,
and the maintainer will reopen the bug report if appropriate.

Debian distribution maintenance software
pp.
Bastian Germann <bage@debian.org> (supplier of updated cherrytree package)

(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing ftpmaster@ftp-master.debian.org)
Format: 1.8
Date: Tue, 10 Nov 2026 01:47:00 +0100
Source: cherrytree
Architecture: source
Version: 1.2.0+dfsg-1.1
Distribution: unstable
Urgency: medium
Maintainer: Patrick Winnertz <winnie@debian.org>
Changed-By: Bastian Germann <bage@debian.org>
Closes: 1152740
Changes:
 cherrytree (1.2.0+dfsg-1.1) unstable; urgency=medium
 .
   * Non-maintainer upload
 .
   [ Sumit Verma ]
   * Prevent OS command injection (Closes: #1152740, CVE-2026-118692)
Checksums-Sha1:
 06eb41c9f4475cf2362b25757b6f7bd70fa43f74 2030 cherrytree_1.2.0+dfsg-1.1.dsc
 5058f4b720800a92a026d8a9e0945378933edfa8 10064 cherrytree_1.2.0+dfsg-1.1.debian.tar.xz
 b8aab95d933bf15cc39599b5d856af64506a48db 6497 cherrytree_1.2.0+dfsg-1.1_source.buildinfo
Checksums-Sha256:
 38b1727a05b16d0dd675e047c627c0fc9032fb3a0dde3b253bfd24a1ff47b105 2030 cherrytree_1.2.0+dfsg-1.1.dsc
 934ece7f944bf0d5771794df29bbd62da6cb5de39416d5b346b8fa3d3bc4426e 10064 cherrytree_1.2.0+dfsg-1.1.debian.tar.xz
 a4a2b9abd11bb8aed5deacda025052d1b6dd2a4d5ef97a7d27dec5c779516d98 6497 cherrytree_1.2.0+dfsg-1.1_source.buildinfo
Files:
 08626a75e962ec9238ba9f97d7830888 2030 editors optional cherrytree_1.2.0+dfsg-1.1.dsc
 4377d8b676e5a37c915bfbfeba730854 10064 editors optional cherrytree_1.2.0+dfsg-1.1.debian.tar.xz
 a4902180011934caf0d0fc7d9174d40e 6497 editors optional cherrytree_1.2.0+dfsg-1.1_source.buildinfo
-----BEGIN PGP SIGNATURE-----

iQHEBAEBCgAuFiEEQGIgyLhVKAI3jM5BH1x6i0VWQxQFAmryadQQHGJhZ2VAZGVi
aWFuLm9yZwAKCRAfXHqLRVZDFD35DADQLjxTHc6I70aKx0oJnmWnQCPHU+oGOADj
Qcu6yWlFngW+Jbq6k7B/m3Ctn9q8jnQI5jA7mDQXDV2L98eMzrZeK4Qhl9AXptjY
IDqr3dwN5PLnSL5gBIXlEncKxE05OaxA2V7xMNAlIbtOCLmhx5pGi5uMylxx//pL
Jt8t3OFdf9kI5jDWIEGZQeMSjx15vwnO48OWzgWOZdpjAFIVK95DgIo6pndJDVlU
jBDbfzJJNovpTdKqHfXQXf5AoACn1nfvLk/mFKWdlnL6tD2HNNFoDh9GQ4JdEytq
6yWguZoLBliykFG4x8Nj4kwsuSkjTyVtX1OqaMv4K/LTohhJ4ZMXwNskF6utRLPD
TTBzhHGSwiAaAY7B9Lt+BS6bWLAVjhBbaSs9+ZJMvC78D7K+sAETsYKIsd4j+TpF
Kp/U47MBsBITc7KaXWQdjY4GC2foNgMq6XNCjZR/obwhBhcbtbaNP4EE1t89Kt2W
mMZHQXQFmckglqcaukaRPEb7PW2G1Ek=
=2l7l
-----END PGP SIGNATURE-----

#1152740#41
Date:
2026-11-10 11:31:06 UTC
From:
To:
Please find the trixie-security debdiff attached.
Will the Security Team apply it or are we supposed to route via the
Release Team?