Vulnerabilidade RCE afeta o popular software StackStorm Automation.

Segundo o especialista, a falha poderia ser explorada por um atacante remoto para induzir os programadores a executar comandos arbitrários em serviços direcionados.

O StackStorm tem sido usado para automatizar fluxos de trabalho em muitos setores, permite que os programdores configurem ações, fluxos de trabalho e tarefas agendadas, para executar algumas operações em servidores de grande escala.

A capacidade do StackStorm de executar ações pode ser utilizada por um atacante remoto com o conhecimento prévio da falha.

“In this blogpost I will describe how can you cause RCE on targeted servers which only requires an authenticated user browse to maliciouswebpage.” reads a blog post published by the expert.

 

A vulnerabilidade vinculou o modo como a API REST do StackStorm manipulou indevidamente cabeçalhos CORS (cross-origin resource sharing), permitindo que os browsers executem solicitações entre domínios em nome de utilizadores/desenvolvedores autenticados.

“As we can see the “Access-Control-Allow-Origin” header returning in each request to StackStorm REST API, even when request not includes the origin header, quite weird butanyway might make sense… ” wrote the expert.

“Then I started to send a malformed Origin header and I realized that the server cant handle it properly, and returning the header “Access-Control-Allow-Origin: null”: “

StackStorm-flaw

O investigador percebeu que a StackStorm API retornava no Access-Control-Allow-Origin um valor nulo se a origem da solicitação fosse desconhecida e a versão anterior à versão 2.10.3 / 2.9.3.

“To simplify, the RFC defines, in case the server got a malformed origin which cannot be serialized, set the string “null” as the Origin header. Now we can understand what is the root cause for all this, that’s makes me laugh a bit because the RFC defines one thing, but Mozilla best practices saying to avoid using it (make sense anyway).” explained the expert.

 

O cabeçalho Access-Control-Allow-Origin permite determinar quais domínios podem acessar os recursos de um website, deixando-os configurados incorretamente para permitir que invasores obtenham acesso aos mesmos recursos.

Para explorar a falha, um invasor precisa apenas enganar as vítimas para que cliquem em um link criado com intuito malicioso, assim ele poderá ler / atualizar / criar ações e fluxos de trabalho, obter IPs internos e executar um comando em cada máquina. que é acessível pelo agente StackStorm.

Tawily relatou os findings para a equipa do StackStorm na semana passada, que rapidamente abordou isso com o lançamento do StackStorm versões 2.9.3 e 2.10.3.

 

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.