CVE-2022-39245 (published 2022-09-26T14:15Z)

Mist is the command-line interface for the makedeb Package Repository. Prior to version 0.9.5, a user-provided `sudo` binary via the `PATH` variable can allow a local user to run arbitrary commands on the user's system with root permissions. Versions 0.9.5 and later contain a patch. No known workarounds exist.

CVSS v3 base score: 7.8, HIGH (CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H)

Weakness information:
cwe_id: CWE-426
cwe_name: Untrusted Search Path
description: The product searches for critical resources using an externally-supplied search path that can point to resources that are not under the product's direct control.
extended_description: 
            This might allow attackers to execute their own programs, access unauthorized data files, or modify configuration in unexpected ways. If the product uses a search path to locate critical resources such as programs, then an attacker could modify that search path to point to a malicious program, which the targeted product would then execute. The problem extends to any type of critical resource that the product trusts.
            Some of the most common variants of untrusted search path are:
               
                  In various UNIX and Linux-based systems, the PATH environment variable may be consulted to locate executable programs, and LD_PRELOAD may be used to locate a separate library.
                  In various Microsoft-based systems, the PATH environment variable is consulted to locate a DLL, if the DLL is not found in other paths that appear earlier in the search order.
               
         
         

Fix information:
repo_url: https://github.com/makedeb/mist
commit_details: repo_url: https://github.com/makedeb/mist
author: Hunter Wittenborn
author_date: 2022-09-25 23:58:44-05:00
msg: Ensure 'sudo' binary used for permission checks isn't user supplied
repository: repo_url: https://github.com/makedeb/mist
repo_name: makedeb/mist
description: The official command-line interface for the makedeb Package Repository
repo_language: Rust
owner: makedeb
file_changes: filename: CHANGELOG.md
change_type: ModificationType.MODIFY
diff: @@ -6,6 +6,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
 
 ## [Unreleased]
 
+## [0.9.5] - 2022-09-25
+### Security
+- Ensure `sudo` binary used for permission checks isn't one supplied by the user in the `PATH` variable.
+
 ## [0.9.4] - 2022-09-25
 ### Fixed
 - Ensure cache directories exist before they're used.

programming_language: Markdown
filename: Cargo.lock
change_type: ModificationType.MODIFY
diff: @@ -863,7 +863,7 @@ dependencies = [
 
 [[package]]
 name = "mist"
-version = "0.9.4"
+version = "0.9.5"
 dependencies = [
  "bat",
  "chrono",

programming_language: PowerShell
filename: Cargo.toml
change_type: ModificationType.MODIFY
diff: @@ -1,6 +1,6 @@
 [package]
 name = "mist"
-version = "0.9.4"
+version = "0.9.5"
 authors = ["Hunter Wittenborn <hunter@hunterwittenborn.com"]
 description = "The official command-line interface for the makedeb Package Repository"
 edition = "2021"

programming_language: Lua
filename: PKGBUILD
change_type: ModificationType.MODIFY
diff: @@ -4,7 +4,7 @@
 # `-H 'MPR-Package: yes'` to your `makedeb` call if you want Mist to be able to
 # automatically update itself.
 pkgname=mist
-pkgver=0.9.4
+pkgver=0.9.5
 pkgrel=1
 pkgdesc='The official command-line interface for the makedeb Package Repository'
 arch=('any')

programming_language: Shell
filename: util.rs
change_type: ModificationType.MODIFY
diff: @@ -335,7 +335,7 @@ pub mod sudo {
     pub fn check_perms() {
         super::message::info("Obtaining root permissions...\n");
 
-        let mut cmd = self::run_as_normal_user("sudo");
+        let mut cmd = self::run_as_normal_user("/usr/bin/sudo");
         cmd.arg("true");
 
         if !cmd.spawn().unwrap().wait().unwrap().success() {
@@ -351,7 +351,7 @@ pub mod sudo {
 
     // Run a command as the normal user declared by [`NORMAL_UID`].
     pub fn run_as_normal_user<P: AsRef<super::OsStr>>(program: P) -> super::ProcCommand {
-        let mut cmd = super::ProcCommand::new("sudo");
+        let mut cmd = super::ProcCommand::new("/usr/bin/sudo");
         cmd.args(["-E", "-n"]);
         cmd.arg(format!("-u#{}", *self::NORMAL_UID));
         cmd.arg("--");

programming_language: Rust