Note that there are some explanatory texts on larger screens.

plurals
  1. POBuild "exit" page using Classic ASP avoiding major Cross Site Scripting pitfalls
    primarykey
    data
    text
    <p>I'm working on updating a classic ASP web page used by a number of sub-sites maintained at the company I work for.</p> <p>The purpose of the page is to notify the user that they are leaving "our" site and going to another site. It's basically a disclaimer, but due to resource limitations and time limitations I can't add the disclaimer to every site we manage.</p> <p>This is the crux of the problem. The current code pulls a variable from the query string to create the "continue" link in the new window. This obviously creates many problems in the form of cross site scripting.</p> <p>How do I approach this update to eliminate most (if not all) of the cross site scripting issues using vbScript/ASP.</p> <p>The code I'm using is below.</p> <pre><code>&lt;%@ Language = vbScript %&gt; &lt;% Option Explicit %&gt; &lt;% Dim strLink strLink = Request.QueryString("site") strLink = Replace(strLink, "&lt;", "&amp;lt") strLink = Replace(strLink, "&gt;", "&amp;gt;") strLink = Replace(strLink, chr(34), "") strLink = Replace(strLink, "script", "", 1, -1, 1) strLink = Replace(strLink, "onclick", "", 1, -1, 1) strLink = Replace(strLink, "ondblclick", "", 1, -1, 1) strLink = Replace(strLink, "onmousedown", "", 1, -1, 1) strLink = Replace(strLink, "onmouseover", "", 1, -1, 1) strLink = Replace(strLink, "onmousemove", "", 1, -1, 1) strLink = Replace(strLink, "onmouseout", "", 1, -1, 1) strLink = Replace(strLink, "onkeypress", "", 1, -1, 1) strLink = Replace(strLink, "onkeydown", "", 1, -1, 1) strLink = Replace(strLink, "onkeyup", "", 1, -1, 1) strLink = Replace(strLink, "onfocus", "", 1, -1, 1) strLink = Replace(strLink, "onblur", "", 1, -1, 1) strLink = Replace(strLink, "&amp;&amp;", "") strLink = Replace(strLink, "##", "") strLink = Replace(strLink, "&amp;#", "") %&gt; &lt;a href="&lt;%= strLink %&gt;"&gt;Continue&lt;/a&gt; </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload