sudo upgrade sudo

nurfitri
sudo upgrade sudo

Why upgrade sudo ?

  • recently in 2021, there is a new vulnerability for linux operating system that are caused by vulnerability in sudo commands.
  • it is basically a vulnerability that enable attacker to gain escalated privileges to a root user on linux system.
  • if an attacker can get access to your machine, by exploiting other user vulnerabilities, such as exploiting apache user in your webserver, they can gain root access if they know how to exploit this new sudo vulnerability.
  • this exploit allows attacker to gain root access even though they are not in the sudoers list.
  • I am still noobs in this field, so I will not explain it more.
  • you can read more about it here CVE-2021-3156.

Solution to this problem.

  • for now the solution for this problem is basically upgrade your sudo to a new version.

  • on sudo website there is a recent release that provided patch for this exploit.

  • you can download it here version 1.9.5p2

    as you can see here, I am using the older version, which is vulnerable to this attack, my version is 1.8.31

sudo version 1.8.31

Install and upgrade it.

  • the installation process is actually simple, like installing any other linux software from source.

  • first download the file from sudo website or click here

  • after downloaded, extract the file using tar command.

    tar -xzvf sudo-1.9.5p2.tar.gz
    
    • tar is an archiving utilities used to extract the file,
    • -x param, is to extract
    • -z is to extract the gz or zip extension
    • -v is for verbose
    • -f is to specify the file which is sudo-1.9.5p2.tar.gz.
  • it will extract the file into a folder called sudo-1.9.5p2/

  • cd into that folder using

    cd sudo-1.9.5p2/
    
  • then configure the installation by running ./configure inside that folder.

    ./configure
    
  • after finished the configuration process, we just run make and install it.

    make && sudo make install
    
  • after the installation finished, we need to restart our session, to make use of the latest sudo version.

  • example below shows, after i finished installed it

    results of sudo --version command showing that I've installed newer version of sudo