O HCS (Windows Host Compute Service) é uma API de para gestão de containers de baixo nível no Hyper-V, e a Microsoft implementou dois wrappers de código-fonte aberto para invocar funções do HCS usando linguagens de programação de nível superior.
O wrapper Shim do Windows Host Compute Service, lançado em janeiro de 2017, permite lançar containers do Windows Server a partir através da linguagem de programação Go.
“We’ve released two wrappers thus far. One is written in Go (and used by Docker), and the other is written in C#.” reads a blog post published by Microsoft.
“You can find the wrappers here:
- https://github.com/microsoft/dotnet-computevirtualization
- https://github.com/microsoft/hcsshim“
O especialista em segurança Michael Hanselmann descobriu que o hcsshim falha ao validar corretamente a entrada ao importar uma imagem do container. A vulnerabilidade, identificada como CVE-2018-8115, poderia ser explorada por um hacker de forma a executar código remoto e arbitrário no sistema operativo do host.
“A remote code execution vulnerability exists when the Windows Host Compute Service Shim (hcsshim) library fails to properly validate input while importing a container image.” reads the security advisory published by Microsoft.
“To exploit the vulnerability, an attacker would place malicious code in a specially crafted container image which, if an authenticated administrator imported (pulled), could cause a container management service utilizing the Host Compute Service Shim library to execute malicious code on the Windows host.”
Embora a US-CERT tenha lançado um alerta solicitando a atualização da biblioteca, a Microsoft tentou minimizar o problema, explicando que é improvável que a falha possa ser explorada de forma devastadora.
Microsoft addressed the vulnerability with the out-of-band update hcsshim 0.6.10 that is available on GitHub.
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.