title: How can I fix improper Neutralization of Script-Related HTML Tags in a Web Page?
body: <p>We recently run VeraCode and it failed the following method:</p>
  
  <pre><code>static public void WriteTargetAttribute(HtmlTextWriter writer, string targetValue)
      {
          if ((writer != null) &amp;&amp; (!String.IsNullOrEmpty(targetValue)))
          {
  
              if (targetValue.Equals("_blank", StringComparison.OrdinalIgnoreCase))
              {
                  string js = "window.open(this.href, '_blank', ''); return false;";
                  writer.WriteAttribute("onclick", js);
                  writer.WriteAttribute("onkeypress", js);
              }
              else
              {
                  writer.WriteAttribute("target", targetValue);
              }
          }
      }
  </code></pre>
  
  <p>The VeraCode fails on the last line: " writer.WriteAttribute("target", targetValue);"</p>
  
  <p>What can I do to fix it?</p>
  
  <p>Thank's</p>