Ahtri 12, 10151 Tallinn, Estonia

How to update sudo packages manually to fix the Buffer Overflow vulnerability CVE-2021-3156 (Fix)

How to update sudo packages manually to fix the Buffer Overflow vulnerability CVE-2021-3156?

First, check the version by typing the command

sudo -V

Sudo version 1.8.28

Sudoers policy plugin version 1.8.28

Sudoers file grammar version 46

Sudoers I/O plugin version




sudo -V 1.8.28

Let’s download the sudo packages from the repository manually. We can use either wget or curl -O

Copy the same sudo package from the binary package list based upon the architecture.





I have chosen 64-bit architecture as 32-bit architecture is not supported, anymore.

sudo.ws 1.9.5 link[email protected]:~$

wget https://github.com/sudo-project/sudo/releases/download/SUDO_1_9_5p2/sudo_1.9.5-3_ubu2004_amd64.deb

–2021-01-28 04:01:25–  https://github.com/sudo-project/sudo/releases/download/SUDO_1_9_5p2/sudo_1.9.5-3_ubu2004_amd64.deb

Resolving github.com (github.com)…

Connecting to github.com (github.com)||:443… connected.

HTTP request sent, awaiting response… 302 Found

Location: https://github-production-release-asset-2e65be.s3.amazonaws.com/57972154/7372d180-5fc6-11eb-9b0b-bdf39c9878ad?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAIWNJYAX4CSVEH53A%2F20210128%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20210128T020125Z&X-Amz-Expires=300&X-Amz-Signature=58037eaf865484de576565b64cba531e280c794979888993ad4cba45aff096fc&X-Amz-SignedHeaders=host&actor_id=0&key_id=0&repo_id=57972154&response-content-disposition=attachment%3B%20filename%3Dsudo_1.9.5-3_ubu2004_amd64.deb&response-content-type=application%2Foctet-stream [following]

–2021-01-28 04:01:25–  https://github-production-release-asset-2e65be.s3.amazonaws.com/57972154/7372d180-5fc6-11eb-9b0b-bdf39c9878ad?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAIWNJYAX4CSVEH53A%2F20210128%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20210128T020125Z&X-Amz-Expires=300&X-Amz-Signature=58037eaf865484de576565b64cba531e280c794979888993ad4cba45aff096fc&X-Amz-SignedHeaders=host&actor_id=0&key_id=0&repo_id=57972154&response-content-disposition=attachment%3B%20filename%3Dsudo_1.9.5-3_ubu2004_amd64.deb&response-content-type=application%2Foctet-stream

Resolving github-production-release-asset-2e65be.s3.amazonaws.com (github-production-release-asset-2e65be.s3.amazonaws.com)…

Connecting to github-production-release-asset-2e65be.s3.amazonaws.com (github-production-release-asset-2e65be.s3.amazonaws.com)||:443… connected.

HTTP request sent, awaiting response… 200 OK

Length: 2033160 (1.9M) [application/octet-stream]

Saving to: ‘sudo_1.9.5-3_ubu2004_amd64.deb’

sudo_1.9.5-3_ubu2004_amd64.deb     100%[===============================================================>]   1.94M  2.99MB/s    in 0.6s    

2021-01-28 04:01:26 (2.99 MB/s) – ‘sudo_1.9.5-3_ubu2004_amd64.deb’ saved [2033160/2033160]


sudo -V 1.8.28


Once it is downloaded, ensure it is present in the same directory for easy installation in the next following commands.

We also need to install gdebi to fetch the missing dependencies. If it’s already installed then just run the command. 


gdebi sudo

[email protected]:~#. gdebi sudo_1.9.5-3_ubu2004_amd64.deb 

Reading package lists… Done

Building dependency tree        

Reading state information… Done

Reading state information… Done

Provide limited super-user privileges to specific users

 Sudo is a program designed to allow a sysadmin to give limited root privileges to users and log root activity.

The basic philosophy is to give as few privileges as possible but still allow people to get their work done.

Do you want to install the software package? [y/N]:y

/usr/bin/gdebi:113: FutureWarning: Possible nested set at position 1

  c = findall(“[[(](\S+)/\S+[])]”, msg)[0].lower()

(Reading database … 657947 files and directories currently installed.)

Preparing to unpack sudo_1.9.5-3_ubu2004_amd64.deb …

Unpacking sudo (1.9.5-3) over (1.9.5-3) …

Setting up sudo (1.9.5-3) …

Processing triggers for man-db (2.9.1-1) …

sudo -V 1.9.5p2

We are all set and now let’s upgrade the sudo package to remediate or fix the vulnerability of Linux privilege escalation for unauthorised users.

Finally, we have updated the sudo package from 1.8.28 to 1.9.5p2 by remediating the high severity vulnerability, which is yet to be released/updated in the CVE database.

The CVE number has been assigned CVE-2021-3156. As Ethical Hackers, we are not reliant entirely on CVE databases and use our experience and skills to stay ahead on the cutting edge skills.  



Know more about the vulnerability in this link #Sudo #Flaw Lets #Linux Users #Run Commands As #Root Even When They’re #Restricted https://vapt.me/SudoVuln


Related Posts