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

124
Visualizações
Removing JavaScript from HTML inside an object

Full disclosure: I inherited the code. I was tasked to fix it. After 9 hours, I am turning to you, the hive mind.

Inside an object (response) is response.Object Object contains HTML code.

$("doodah").html(response.Object)

Coverity doesn't like this. It's vulnerable to a DOM XSS attack. Coverity is complaining about how it is vulnerable to an arbitrary JavaScript statement that can taint respose.Object.

So I tried to REGEX it out. No good. .replace(RegEx_Clear_Scipt_Tags) didn't work. I added RegEx to clear Script tags and in-line JavaScript. Coverity does not like this either.

Fine, so I tried a function that puts the code in a DIV, strips out the Script tags through DOM functions and returns the innerHTML

No good. Coverity didn't like that either.

Does anyone have any suggestions?

about 4 years ago · Juan Pablo Isaza
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