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

129
Visualizações
How to fix XSS vulnerability to JavaScript

I did a vulnerability analysis on the Veracode Platform and found an XSS vulnerability: This is the code that has the vulnerability, I'm trying fix, but I need your help:

<po-widget>
  <div class="po-row">
    <div class="treeview-container po-md-12">
      <kendo-treeview
        class="po-md-12 po-mt-1 po-mb-1"
        kendoTreeViewDragAndDrop
        kendoTreeViewDragAndDropEditing
        kendoTreeViewExpandable
        [expand by]="'id'"
        [(expandedKeys)]="expandedKeys"
        kendoTreeViewHierarchyBinding
        [childrenCampo]="'children'"
        [(nodes)]="treeviewItems"
        [textField]="'name'"
        kendoTreeViewSelectable
        [(selectedKeys)]="selectedKeys"
        (nodeDrop)="handleDrop($event)"
        (removeItem)="handleRemovedNode()"
        (selectionChange)="handleSelection($event)" // <==== XSS vulnerability here
        [selectBy]="'id'"
        [isSelected]="isItemSelected"
      >

The line (selectionChange)= "handleSelection($event)" is vulnerable by the Platform.

My suggestion to fix the vulnerability is:

(selectionChange)= XSSfix("handleSelection($event)")

 function XSSfix(inputXSS){

        return inputXSS.replace(/\&/g, '&amp;').replace(/\</g, '&lt;').replace(/\>/g, '&gt;');
    }

What do you think? Is this solution correct? It's work to fix vulnerability?

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