diff options
| author | Peter Marko <peter.marko@siemens.com> | 2026-01-31 20:54:02 +0100 |
|---|---|---|
| committer | Paul Barker <paul@pbarker.dev> | 2026-02-27 15:54:01 +0000 |
| commit | 9a24d18f4094f1574738a77aa57426fa8d0ee2f5 (patch) | |
| tree | 40cef1534d147e5b9a4da2c26c3fb4927c7882dc | |
| parent | 7cdc92f5cbaefa207062f729a8cc5ef41584b9b5 (diff) | |
| download | poky-9a24d18f4094f1574738a77aa57426fa8d0ee2f5.tar.gz | |
inetutils: patch CVE-2026-24061
Pick patches per [1].
[1] https://security-tracker.debian.org/tracker/CVE-2026-24061
(From OE-Core rev: 042f02ff7072e9cf4b02a335d1d3186d68ba669b)
Signed-off-by: Peter Marko <peter.marko@siemens.com>
Signed-off-by: Yoann Congal <yoann.congal@smile.fr>
Signed-off-by: Paul Barker <paul@pbarker.dev>
3 files changed, 122 insertions, 0 deletions
diff --git a/meta/recipes-connectivity/inetutils/inetutils/CVE-2026-24061-01.patch b/meta/recipes-connectivity/inetutils/inetutils/CVE-2026-24061-01.patch new file mode 100644 index 0000000000..0af666cb1a --- /dev/null +++ b/meta/recipes-connectivity/inetutils/inetutils/CVE-2026-24061-01.patch | |||
| @@ -0,0 +1,38 @@ | |||
| 1 | From fd702c02497b2f398e739e3119bed0b23dd7aa7b Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Paul Eggert <eggert@cs.ucla.edu> | ||
| 3 | Date: Tue, 20 Jan 2026 01:10:36 -0800 | ||
| 4 | Subject: [PATCH] Fix injection bug with bogus user names | ||
| 5 | |||
| 6 | Problem reported by Kyu Neushwaistein. | ||
| 7 | * telnetd/utility.c (_var_short_name): | ||
| 8 | Ignore user names that start with '-' or contain shell metacharacters. | ||
| 9 | |||
| 10 | Signed-off-by: Simon Josefsson <simon@josefsson.org> | ||
| 11 | |||
| 12 | CVE: CVE-2026-24061 | ||
| 13 | Upstream-Status: Backport [https://codeberg.org/inetutils/inetutils/commit/fd702c02497b2f398e739e3119bed0b23dd7aa7b] | ||
| 14 | Signed-off-by: Peter Marko <peter.marko@siemens.com> | ||
| 15 | --- | ||
| 16 | telnetd/utility.c | 9 ++++++++- | ||
| 17 | 1 file changed, 8 insertions(+), 1 deletion(-) | ||
| 18 | |||
| 19 | diff --git a/telnetd/utility.c b/telnetd/utility.c | ||
| 20 | index b486226e..c02cd0e6 100644 | ||
| 21 | --- a/telnetd/utility.c | ||
| 22 | +++ b/telnetd/utility.c | ||
| 23 | @@ -1737,7 +1737,14 @@ _var_short_name (struct line_expander *exp) | ||
| 24 | return user_name ? xstrdup (user_name) : NULL; | ||
| 25 | |||
| 26 | case 'U': | ||
| 27 | - return getenv ("USER") ? xstrdup (getenv ("USER")) : xstrdup (""); | ||
| 28 | + { | ||
| 29 | + /* Ignore user names starting with '-' or containing shell | ||
| 30 | + metachars, as they can cause trouble. */ | ||
| 31 | + char const *u = getenv ("USER"); | ||
| 32 | + return xstrdup ((u && *u != '-' | ||
| 33 | + && !u[strcspn (u, "\t\n !\"#$&'()*;<=>?[\\^`{|}~")]) | ||
| 34 | + ? u : ""); | ||
| 35 | + } | ||
| 36 | |||
| 37 | default: | ||
| 38 | exp->state = EXP_STATE_ERROR; | ||
diff --git a/meta/recipes-connectivity/inetutils/inetutils/CVE-2026-24061-02.patch b/meta/recipes-connectivity/inetutils/inetutils/CVE-2026-24061-02.patch new file mode 100644 index 0000000000..5a012eb295 --- /dev/null +++ b/meta/recipes-connectivity/inetutils/inetutils/CVE-2026-24061-02.patch | |||
| @@ -0,0 +1,82 @@ | |||
| 1 | From ccba9f748aa8d50a38d7748e2e60362edd6a32cc Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Simon Josefsson <simon@josefsson.org> | ||
| 3 | Date: Tue, 20 Jan 2026 14:02:39 +0100 | ||
| 4 | Subject: [PATCH] telnetd: Sanitize all variable expansions | ||
| 5 | |||
| 6 | * telnetd/utility.c (sanitize): New function. | ||
| 7 | (_var_short_name): Use it for all variables. | ||
| 8 | |||
| 9 | CVE: CVE-2026-24061 | ||
| 10 | Upstream-Status: Backport [https://codeberg.org/inetutils/inetutils/commit/ccba9f748aa8d50a38d7748e2e60362edd6a32cc] | ||
| 11 | Signed-off-by: Peter Marko <peter.marko@siemens.com> | ||
| 12 | --- | ||
| 13 | telnetd/utility.c | 32 ++++++++++++++++++-------------- | ||
| 14 | 1 file changed, 18 insertions(+), 14 deletions(-) | ||
| 15 | |||
| 16 | diff --git a/telnetd/utility.c b/telnetd/utility.c | ||
| 17 | index c02cd0e6..b21ad961 100644 | ||
| 18 | --- a/telnetd/utility.c | ||
| 19 | +++ b/telnetd/utility.c | ||
| 20 | @@ -1688,6 +1688,17 @@ static void _expand_cond (struct line_expander *exp); | ||
| 21 | static void _skip_block (struct line_expander *exp); | ||
| 22 | static void _expand_block (struct line_expander *exp); | ||
| 23 | |||
| 24 | +static char * | ||
| 25 | +sanitize (const char *u) | ||
| 26 | +{ | ||
| 27 | + /* Ignore values starting with '-' or containing shell metachars, as | ||
| 28 | + they can cause trouble. */ | ||
| 29 | + if (u && *u != '-' && !u[strcspn (u, "\t\n !\"#$&'()*;<=>?[\\^`{|}~")]) | ||
| 30 | + return u; | ||
| 31 | + else | ||
| 32 | + return ""; | ||
| 33 | +} | ||
| 34 | + | ||
| 35 | /* Expand a variable referenced by its short one-symbol name. | ||
| 36 | Input: exp->cp points to the variable name. | ||
| 37 | FIXME: not implemented */ | ||
| 38 | @@ -1714,13 +1725,13 @@ _var_short_name (struct line_expander *exp) | ||
| 39 | return xstrdup (timebuf); | ||
| 40 | |||
| 41 | case 'h': | ||
| 42 | - return xstrdup (remote_hostname); | ||
| 43 | + return xstrdup (sanitize (remote_hostname)); | ||
| 44 | |||
| 45 | case 'l': | ||
| 46 | - return xstrdup (local_hostname); | ||
| 47 | + return xstrdup (sanitize (local_hostname)); | ||
| 48 | |||
| 49 | case 'L': | ||
| 50 | - return xstrdup (line); | ||
| 51 | + return xstrdup (sanitize (line)); | ||
| 52 | |||
| 53 | case 't': | ||
| 54 | q = strchr (line + 1, '/'); | ||
| 55 | @@ -1728,23 +1739,16 @@ _var_short_name (struct line_expander *exp) | ||
| 56 | q++; | ||
| 57 | else | ||
| 58 | q = line; | ||
| 59 | - return xstrdup (q); | ||
| 60 | + return xstrdup (sanitize (q)); | ||
| 61 | |||
| 62 | case 'T': | ||
| 63 | - return terminaltype ? xstrdup (terminaltype) : NULL; | ||
| 64 | + return terminaltype ? xstrdup (sanitize (terminaltype)) : NULL; | ||
| 65 | |||
| 66 | case 'u': | ||
| 67 | - return user_name ? xstrdup (user_name) : NULL; | ||
| 68 | + return user_name ? xstrdup (sanitize (user_name)) : NULL; | ||
| 69 | |||
| 70 | case 'U': | ||
| 71 | - { | ||
| 72 | - /* Ignore user names starting with '-' or containing shell | ||
| 73 | - metachars, as they can cause trouble. */ | ||
| 74 | - char const *u = getenv ("USER"); | ||
| 75 | - return xstrdup ((u && *u != '-' | ||
| 76 | - && !u[strcspn (u, "\t\n !\"#$&'()*;<=>?[\\^`{|}~")]) | ||
| 77 | - ? u : ""); | ||
| 78 | - } | ||
| 79 | + return xstrdup (sanitize (getenv ("USER"))); | ||
| 80 | |||
| 81 | default: | ||
| 82 | exp->state = EXP_STATE_ERROR; | ||
diff --git a/meta/recipes-connectivity/inetutils/inetutils_2.2.bb b/meta/recipes-connectivity/inetutils/inetutils_2.2.bb index 6f9173dbc1..9f4e1a82e1 100644 --- a/meta/recipes-connectivity/inetutils/inetutils_2.2.bb +++ b/meta/recipes-connectivity/inetutils/inetutils_2.2.bb | |||
| @@ -24,6 +24,8 @@ SRC_URI = "${GNU_MIRROR}/inetutils/inetutils-${PV}.tar.xz \ | |||
| 24 | file://CVE-2022-39028.patch \ | 24 | file://CVE-2022-39028.patch \ |
| 25 | file://0001-CVE-2023-40303-ftpd-rcp-rlogin-rsh-rshd-uucpd-fix-ch.patch \ | 25 | file://0001-CVE-2023-40303-ftpd-rcp-rlogin-rsh-rshd-uucpd-fix-ch.patch \ |
| 26 | file://0002-CVE-2023-40303-Indent-changes-in-previous-commit.patch \ | 26 | file://0002-CVE-2023-40303-Indent-changes-in-previous-commit.patch \ |
| 27 | file://CVE-2026-24061-01.patch \ | ||
| 28 | file://CVE-2026-24061-02.patch \ | ||
| 27 | " | 29 | " |
| 28 | 30 | ||
| 29 | inherit autotools gettext update-alternatives texinfo | 31 | inherit autotools gettext update-alternatives texinfo |
