{"id":384416,"date":"2021-01-28T10:16:17","date_gmt":"2021-01-28T08:16:17","guid":{"rendered":"https:\/\/mybroadband.co.za\/news\/?p=384416"},"modified":"2021-01-28T10:18:52","modified_gmt":"2021-01-28T08:18:52","slug":"bug-in-linux-sudo-command-could-give-any-user-root-access","status":"publish","type":"post","link":"https:\/\/mybroadband.co.za\/news\/security\/384416-bug-in-linux-sudo-command-could-give-any-user-root-access.html","title":{"rendered":"Bug in Linux sudo command could give any user root access"},"content":{"rendered":"<p>Researchers from Qualys have disclosed a vulnerability in the <code>sudo<\/code> utility that could be exploited to grant system administrator privileges to any user that is logged into a system.<\/p>\n<p>Dubbed <strong><a href=\"https:\/\/blog.qualys.com\/vulnerabilities-research\/2021\/01\/26\/cve-2021-3156-heap-based-buffer-overflow-in-sudo-baron-samedit\" target=\"_blank\" rel=\"noopener noreferrer\">Baron Samedit<\/a><\/strong> (<strong><a href=\"https:\/\/cve.mitre.org\/cgi-bin\/cvename.cgi?name=CVE-2021-3156\" target=\"_blank\" rel=\"noopener noreferrer\">CVE-2021-3156<\/a><\/strong>), Qualys recommended that users apply patches for the vulnerability immediately.<\/p>\n<p>The developers of <code>sudo<\/code> were informed about the security flaw on 13 January and the bug was patched on 19 January \u2014 a week before it was publicly disclosed.<\/p>\n<p>Sudo is a widely used program in Unix-like operating systems. Qualys confirmed that the Baron Samedit bug was present in Linux distributions such as Ubuntu, Debian, and Fedora.<\/p>\n<p>&#8220;Other operating systems and distributions are also likely to be exploitable,&#8221; Qualys stated.<\/p>\n<p>The <code>sudo<\/code> utility is intended to allow you to run programs as a different user, especially the &#8220;super user&#8221; or root account, without actually logging in as that user.<\/p>\n<p>It is considered safer to use <code>sudo<\/code> than to allow users to log in as root. Among other things, this guards against users inadvertently running rogue programs with full super user privileges.<\/p>\n<p>The vulnerability in <code>sudo<\/code> was a heap-based buffer overflow that could be exploited by any local user account.<\/p>\n<p>&#8220;Normally, sudo escapes special characters when running a command via a shell (<code>sudo -s<\/code> or <code>sudo -i<\/code>). However, it was also possible to run <code>sudoedit<\/code> with the <strong>-s<\/strong> or <strong>-i<\/strong> flags in which case no escaping had actually been done, making a buffer overflow possible,&#8221; the <strong><a href=\"https:\/\/www.sudo.ws\/stable.html#1.9.5p2\" target=\"_blank\" rel=\"noopener noreferrer\">patch notes<\/a><\/strong> stated.<\/p>\n<p>An attacker does not need to know or crack the user&#8217;s password to exploit this vulnerability. The user account from which the exploit code is executed also does not need to listed in the &#8220;sudoers&#8221; file.<\/p>\n<p>&#8220;Sudoers&#8221; is a special configuration file in which system administrators can set which programs any given user may run as root (or another user). If a user account is not listed in this file, they should essentially not be able to use <code>sudo<\/code>.<\/p>\n<p>The Baron Samedit bug was introduced on 29 July 2011 (<strong><a href=\"https:\/\/github.com\/sudo-project\/sudo\/commit\/8255ed69\" target=\"_blank\" rel=\"noopener noreferrer\">commit 8255ed69<\/a><\/strong>). Qualys noted that it affected all legacy versions of the program from versions 1.8.2 to 1.8.31p2, and all stable versions from versions 1.9.0 to 1.9.5p1 in their default configuration.<\/p>\n<p>To check whether your system is vulnerable to the bug, Qualys said that you can run the following command:<\/p>\n<pre><code class=\"language-shell\" lang=\"shell\">sudoedit -s \/\r\n<\/code><\/pre>\n<p>If the system is vulnerable, it will respond with an error that starts with &#8220;sudoedit:&#8221;<\/p>\n<p>If the system is patched, it will respond with an error that starts with &#8220;usage:&#8221;<\/p>\n<p><iframe loading=\"lazy\" title=\"vimeo-player\" src=\"https:\/\/player.vimeo.com\/video\/504872555\" width=\"640\" height=\"480\" frameborder=\"0\" allowfullscreen=\"allowfullscreen\"><\/iframe><\/p>\n<h3 class=\"my-4\">Now read: <a href=\"https:\/\/mybroadband.co.za\/news\/security\/323374-big-security-flaw-in-linux-sudo-command.html\">Big security flaw in Linux sudo command<\/a><\/h3>\n","protected":false},"excerpt":{"rendered":"<p>Researchers from Qualys have disclosed a vulnerability in the sudo utility that could be exploited to grant system administrator privileges to any user that is logged into a system.<\/p>\n","protected":false},"author":15,"featured_media":384418,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[27],"tags":[2886,7135,1799,7913,40988,68444,967],"class_list":["post-384416","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-security","tag-debian","tag-fedora","tag-linux","tag-qualys-security-labs","tag-security-vulnerability","tag-sudo","tag-ubuntu"],"_links":{"self":[{"href":"https:\/\/mybroadband.co.za\/news\/wp-json\/wp\/v2\/posts\/384416"}],"collection":[{"href":"https:\/\/mybroadband.co.za\/news\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/mybroadband.co.za\/news\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/mybroadband.co.za\/news\/wp-json\/wp\/v2\/users\/15"}],"replies":[{"embeddable":true,"href":"https:\/\/mybroadband.co.za\/news\/wp-json\/wp\/v2\/comments?post=384416"}],"version-history":[{"count":0,"href":"https:\/\/mybroadband.co.za\/news\/wp-json\/wp\/v2\/posts\/384416\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/mybroadband.co.za\/news\/wp-json\/wp\/v2\/media\/384418"}],"wp:attachment":[{"href":"https:\/\/mybroadband.co.za\/news\/wp-json\/wp\/v2\/media?parent=384416"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mybroadband.co.za\/news\/wp-json\/wp\/v2\/categories?post=384416"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mybroadband.co.za\/news\/wp-json\/wp\/v2\/tags?post=384416"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}