Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

139
Views
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 answers
Answer question

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 Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!