{"id":120608,"date":"2024-11-20T01:09:18","date_gmt":"2024-11-19T23:09:18","guid":{"rendered":"https:\/\/prohoster.info\/blog\/novosti-interneta\/uyazvimosti-v-utilite-needrestart-pozvolyayushhie-poluchit-root-dostup-v-ubuntu-server"},"modified":"2024-11-20T01:09:18","modified_gmt":"2024-11-19T23:09:18","slug":"uyazvimosti-v-utilite-needrestart-pozvolyayushhie-poluchit-root-dostup-v-ubuntu-server","status":"publish","type":"post","link":"https:\/\/prohoster.info\/pt\/blog\/news\/uyazvimosti-v-utilite-needrestart-pozvolyayushhie-poluchit-root-dostup-v-ubuntu-server","title":{"rendered":"Vulnerabilidades na ferramenta needrestart permitem obten\u00e7\u00e3o de acesso root no Ubuntu Server.","gt_translate_keys":[{"key":"rendered","format":"text"}]},"content":{"rendered":"<p>A empresa Qualys identificou tr\u00eas vulnerabilidades na ferramenta needrestart, que \u00e9 projetada para reiniciar processos em segundo plano ap\u00f3s a atualiza\u00e7\u00e3o das bibliotecas utilizadas por esses processos. A partir do Ubuntu 21.04, a ferramenta needrestart est\u00e1 inclu\u00edda no ambiente base do Ubuntu Server, sendo executada com privil\u00e9gios de root ao final de cada transa\u00e7\u00e3o do gerenciador de pacotes APT, escaneando processos em execu\u00e7\u00e3o e reiniciando aqueles que est\u00e3o relacionados a arquivos que foram alterados ap\u00f3s a atualiza\u00e7\u00e3o dos pacotes. As vulnerabilidades descobertas permitem que um usu\u00e1rio local n\u00e3o privilegiado obtenha direitos de root em uma configura\u00e7\u00e3o padr\u00e3o do Ubuntu Server.      <\/p>\n<p>Vulnerabilidades est\u00e3o presentes no needrestart a partir da vers\u00e3o 0.8 (2014) e foram corrigidas na vers\u00e3o 3.8 do needrestart. Os problemas tamb\u00e9m j\u00e1 foram resolvidos nas distribui\u00e7\u00f5es Debian e Ubuntu. Como uma medida de conten\u00e7\u00e3o para bloquear a explora\u00e7\u00e3o da vulnerabilidade, \u00e9 poss\u00edvel desativar a verifica\u00e7\u00e3o de interpretadores, configurando no arquivo de configura\u00e7\u00e3o \/etc\/needrestart\/needrestart.conf o par\u00e2metro \"$nrconf{interpscan} = 0$\".      <\/p>\n<p>As vulnerabilidades est\u00e3o presentes no c\u00f3digo que implementa o modo de identifica\u00e7\u00e3o de atualiza\u00e7\u00e3o de scripts executados usando interpretadores. Os problemas identificados s\u00e3o:  <\/p>\n<ul>\n<li class=\"l\"> CVE-2024-48990 \u2014 um usu\u00e1rio local pode obter a execu\u00e7\u00e3o de c\u00f3digo com privil\u00e9gios de root ao criar condi\u00e7\u00f5es para executar o interpretador Python com a vari\u00e1vel de ambiente PYTHONPATH configurada pelo atacante. Al\u00e9m do uso do Python, o ataque tamb\u00e9m pode ser realizado (CVE-2024-48992) ao iniciar o interpretador Ruby com a vari\u00e1vel de ambiente RUBYLIB.\n<p>As vulnerabilidades s\u00e3o causadas pelo fato de que, durante o rein\u00edcio de um script modificado, a ferramenta needrestart define a vari\u00e1vel de ambiente PYTHONPATH com base no conte\u00fado do arquivo \/proc\/pid\/environ, que \u00e9 ent\u00e3o usada para executar seu pr\u00f3prio c\u00f3digo Python. Dessa forma, o atacante pode aguardar uma atividade relacionada ao gerenciador de pacotes APT, simular uma altera\u00e7\u00e3o em seu script e definir a vari\u00e1vel de ambiente PYTHONPATH, que tamb\u00e9m ser\u00e1 aplicada ao executar o c\u00f3digo Python embutido no needrestart (\"import sys\n print(sys.path)\"), executado com privil\u00e9gios de root.    <\/p>\n<p>Por exemplo, para explorar a vulnerabilidade, pode-se iniciar um processo Python que permanece ativo na mem\u00f3ria, configurando a vari\u00e1vel de ambiente \"PYTHONPATH=\/home\/test\", e colocar a biblioteca compartilhada \"~\/home\/test\/importlib\/__init__.so\", que ser\u00e1 executada ao rodar o c\u00f3digo Python privilegiado no needrestart.           <\/p>\n<li class=\"l\"> CVE-2024-48991 \u2014 um usu\u00e1rio local pode conseguir executar c\u00f3digo com privil\u00e9gios de root ao iniciar uma condi\u00e7\u00e3o de corrida, na qual o needrestart iniciar\u00e1 um interpretador Python fict\u00edcio definido pelo atacante, em vez do interpretador do sistema. A ess\u00eancia da vulnerabilidade \u00e9 semelhante ao problema mencionado acima, mas a diferen\u00e7a \u00e9 que o needrestart identifica o nome do processo Python (por exemplo, \/usr\/bin\/python3) por meio da leitura de \"\/proc\/pid\/exe\".\n<p>Para explorar a vulnerabilidade, pode-se criar um processo \/home\/test\/race, que, atrav\u00e9s do mecanismo inotify, aguardar\u00e1 o momento em que o needrestart come\u00e7ar a ler o conte\u00fado de \/proc\/pid\/exe, e imediatamente iniciar\u00e1 o interpretador Python do sistema atrav\u00e9s da fun\u00e7\u00e3o execve. Como o needrestart n\u00e3o verifica se este \u00e9 realmente o Python, ele considerar\u00e1 que \/home\/test\/race \u00e9 o interpretador Python e o executar\u00e1 para seu c\u00f3digo.         <\/p>\n<li class=\"l\"> CVE-2024-11003 \u2014 um usu\u00e1rio local pode executar comandos shell arbitr\u00e1rios com privil\u00e9gios de root ao criar condi\u00e7\u00f5es para processamento no needrestart de nomes de arquivos no formato \"comando|\", cuja passagem para a fun\u00e7\u00e3o Perl open() resulta na execu\u00e7\u00e3o do comando. A vulnerabilidade, na verdade, se manifesta no m\u00f3dulo Perl ScanDeps (CVE-2024-10224), mas \u00e9 provocada pela passagem de par\u00e2metros externos para esse m\u00f3dulo sem a devida verifica\u00e7\u00e3o.\n<p>O ataque pode ser realizado ao executar um script Perl com o s\u00edmbolo \"|\" no nome, por exemplo, \"\/home\/test\/perl|\". Durante a execu\u00e7\u00e3o da fun\u00e7\u00e3o scan_deps() no needrestart, este arquivo ser\u00e1 aberto pela fun\u00e7\u00e3o open(), que interpretar\u00e1 o s\u00edmbolo \"|\" como um sinal para executar o programa \"\/home\/test\/perl\" e utilizar\u00e1 o fluxo de sa\u00edda gerado por este programa.                 <\/ul>\n<p>Fonte: <a content=\"nofollow\" rel=\"nofollow\" href=\"https:\/\/www.opennet.ru\/opennews\/art.shtml?num=62261\">opennet.ru<\/a> <\/p>","protected":false,"gt_translate_keys":[{"key":"rendered","format":"html"}]},"excerpt":{"rendered":"<p>\u041a\u043e\u043c\u043f\u0430\u043d\u0438\u044f Qualys \u0432\u044b\u044f\u0432\u0438\u043b\u0430 \u0442\u0440\u0438 \u0443\u044f\u0437\u0432\u0438\u043c\u043e\u0441\u0442\u0438 \u0432 \u0443\u0442\u0438\u043b\u0438\u0442\u0435 needrestart, \u043f\u0440\u0435\u0434\u043d\u0430\u0437\u043d\u0430\u0447\u0435\u043d\u043d\u043e\u0439 \u0434\u043b\u044f \u043f\u0435\u0440\u0435\u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u0444\u043e\u043d\u043e\u0432\u044b\u0445 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0432 \u043f\u043e\u0441\u043b\u0435 \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u044b\u0445 \u0434\u0430\u043d\u043d\u044b\u043c\u0438 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0430\u043c\u0438 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a. \u041d\u0430\u0447\u0438\u043d\u0430\u044f \u0441 Ubuntu 21.04 \u0443\u0442\u0438\u043b\u0438\u0442\u0430 needrestart \u0432\u043a\u043b\u044e\u0447\u0435\u043d\u0430 \u0432 \u0441\u043e\u0441\u0442\u0430\u0432 \u0431\u0430\u0437\u043e\u0432\u043e\u0433\u043e \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u044f Ubuntu Server, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u0442\u0441\u044f \u0441 \u043f\u0440\u0430\u0432\u0430\u043c\u0438 root \u0432 \u043a\u043e\u043d\u0446\u0435 \u043a\u0430\u0436\u0434\u043e\u0439 \u0442\u0440\u0430\u043d\u0437\u0430\u043a\u0446\u0438\u0438 \u043f\u0430\u043a\u0435\u0442\u043d\u043e\u0433\u043e \u043c\u0435\u043d\u0435\u0434\u0436\u0435\u0440\u0430 APT, \u0441\u043a\u0430\u043d\u0438\u0440\u0443\u0435\u0442 \u0437\u0430\u043f\u0443\u0449\u0435\u043d\u043d\u044b\u0435 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u044b \u0438 \u043f\u0435\u0440\u0435\u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u0442 \u0442\u0435 \u0438\u0445 \u043d\u0438\u0445, \u0447\u0442\u043e \u0441\u0432\u044f\u0437\u0430\u043d\u043d\u044b [&hellip;]<\/p>\n","protected":false,"gt_translate_keys":[{"key":"rendered","format":"html"}]},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[702],"tags":[],"class_list":["post-120608","post","type-post","status-publish","format-standard","hentry","category-news"],"aioseo_notices":[],"aioseo_head":"\n\t\t<!-- All in One SEO 5.0.3 - aioseo.com -->\n\t<meta name=\"description\" content=\"\u041a\u043e\u043c\u043f\u0430\u043d\u0438\u044f Qualys \u0432\u044b\u044f\u0432\u0438\u043b\u0430 \u0442\u0440\u0438 \u0443\u044f\u0437\u0432\u0438\u043c\u043e\u0441\u0442\u0438 \u0432 \u0443\u0442\u0438\u043b\u0438\u0442\u0435 needrestart, \u043f\u0440\u0435\u0434\u043d\u0430\u0437\u043d\u0430\u0447\u0435\u043d\u043d\u043e\u0439 \u0434\u043b\u044f \u043f\u0435\u0440\u0435\u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u0444\u043e\u043d\u043e\u0432\u044b\u0445 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0432 \u043f\u043e\u0441\u043b\u0435 \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u044b\u0445 \u0434\u0430\u043d\u043d\u044b\u043c\u0438 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0430\u043c\u0438 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a.\" \/>\n\t<meta name=\"robots\" content=\"max-image-preview:large\" \/>\n\t<meta name=\"author\" content=\"Yuri Gagarin\"\/>\n\t<link rel=\"canonical\" href=\"https:\/\/prohoster.info\/pt\/blog\/news\/uyazvimosti-v-utilite-needrestart-pozvolyayushhie-poluchit-root-dostup-v-ubuntu-server\" \/>\n\t\t<meta name=\"generator\" content=\"All in One SEO (AIOSEO) 5.0.3\" \/>\n\t\t<meta property=\"og:locale\" content=\"pt_PT\" \/>\n\t\t<meta property=\"og:site_name\" content=\"ProHoster | \u041a\u0443\u043f\u0438\u0442\u044c \u043d\u0430\u0434\u0435\u0436\u043d\u044b\u0439 \u0445\u043e\u0441\u0442\u0438\u043d\u0433 \u0434\u043b\u044f \u0441\u0430\u0439\u0442\u043e\u0432 \u0441 \u0437\u0430\u0449\u0438\u0442\u043e\u0439 \u043e\u0442 DDoS, VPS VDS \u0441\u0435\u0440\u0432\u0435\u0440\u044b\" \/>\n\t\t<meta property=\"og:type\" content=\"article\" \/>\n\t\t<meta property=\"og:title\" content=\"\ud83e\udd47\u0423\u044f\u0437\u0432\u0438\u043c\u043e\u0441\u0442\u0438 \u0432 \u0443\u0442\u0438\u043b\u0438\u0442\u0435 needrestart, \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u044e\u0449\u0438\u0435 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c root-\u0434\u043e\u0441\u0442\u0443\u043f \u0432 Ubuntu Server | ProHoster\" \/>\n\t\t<meta property=\"og:description\" content=\"\u041a\u043e\u043c\u043f\u0430\u043d\u0438\u044f Qualys \u0432\u044b\u044f\u0432\u0438\u043b\u0430 \u0442\u0440\u0438 \u0443\u044f\u0437\u0432\u0438\u043c\u043e\u0441\u0442\u0438 \u0432 \u0443\u0442\u0438\u043b\u0438\u0442\u0435 needrestart, \u043f\u0440\u0435\u0434\u043d\u0430\u0437\u043d\u0430\u0447\u0435\u043d\u043d\u043e\u0439 \u0434\u043b\u044f \u043f\u0435\u0440\u0435\u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u0444\u043e\u043d\u043e\u0432\u044b\u0445 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0432 \u043f\u043e\u0441\u043b\u0435 \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u044b\u0445 \u0434\u0430\u043d\u043d\u044b\u043c\u0438 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0430\u043c\u0438 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a.\" \/>\n\t\t<meta property=\"og:url\" content=\"https:\/\/prohoster.info\/pt\/blog\/news\/uyazvimosti-v-utilite-needrestart-pozvolyayushhie-poluchit-root-dostup-v-ubuntu-server\" \/>\n\t\t<meta property=\"og:image\" content=\"https:\/\/prohoster.info\/wp-content\/uploads\/2021\/11\/logo-350.jpg\" \/>\n\t\t<meta property=\"og:image:secure_url\" content=\"https:\/\/prohoster.info\/wp-content\/uploads\/2021\/11\/logo-350.jpg\" \/>\n\t\t<meta property=\"og:image:width\" content=\"350\" \/>\n\t\t<meta property=\"og:image:height\" content=\"350\" \/>\n\t\t<meta property=\"article:published_time\" content=\"2024-11-19T23:09:18+00:00\" \/>\n\t\t<meta property=\"article:modified_time\" content=\"2024-11-19T23:09:18+00:00\" \/>\n\t\t<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/prohoster\" \/>\n\t\t<meta property=\"article:author\" content=\"https:\/\/www.facebook.com\/prohoster\" \/>\n\t\t<!-- All in One SEO -->\n\n","aioseo_head_json":{"title":"\ud83e\udd47Vulnerabilidades na ferramenta needrestart que permitem obter acesso root no Ubuntu Server | ProHoster","description":"A Qualys identificou tr\u00eas vulnerabilidades na ferramenta needrestart, destinada a reiniciar processos em segundo plano ap\u00f3s a atualiza\u00e7\u00e3o das bibliotecas utilizadas por esses processos.","canonical_url":"https:\/\/prohoster.info\/pt\/blog\/news\/uyazvimosti-v-utilite-needrestart-pozvolyayushhie-poluchit-root-dostup-v-ubuntu-server","robots":"max-image-preview:large","keywords":"","webmasterTools":{"miscellaneous":""},"schema":null,"og:locale":"pt_PT","og:site_name":"ProHoster | \u041a\u0443\u043f\u0438\u0442\u044c \u043d\u0430\u0434\u0435\u0436\u043d\u044b\u0439 \u0445\u043e\u0441\u0442\u0438\u043d\u0433 \u0434\u043b\u044f \u0441\u0430\u0439\u0442\u043e\u0432 \u0441 \u0437\u0430\u0449\u0438\u0442\u043e\u0439 \u043e\u0442 DDoS, VPS VDS \u0441\u0435\u0440\u0432\u0435\u0440\u044b","og:type":"article","og:title":"\ud83e\udd47\u0423\u044f\u0437\u0432\u0438\u043c\u043e\u0441\u0442\u0438 \u0432 \u0443\u0442\u0438\u043b\u0438\u0442\u0435 needrestart, \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u044e\u0449\u0438\u0435 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c root-\u0434\u043e\u0441\u0442\u0443\u043f \u0432 Ubuntu Server | ProHoster","og:description":"\u041a\u043e\u043c\u043f\u0430\u043d\u0438\u044f Qualys \u0432\u044b\u044f\u0432\u0438\u043b\u0430 \u0442\u0440\u0438 \u0443\u044f\u0437\u0432\u0438\u043c\u043e\u0441\u0442\u0438 \u0432 \u0443\u0442\u0438\u043b\u0438\u0442\u0435 needrestart, \u043f\u0440\u0435\u0434\u043d\u0430\u0437\u043d\u0430\u0447\u0435\u043d\u043d\u043e\u0439 \u0434\u043b\u044f \u043f\u0435\u0440\u0435\u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u0444\u043e\u043d\u043e\u0432\u044b\u0445 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0432 \u043f\u043e\u0441\u043b\u0435 \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u044b\u0445 \u0434\u0430\u043d\u043d\u044b\u043c\u0438 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0430\u043c\u0438 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a.","og:url":"https:\/\/prohoster.info\/pt\/blog\/news\/uyazvimosti-v-utilite-needrestart-pozvolyayushhie-poluchit-root-dostup-v-ubuntu-server","og:image":"https:\/\/prohoster.info\/wp-content\/uploads\/2021\/11\/logo-350.jpg","og:image:secure_url":"https:\/\/prohoster.info\/wp-content\/uploads\/2021\/11\/logo-350.jpg","og:image:width":350,"og:image:height":350,"article:published_time":"2024-11-19T23:09:18+00:00","article:modified_time":"2024-11-19T23:09:18+00:00","article:publisher":"https:\/\/www.facebook.com\/prohoster","article:author":"https:\/\/www.facebook.com\/prohoster"},"aioseo_meta_data":{"post_id":"120608","title":null,"description":null,"keywords":null,"keyphrases":null,"primary_term":null,"canonical_url":null,"og_title":null,"og_description":null,"og_object_type":"default","og_image_type":"default","og_image_url":null,"og_image_width":null,"og_image_height":null,"og_image_custom_url":null,"og_image_custom_fields":null,"og_video":null,"og_custom_url":null,"og_article_section":null,"og_article_tags":null,"twitter_use_og":false,"twitter_card":"default","twitter_image_type":"default","twitter_image_url":null,"twitter_image_custom_url":null,"twitter_image_custom_fields":null,"twitter_title":null,"twitter_description":null,"schema":{"blockGraphs":[],"customGraphs":[],"default":{"data":{"Article":[],"Course":[],"Dataset":[],"FAQPage":[],"Movie":[],"Person":[],"Product":[],"ProductReview":[],"Car":[],"Recipe":[],"Service":[],"SoftwareApplication":[],"WebPage":[]},"graphName":"","isEnabled":true},"graphs":[]},"schema_type":"default","schema_type_options":null,"pillar_content":false,"robots_default":true,"robots_noindex":false,"robots_noarchive":false,"robots_nosnippet":false,"robots_nofollow":false,"robots_noimageindex":false,"robots_noodp":false,"robots_notranslate":false,"robots_max_snippet":null,"robots_max_videopreview":null,"robots_max_imagepreview":"large","priority":null,"frequency":null,"local_seo":null,"seo_analyzer_scan_date":"2026-01-23 08:09:19","breadcrumb_settings":null,"limit_modified_date":false,"reviewed_by":null,"ai":null,"created":"2026-01-23 08:09:19","updated":"2026-01-23 08:09:19","focus_keyword":null,"additional_keywords":null,"truseo_locale":null},"gt_translate_keys":[{"key":"link","format":"url"}],"_links":{"self":[{"href":"https:\/\/prohoster.info\/pt\/wp-json\/wp\/v2\/posts\/120608","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/prohoster.info\/pt\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/prohoster.info\/pt\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/prohoster.info\/pt\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/prohoster.info\/pt\/wp-json\/wp\/v2\/comments?post=120608"}],"version-history":[{"count":0,"href":"https:\/\/prohoster.info\/pt\/wp-json\/wp\/v2\/posts\/120608\/revisions"}],"wp:attachment":[{"href":"https:\/\/prohoster.info\/pt\/wp-json\/wp\/v2\/media?parent=120608"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/prohoster.info\/pt\/wp-json\/wp\/v2\/categories?post=120608"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/prohoster.info\/pt\/wp-json\/wp\/v2\/tags?post=120608"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}