Version in base suite: 5.0.2+git20231211.1364ae4-9+deb13u2 Base version: lxd_5.0.2+git20231211.1364ae4-9+deb13u2 Target version: lxd_5.0.2+git20231211.1364ae4-9+deb13u3 Base file: /srv/ftp-master.debian.org/ftp/pool/main/l/lxd/lxd_5.0.2+git20231211.1364ae4-9+deb13u2.dsc Target file: /srv/ftp-master.debian.org/policy/pool/main/l/lxd/lxd_5.0.2+git20231211.1364ae4-9+deb13u3.dsc changelog | 8 ++ patches/105-CVE-2026-23953.patch | 49 ++++++++++++++++ patches/106-CVE-2026-23954.patch | 118 +++++++++++++++++++++++++++++++++++++++ patches/series | 2 4 files changed, 177 insertions(+) dpkg-source: warning: cannot verify inline signature for /srv/release.debian.org/tmp/tmp9guiorlw/lxd_5.0.2+git20231211.1364ae4-9+deb13u2.dsc: no acceptable signature found dpkg-source: warning: cannot verify inline signature for /srv/release.debian.org/tmp/tmp9guiorlw/lxd_5.0.2+git20231211.1364ae4-9+deb13u3.dsc: no acceptable signature found diff -Nru lxd-5.0.2+git20231211.1364ae4/debian/changelog lxd-5.0.2+git20231211.1364ae4/debian/changelog --- lxd-5.0.2+git20231211.1364ae4/debian/changelog 2025-11-11 15:25:08.000000000 +0000 +++ lxd-5.0.2+git20231211.1364ae4/debian/changelog 2026-02-27 23:42:15.000000000 +0000 @@ -1,3 +1,11 @@ +lxd (5.0.2+git20231211.1364ae4-9+deb13u3) trixie-security; urgency=high + + * Cherry-pick fixes for the following security issues: + - CVE-2026-23953 / GHSA-x6jc-phwx-hp32 + - CVE-2026-23954 / GHSA-7f67-crqm-jgh7 + + -- Mathias Gibbens Fri, 27 Feb 2026 23:42:15 +0000 + lxd (5.0.2+git20231211.1364ae4-9+deb13u2) trixie; urgency=medium * Cherry-pick upstream fix for broken idmapping with kernel 6.9+ diff -Nru lxd-5.0.2+git20231211.1364ae4/debian/patches/105-CVE-2026-23953.patch lxd-5.0.2+git20231211.1364ae4/debian/patches/105-CVE-2026-23953.patch --- lxd-5.0.2+git20231211.1364ae4/debian/patches/105-CVE-2026-23953.patch 1970-01-01 00:00:00.000000000 +0000 +++ lxd-5.0.2+git20231211.1364ae4/debian/patches/105-CVE-2026-23953.patch 2026-02-27 23:42:15.000000000 +0000 @@ -0,0 +1,49 @@ +From 6343c2cb0c2c5d4057821f05094671bff032ede8 Mon Sep 17 00:00:00 2001 +From: Thomas Parrott +Date: Tue, 3 Feb 2026 10:18:43 +0000 +Subject: [PATCH] lxd/instance/instancetype/instance: Prevent line breaks in + environment variables +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +LXC doesn't currently have a syntax to hold a multi-line environment +variable in its configuration. The use of multi-line environment +variables leads to a corrupted configuration file and to a security +issue where additional lines may be added by an unprivileged user to +escalate their privileges. + +This fixes CVE-2026-23953. + +Reported-by: Rory McNamara +Signed-off-by: Stéphane Graber +(cherry picked from commit cdf037409fbb35ab0f9fdc4e0e8cc706adbca99e) +Signed-off-by: Thomas Parrott +License: Apache-2.0 +(cherry picked from commit a53d166d34c7b7c5c0b90bc85276122c3f6142dd) +(cherry picked from commit 5e57e2cd2ed9bc38c04e059970ef5f33f0f2f167) +Signed-off-by: Thomas Parrott +Rebased-by: Mathias Gibbens +--- + shared/instance.go | 8 +++++++- + 1 file changed, 7 insertions(+), 1 deletion(-) + +diff --git a/shared/instance.go b/shared/instance.go +index 0e610a0ac113..b3a2d9990e20 100644 +--- a/shared/instance.go ++++ b/shared/instance.go +@@ -712,7 +712,13 @@ func ConfigKeyChecker(key string, instanceType Type) (func(value string) error, + } + + if strings.HasPrefix(key, "environment.") { +- return validate.IsAny, nil ++ return func(val string) error { ++ if strings.Contains(val, "\n") { ++ return errors.New("Environment variables cannot contain line breaks") ++ } ++ ++ return nil ++ }, nil + } + + if strings.HasPrefix(key, "user.") { diff -Nru lxd-5.0.2+git20231211.1364ae4/debian/patches/106-CVE-2026-23954.patch lxd-5.0.2+git20231211.1364ae4/debian/patches/106-CVE-2026-23954.patch --- lxd-5.0.2+git20231211.1364ae4/debian/patches/106-CVE-2026-23954.patch 1970-01-01 00:00:00.000000000 +0000 +++ lxd-5.0.2+git20231211.1364ae4/debian/patches/106-CVE-2026-23954.patch 2026-02-27 23:42:15.000000000 +0000 @@ -0,0 +1,118 @@ +From 9a80e47b358e56fb2c9f7abad61b1d0ac654b6fa Mon Sep 17 00:00:00 2001 +From: Thomas Parrott +Date: Tue, 3 Feb 2026 10:51:01 +0000 +Subject: [PATCH] lxd/instance/drivers/driver/lxc: Restrict path of template + files and targets +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +This fixes three security issues related to file templates: + + - The template target path could be made to be relative or gothrough + symlinks in a way that could lead to arbitrary write to the host + filesystem. + + - The template directory could be relative, allowing for arbitrary read + from the host filesystem. + + - The template file itself could be made relative, allowing for + arbitrary reads from the host filesystem. + +In the case of the template target path, the new logic makes use of the +kernel's openat2 system call which brings a variety of flags that can be +used to restrict path resolution and detect potential issues. + +For the template path itself, we now validate that it is a simple local +file and that the template directory isn't a symlink. + +This fixes CVE-2026-23954 + +Reported-by: Rory McNamara +Signed-off-by: Stéphane Graber +(cherry picked from commit c1d90bd34a7ccc224276b87644d7c75437f1cb64) +Signed-off-by: Thomas Parrott +License: Apache-2.0 +(cherry picked from commit d1c8ba15d1602d72fcf4ca6783a204c7b6e6f358) +(cherry picked from commit 29ec347592d3e96f600b223b89dc26371b8888f6) +--- + lxd/instance/drivers/driver_lxc.go | 58 +++++++++++++++++++++++++++++- + 1 file changed, 57 insertions(+), 1 deletion(-) + +diff --git a/lxd/instance/drivers/driver_lxc.go b/lxd/instance/drivers/driver_lxc.go +index 61613b75691e..898473e64a77 100644 +--- a/lxd/instance/drivers/driver_lxc.go ++++ b/lxd/instance/drivers/driver_lxc.go +@@ -6596,6 +6596,32 @@ func (d *lxc) templateApplyNow(trigger instance.TemplateTrigger) error { + containerMeta["privileged"] = "false" + } + ++ // Setup security check. ++ rootfsPath, err := os.OpenFile(d.RootfsPath(), unix.O_PATH, 0) ++ if err != nil { ++ return fmt.Errorf("Failed opening instance rootfs path: %w", err) ++ } ++ ++ defer func() { _ = rootfsPath.Close() }() ++ ++ checkBeneath := func(targetPath string) error { ++ fd, err := unix.Openat2(int(rootfsPath.Fd()), targetPath, &unix.OpenHow{ ++ Flags: unix.O_PATH | unix.O_CLOEXEC, ++ Resolve: unix.RESOLVE_BENEATH | unix.RESOLVE_NO_MAGICLINKS, ++ }) ++ if err != nil { ++ if errors.Is(err, unix.EXDEV) { ++ return errors.New("Template is attempting access to path outside of container") ++ } ++ ++ return nil ++ } ++ ++ _ = unix.Close(fd) ++ ++ return nil ++ } ++ + // Go through the templates + for tplPath, tpl := range metadata.Templates { + err = func(tplPath string, tpl *api.ImageMetadataTemplate) error { +@@ -6614,8 +6640,38 @@ func (d *lxc) templateApplyNow(trigger instance.TemplateTrigger) error { + return nil + } + ++ // Perform some security checks. ++ relPath := strings.TrimLeft(tplPath, "/") ++ ++ err = checkBeneath(relPath) ++ if err != nil { ++ return err ++ } ++ ++ if filepath.Base(tpl.Template) != tpl.Template { ++ return errors.New("Template path is attempting to read outside of template directory") ++ } ++ ++ tplDirStat, err := os.Lstat(d.TemplatesPath()) ++ if err != nil { ++ return fmt.Errorf("Could not access template directory: %w", err) ++ } ++ ++ if !tplDirStat.IsDir() { ++ return errors.New("Template directory is not a regular directory") ++ } ++ ++ tplFileStat, err := os.Lstat(filepath.Join(d.TemplatesPath(), tpl.Template)) ++ if err != nil { ++ return fmt.Errorf("Could not access template file: %w", err) ++ } ++ ++ if tplFileStat.Mode()&os.ModeSymlink == os.ModeSymlink { ++ return errors.New("Template file is a symlink") ++ } ++ + // Open the file to template, create if needed +- fullpath := filepath.Join(d.RootfsPath(), strings.TrimLeft(tplPath, "/")) ++ fullpath := filepath.Join(d.RootfsPath(), relPath) + if shared.PathExists(fullpath) { + if tpl.CreateOnly { + return nil diff -Nru lxd-5.0.2+git20231211.1364ae4/debian/patches/series lxd-5.0.2+git20231211.1364ae4/debian/patches/series --- lxd-5.0.2+git20231211.1364ae4/debian/patches/series 2025-11-11 15:25:08.000000000 +0000 +++ lxd-5.0.2+git20231211.1364ae4/debian/patches/series 2026-02-27 23:42:15.000000000 +0000 @@ -16,3 +16,5 @@ 103a-CVE-2025-54286.patch 103b-CVE-2025-54286.patch 104-GHSA-56mx-8g9f-5crf.patch +105-CVE-2026-23953.patch +106-CVE-2026-23954.patch