Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

213
Visualizações
Checkmarx says document.url is unsafe

We have a potential XSS warning on this code:

if (someCondition) {
    //location.reload();
    window.location = document.URL;
}

The message is:

The application's FunctionName embeds untrusted data in the generated output with location, at line 433 of Directory\CodeFile.js. This untrusted data is embedded straight into the output without proper sanitization or encoding, enabling an attacker to inject malicious code into the output.

Is there any actual vulnerability here (and if yes, what should we use instead, knowing that location.reload() wasn't satisfying?), or should I simply flag this as Not Exploitable and move on?

about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

URL escape the document.URL before passing the value to window.location

if (someCondition) {
    location.href = encodeURIComponent(document.URL);
}
about 4 years ago · Juan Pablo Isaza Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda