Um investigador de segurança descobriu uma vulnerabilidade que permite executar código remoto (RCE) no recurso apt-get.

O investigador Max Justicz, descobriu uma vulnerabilidade RCE (Remote Code Execution) no recurso apt-get que pode ser bem sucedida quando explorada através de um ataque man-in-the-middle e que permite instalar instalar qualquer pacote na máquina alvo com permissões de root.

A falha denominada como CVE-2019-3462 foi corrigida na última versão do apt-get.

Como workaround, o investigador sugero a todos os utilizadores para desabilitar os redirecionamentos HTTP no recurso durante a instalação de um pacote através da opção:

$ sudo apt update -o Acquire::http::AllowRedirect=false
$ sudo apt upgrade -o Acquire::http::AllowRedirect=false

If your current package mirrors redirect by default (meaning you can’t update apt when using that flag) you’ll need to pick different mirrors or download the package directly. Specific instructions for upgrading on Debian can be found hereUbuntu’s announcement can be found here.

 

O investigador publicou o seguinte vídeo como prova de conceito enquanto explorava um Dockerfile.

FROM debian:latest

RUN apt-get update && apt-get install -y cowsay

 

 

Para se manter em segurança, é recomendado que atualize o software do seu computador totalmente atualizado, e nomeadamente o apt-get.

Mais informações sobre a descoberta aqui.

 

Pedro Tavares

Pedro Tavares is a professional in the field of information security working as an Ethical Hacker/Pentester, Malware Researcher and also a Security Evangelist. He is also a founding member at CSIRT.UBI and Editor-in-Chief of the security computer blog seguranca-informatica.pt. In recent years he has invested in the field of information security, exploring and analyzing a wide range of topics, such as pentesting (Kali Linux), malware, exploitation, hacking, IoT and security in Active Directory networks.  He is also Freelance Writer (Infosec. Resources Institute and Cyber Defense Magazine) and developer of the 0xSI_f33d – a feed that compiles phishing and malware campaigns targeting Portuguese citizens. Read more here.