diff options
| author | Vijay Anusuri <vanusuri@mvista.com> | 2025-07-08 18:05:31 +0530 |
|---|---|---|
| committer | Steve Sakoman <steve@sakoman.com> | 2025-07-11 08:11:53 -0700 |
| commit | 55a6c02c353c943714c34e83043958dfeb0b552d (patch) | |
| tree | 829d5e6c05ab408931b0a4226c15f09d868c67d8 | |
| parent | 60f859e4bee1a779d6f46896be26f0ba3a167032 (diff) | |
| download | poky-55a6c02c353c943714c34e83043958dfeb0b552d.tar.gz | |
sudo: Fix CVE-2025-32462
Upstream-Status: Backport from https://github.com/sudo-project/sudo/commit/d530367828e3713d09489872743eb92d31fb11ff
(From OE-Core rev: d01f888a5ec43fdc8e7bd496ae9317c0fa28da9b)
Signed-off-by: Vijay Anusuri <vanusuri@mvista.com>
Signed-off-by: Steve Sakoman <steve@sakoman.com>
| -rw-r--r-- | meta/recipes-extended/sudo/files/CVE-2025-32462.patch | 42 | ||||
| -rw-r--r-- | meta/recipes-extended/sudo/sudo_1.9.15p5.bb | 1 |
2 files changed, 43 insertions, 0 deletions
diff --git a/meta/recipes-extended/sudo/files/CVE-2025-32462.patch b/meta/recipes-extended/sudo/files/CVE-2025-32462.patch new file mode 100644 index 0000000000..04610d40fd --- /dev/null +++ b/meta/recipes-extended/sudo/files/CVE-2025-32462.patch | |||
| @@ -0,0 +1,42 @@ | |||
| 1 | From d530367828e3713d09489872743eb92d31fb11ff Mon Sep 17 00:00:00 2001 | ||
| 2 | From: "Todd C. Miller" <Todd.Miller@sudo.ws> | ||
| 3 | Date: Tue, 1 Apr 2025 09:24:51 -0600 | ||
| 4 | Subject: [PATCH] Only allow a remote host to be specified when listing | ||
| 5 | privileges. | ||
| 6 | |||
| 7 | This fixes a bug where a user with sudoers privileges on a different | ||
| 8 | host could execute a command on the local host, even if the sudoers | ||
| 9 | file would not otherwise allow this. CVE-2025-32462 | ||
| 10 | |||
| 11 | Reported by Rich Mirch @ Stratascale Cyber Research Unit (CRU). | ||
| 12 | |||
| 13 | Upstream-Status: Backport [https://github.com/sudo-project/sudo/commit/d530367828e3713d09489872743eb92d31fb11ff] | ||
| 14 | CVE: CVE-2025-32462 | ||
| 15 | Signed-off-by: Vijay Anusuri <vanusuri@mvista.com> | ||
| 16 | --- | ||
| 17 | plugins/sudoers/sudoers.c | 12 ++++++++++++ | ||
| 18 | 1 file changed, 12 insertions(+) | ||
| 19 | |||
| 20 | diff --git a/plugins/sudoers/sudoers.c b/plugins/sudoers/sudoers.c | ||
| 21 | index 70a0c1a528..ad2fa2f61c 100644 | ||
| 22 | --- a/plugins/sudoers/sudoers.c | ||
| 23 | +++ b/plugins/sudoers/sudoers.c | ||
| 24 | @@ -350,6 +350,18 @@ sudoers_check_common(struct sudoers_context *ctx, int pwflag) | ||
| 25 | time_t now; | ||
| 26 | debug_decl(sudoers_check_common, SUDOERS_DEBUG_PLUGIN); | ||
| 27 | |||
| 28 | + /* The user may only specify a host for "sudo -l". */ | ||
| 29 | + if (!ISSET(ctx->mode, MODE_LIST|MODE_CHECK)) { | ||
| 30 | + if (strcmp(ctx->runas.host, ctx->user.host) != 0) { | ||
| 31 | + log_warningx(ctx, SLOG_NO_STDERR|SLOG_AUDIT, | ||
| 32 | + N_("user not allowed to set remote host for command")); | ||
| 33 | + sudo_warnx("%s", | ||
| 34 | + U_("a remote host may only be specified when listing privileges.")); | ||
| 35 | + ret = false; | ||
| 36 | + goto done; | ||
| 37 | + } | ||
| 38 | + } | ||
| 39 | + | ||
| 40 | /* If given the -P option, set the "preserve_groups" flag. */ | ||
| 41 | if (ISSET(ctx->mode, MODE_PRESERVE_GROUPS)) | ||
| 42 | def_preserve_groups = true; | ||
diff --git a/meta/recipes-extended/sudo/sudo_1.9.15p5.bb b/meta/recipes-extended/sudo/sudo_1.9.15p5.bb index 8e542015ad..30860eb75e 100644 --- a/meta/recipes-extended/sudo/sudo_1.9.15p5.bb +++ b/meta/recipes-extended/sudo/sudo_1.9.15p5.bb | |||
| @@ -3,6 +3,7 @@ require sudo.inc | |||
| 3 | SRC_URI = "https://www.sudo.ws/dist/sudo-${PV}.tar.gz \ | 3 | SRC_URI = "https://www.sudo.ws/dist/sudo-${PV}.tar.gz \ |
| 4 | ${@bb.utils.contains('DISTRO_FEATURES', 'pam', '${PAM_SRC_URI}', '', d)} \ | 4 | ${@bb.utils.contains('DISTRO_FEATURES', 'pam', '${PAM_SRC_URI}', '', d)} \ |
| 5 | file://0001-sudo.conf.in-fix-conflict-with-multilib.patch \ | 5 | file://0001-sudo.conf.in-fix-conflict-with-multilib.patch \ |
| 6 | file://CVE-2025-32462.patch \ | ||
| 6 | " | 7 | " |
| 7 | 8 | ||
| 8 | PAM_SRC_URI = "file://sudo.pam" | 9 | PAM_SRC_URI = "file://sudo.pam" |
