MIME-Version: 1.0
Content-Type: multipart/related; boundary="----=_NextPart_01CAF0E9.D7984FD0"

This document is a Single File Web Page, also known as a Web Archive file.  If you are seeing this message, your browser or editor doesn't support Web Archive files.  Please download a browser that supports Web Archive, such as Windows® Internet Explorer®.

------=_NextPart_01CAF0E9.D7984FD0
Content-Location: file:///C:/486BB0C5/practice.htm
Content-Transfer-Encoding: quoted-printable
Content-Type: text/html; charset="us-ascii"

<html xmlns:v=3D"urn:schemas-microsoft-com:vml"
xmlns:o=3D"urn:schemas-microsoft-com:office:office"
xmlns:w=3D"urn:schemas-microsoft-com:office:word"
xmlns:m=3D"http://schemas.microsoft.com/office/2004/12/omml"
xmlns=3D"http://www.w3.org/TR/REC-html40">

<head>
<meta http-equiv=3DContent-Type content=3D"text/html; charset=3Dus-ascii">
<meta name=3DProgId content=3DWord.Document>
<meta name=3DGenerator content=3D"Microsoft Word 12">
<meta name=3DOriginator content=3D"Microsoft Word 12">
<link rel=3DFile-List href=3D"practice_files/filelist.xml">
<!--[if gte mso 9]><xml>
 <o:DocumentProperties>
  <o:Author>manorji</o:Author>
  <o:LastAuthor>manorji</o:LastAuthor>
  <o:Revision>4</o:Revision>
  <o:TotalTime>1219</o:TotalTime>
  <o:Created>2010-05-11T12:56:00Z</o:Created>
  <o:LastSaved>2010-05-11T13:10:00Z</o:LastSaved>
  <o:Pages>3</o:Pages>
  <o:Words>2098</o:Words>
  <o:Characters>11965</o:Characters>
  <o:Lines>99</o:Lines>
  <o:Paragraphs>28</o:Paragraphs>
  <o:CharactersWithSpaces>14035</o:CharactersWithSpaces>
  <o:Version>12.00</o:Version>
 </o:DocumentProperties>
</xml><![endif]-->
<link rel=3DthemeData href=3D"practice_files/themedata.thmx">
<link rel=3DcolorSchemeMapping href=3D"practice_files/colorschememapping.xm=
l">
<!--[if gte mso 9]><xml>
 <w:WordDocument>
  <w:DisplayBackgroundShape/>
  <w:SpellingState>Clean</w:SpellingState>
  <w:GrammarState>Clean</w:GrammarState>
  <w:TrackMoves>false</w:TrackMoves>
  <w:TrackFormatting/>
  <w:PunctuationKerning/>
  <w:DrawingGridHorizontalSpacing>5.5 pt</w:DrawingGridHorizontalSpacing>
  <w:DisplayHorizontalDrawingGridEvery>2</w:DisplayHorizontalDrawingGridEve=
ry>
  <w:ValidateAgainstSchemas/>
  <w:SaveIfXMLInvalid>false</w:SaveIfXMLInvalid>
  <w:IgnoreMixedContent>false</w:IgnoreMixedContent>
  <w:AlwaysShowPlaceholderText>false</w:AlwaysShowPlaceholderText>
  <w:DoNotPromoteQF/>
  <w:LidThemeOther>EN-US</w:LidThemeOther>
  <w:LidThemeAsian>X-NONE</w:LidThemeAsian>
  <w:LidThemeComplexScript>X-NONE</w:LidThemeComplexScript>
  <w:Compatibility>
   <w:BreakWrappedTables/>
   <w:SnapToGridInCell/>
   <w:WrapTextWithPunct/>
   <w:UseAsianBreakRules/>
   <w:DontGrowAutofit/>
   <w:SplitPgBreakAndParaMark/>
   <w:DontVertAlignCellWithSp/>
   <w:DontBreakConstrainedForcedTables/>
   <w:DontVertAlignInTxbx/>
   <w:Word11KerningPairs/>
   <w:CachedColBalance/>
  </w:Compatibility>
  <w:BrowserLevel>MicrosoftInternetExplorer4</w:BrowserLevel>
  <m:mathPr>
   <m:mathFont m:val=3D"Cambria Math"/>
   <m:brkBin m:val=3D"before"/>
   <m:brkBinSub m:val=3D"&#45;-"/>
   <m:smallFrac m:val=3D"off"/>
   <m:dispDef/>
   <m:lMargin m:val=3D"0"/>
   <m:rMargin m:val=3D"0"/>
   <m:defJc m:val=3D"centerGroup"/>
   <m:wrapIndent m:val=3D"1440"/>
   <m:intLim m:val=3D"subSup"/>
   <m:naryLim m:val=3D"undOvr"/>
  </m:mathPr></w:WordDocument>
</xml><![endif]--><!--[if gte mso 9]><xml>
 <w:LatentStyles DefLockedState=3D"false" DefUnhideWhenUsed=3D"true"
  DefSemiHidden=3D"true" DefQFormat=3D"false" DefPriority=3D"99"
  LatentStyleCount=3D"267">
  <w:LsdException Locked=3D"false" Priority=3D"0" SemiHidden=3D"false"
   UnhideWhenUsed=3D"false" QFormat=3D"true" Name=3D"Normal"/>
  <w:LsdException Locked=3D"false" Priority=3D"9" SemiHidden=3D"false"
   UnhideWhenUsed=3D"false" QFormat=3D"true" Name=3D"heading 1"/>
  <w:LsdException Locked=3D"false" Priority=3D"9" QFormat=3D"true" Name=3D"=
heading 2"/>
  <w:LsdException Locked=3D"false" Priority=3D"9" QFormat=3D"true" Name=3D"=
heading 3"/>
  <w:LsdException Locked=3D"false" Priority=3D"9" QFormat=3D"true" Name=3D"=
heading 4"/>
  <w:LsdException Locked=3D"false" Priority=3D"9" QFormat=3D"true" Name=3D"=
heading 5"/>
  <w:LsdException Locked=3D"false" Priority=3D"9" QFormat=3D"true" Name=3D"=
heading 6"/>
  <w:LsdException Locked=3D"false" Priority=3D"9" QFormat=3D"true" Name=3D"=
heading 7"/>
  <w:LsdException Locked=3D"false" Priority=3D"9" QFormat=3D"true" Name=3D"=
heading 8"/>
  <w:LsdException Locked=3D"false" Priority=3D"9" QFormat=3D"true" Name=3D"=
heading 9"/>
  <w:LsdException Locked=3D"false" Priority=3D"39" Name=3D"toc 1"/>
  <w:LsdException Locked=3D"false" Priority=3D"39" Name=3D"toc 2"/>
  <w:LsdException Locked=3D"false" Priority=3D"39" Name=3D"toc 3"/>
  <w:LsdException Locked=3D"false" Priority=3D"39" Name=3D"toc 4"/>
  <w:LsdException Locked=3D"false" Priority=3D"39" Name=3D"toc 5"/>
  <w:LsdException Locked=3D"false" Priority=3D"39" Name=3D"toc 6"/>
  <w:LsdException Locked=3D"false" Priority=3D"39" Name=3D"toc 7"/>
  <w:LsdException Locked=3D"false" Priority=3D"39" Name=3D"toc 8"/>
  <w:LsdException Locked=3D"false" Priority=3D"39" Name=3D"toc 9"/>
  <w:LsdException Locked=3D"false" Priority=3D"35" QFormat=3D"true" Name=3D=
"caption"/>
  <w:LsdException Locked=3D"false" Priority=3D"10" SemiHidden=3D"false"
   UnhideWhenUsed=3D"false" QFormat=3D"true" Name=3D"Title"/>
  <w:LsdException Locked=3D"false" Priority=3D"1" Name=3D"Default Paragraph=
 Font"/>
  <w:LsdException Locked=3D"false" Priority=3D"11" SemiHidden=3D"false"
   UnhideWhenUsed=3D"false" QFormat=3D"true" Name=3D"Subtitle"/>
  <w:LsdException Locked=3D"false" Priority=3D"22" SemiHidden=3D"false"
   UnhideWhenUsed=3D"false" QFormat=3D"true" Name=3D"Strong"/>
  <w:LsdException Locked=3D"false" Priority=3D"20" SemiHidden=3D"false"
   UnhideWhenUsed=3D"false" QFormat=3D"true" Name=3D"Emphasis"/>
  <w:LsdException Locked=3D"false" Priority=3D"59" SemiHidden=3D"false"
   UnhideWhenUsed=3D"false" Name=3D"Table Grid"/>
  <w:LsdException Locked=3D"false" UnhideWhenUsed=3D"false" Name=3D"Placeho=
lder Text"/>
  <w:LsdException Locked=3D"false" Priority=3D"1" SemiHidden=3D"false"
   UnhideWhenUsed=3D"false" QFormat=3D"true" Name=3D"No Spacing"/>
  <w:LsdException Locked=3D"false" Priority=3D"60" SemiHidden=3D"false"
   UnhideWhenUsed=3D"false" Name=3D"Light Shading"/>
  <w:LsdException Locked=3D"false" Priority=3D"61" SemiHidden=3D"false"
   UnhideWhenUsed=3D"false" Name=3D"Light List"/>
  <w:LsdException Locked=3D"false" Priority=3D"62" SemiHidden=3D"false"
   UnhideWhenUsed=3D"false" Name=3D"Light Grid"/>
  <w:LsdException Locked=3D"false" Priority=3D"63" SemiHidden=3D"false"
   UnhideWhenUsed=3D"false" Name=3D"Medium Shading 1"/>
  <w:LsdException Locked=3D"false" Priority=3D"64" SemiHidden=3D"false"
   UnhideWhenUsed=3D"false" Name=3D"Medium Shading 2"/>
  <w:LsdException Locked=3D"false" Priority=3D"65" SemiHidden=3D"false"
   UnhideWhenUsed=3D"false" Name=3D"Medium List 1"/>
  <w:LsdException Locked=3D"false" Priority=3D"66" SemiHidden=3D"false"
   UnhideWhenUsed=3D"false" Name=3D"Medium List 2"/>
  <w:LsdException Locked=3D"false" Priority=3D"67" SemiHidden=3D"false"
   UnhideWhenUsed=3D"false" Name=3D"Medium Grid 1"/>
  <w:LsdException Locked=3D"false" Priority=3D"68" SemiHidden=3D"false"
   UnhideWhenUsed=3D"false" Name=3D"Medium Grid 2"/>
  <w:LsdException Locked=3D"false" Priority=3D"69" SemiHidden=3D"false"
   UnhideWhenUsed=3D"false" Name=3D"Medium Grid 3"/>
  <w:LsdException Locked=3D"false" Priority=3D"70" SemiHidden=3D"false"
   UnhideWhenUsed=3D"false" Name=3D"Dark List"/>
  <w:LsdException Locked=3D"false" Priority=3D"71" SemiHidden=3D"false"
   UnhideWhenUsed=3D"false" Name=3D"Colorful Shading"/>
  <w:LsdException Locked=3D"false" Priority=3D"72" SemiHidden=3D"false"
   UnhideWhenUsed=3D"false" Name=3D"Colorful List"/>
  <w:LsdException Locked=3D"false" Priority=3D"73" SemiHidden=3D"false"
   UnhideWhenUsed=3D"false" Name=3D"Colorful Grid"/>
  <w:LsdException Locked=3D"false" Priority=3D"60" SemiHidden=3D"false"
   UnhideWhenUsed=3D"false" Name=3D"Light Shading Accent 1"/>
  <w:LsdException Locked=3D"false" Priority=3D"61" SemiHidden=3D"false"
   UnhideWhenUsed=3D"false" Name=3D"Light List Accent 1"/>
  <w:LsdException Locked=3D"false" Priority=3D"62" SemiHidden=3D"false"
   UnhideWhenUsed=3D"false" Name=3D"Light Grid Accent 1"/>
  <w:LsdException Locked=3D"false" Priority=3D"63" SemiHidden=3D"false"
   UnhideWhenUsed=3D"false" Name=3D"Medium Shading 1 Accent 1"/>
  <w:LsdException Locked=3D"false" Priority=3D"64" SemiHidden=3D"false"
   UnhideWhenUsed=3D"false" Name=3D"Medium Shading 2 Accent 1"/>
  <w:LsdException Locked=3D"false" Priority=3D"65" SemiHidden=3D"false"
   UnhideWhenUsed=3D"false" Name=3D"Medium List 1 Accent 1"/>
  <w:LsdException Locked=3D"false" UnhideWhenUsed=3D"false" Name=3D"Revisio=
n"/>
  <w:LsdException Locked=3D"false" Priority=3D"34" SemiHidden=3D"false"
   UnhideWhenUsed=3D"false" QFormat=3D"true" Name=3D"List Paragraph"/>
  <w:LsdException Locked=3D"false" Priority=3D"29" SemiHidden=3D"false"
   UnhideWhenUsed=3D"false" QFormat=3D"true" Name=3D"Quote"/>
  <w:LsdException Locked=3D"false" Priority=3D"30" SemiHidden=3D"false"
   UnhideWhenUsed=3D"false" QFormat=3D"true" Name=3D"Intense Quote"/>
  <w:LsdException Locked=3D"false" Priority=3D"66" SemiHidden=3D"false"
   UnhideWhenUsed=3D"false" Name=3D"Medium List 2 Accent 1"/>
  <w:LsdException Locked=3D"false" Priority=3D"67" SemiHidden=3D"false"
   UnhideWhenUsed=3D"false" Name=3D"Medium Grid 1 Accent 1"/>
  <w:LsdException Locked=3D"false" Priority=3D"68" SemiHidden=3D"false"
   UnhideWhenUsed=3D"false" Name=3D"Medium Grid 2 Accent 1"/>
  <w:LsdException Locked=3D"false" Priority=3D"69" SemiHidden=3D"false"
   UnhideWhenUsed=3D"false" Name=3D"Medium Grid 3 Accent 1"/>
  <w:LsdException Locked=3D"false" Priority=3D"70" SemiHidden=3D"false"
   UnhideWhenUsed=3D"false" Name=3D"Dark List Accent 1"/>
  <w:LsdException Locked=3D"false" Priority=3D"71" SemiHidden=3D"false"
   UnhideWhenUsed=3D"false" Name=3D"Colorful Shading Accent 1"/>
  <w:LsdException Locked=3D"false" Priority=3D"72" SemiHidden=3D"false"
   UnhideWhenUsed=3D"false" Name=3D"Colorful List Accent 1"/>
  <w:LsdException Locked=3D"false" Priority=3D"73" SemiHidden=3D"false"
   UnhideWhenUsed=3D"false" Name=3D"Colorful Grid Accent 1"/>
  <w:LsdException Locked=3D"false" Priority=3D"60" SemiHidden=3D"false"
   UnhideWhenUsed=3D"false" Name=3D"Light Shading Accent 2"/>
  <w:LsdException Locked=3D"false" Priority=3D"61" SemiHidden=3D"false"
   UnhideWhenUsed=3D"false" Name=3D"Light List Accent 2"/>
  <w:LsdException Locked=3D"false" Priority=3D"62" SemiHidden=3D"false"
   UnhideWhenUsed=3D"false" Name=3D"Light Grid Accent 2"/>
  <w:LsdException Locked=3D"false" Priority=3D"63" SemiHidden=3D"false"
   UnhideWhenUsed=3D"false" Name=3D"Medium Shading 1 Accent 2"/>
  <w:LsdException Locked=3D"false" Priority=3D"64" SemiHidden=3D"false"
   UnhideWhenUsed=3D"false" Name=3D"Medium Shading 2 Accent 2"/>
  <w:LsdException Locked=3D"false" Priority=3D"65" SemiHidden=3D"false"
   UnhideWhenUsed=3D"false" Name=3D"Medium List 1 Accent 2"/>
  <w:LsdException Locked=3D"false" Priority=3D"66" SemiHidden=3D"false"
   UnhideWhenUsed=3D"false" Name=3D"Medium List 2 Accent 2"/>
  <w:LsdException Locked=3D"false" Priority=3D"67" SemiHidden=3D"false"
   UnhideWhenUsed=3D"false" Name=3D"Medium Grid 1 Accent 2"/>
  <w:LsdException Locked=3D"false" Priority=3D"68" SemiHidden=3D"false"
   UnhideWhenUsed=3D"false" Name=3D"Medium Grid 2 Accent 2"/>
  <w:LsdException Locked=3D"false" Priority=3D"69" SemiHidden=3D"false"
   UnhideWhenUsed=3D"false" Name=3D"Medium Grid 3 Accent 2"/>
  <w:LsdException Locked=3D"false" Priority=3D"70" SemiHidden=3D"false"
   UnhideWhenUsed=3D"false" Name=3D"Dark List Accent 2"/>
  <w:LsdException Locked=3D"false" Priority=3D"71" SemiHidden=3D"false"
   UnhideWhenUsed=3D"false" Name=3D"Colorful Shading Accent 2"/>
  <w:LsdException Locked=3D"false" Priority=3D"72" SemiHidden=3D"false"
   UnhideWhenUsed=3D"false" Name=3D"Colorful List Accent 2"/>
  <w:LsdException Locked=3D"false" Priority=3D"73" SemiHidden=3D"false"
   UnhideWhenUsed=3D"false" Name=3D"Colorful Grid Accent 2"/>
  <w:LsdException Locked=3D"false" Priority=3D"60" SemiHidden=3D"false"
   UnhideWhenUsed=3D"false" Name=3D"Light Shading Accent 3"/>
  <w:LsdException Locked=3D"false" Priority=3D"61" SemiHidden=3D"false"
   UnhideWhenUsed=3D"false" Name=3D"Light List Accent 3"/>
  <w:LsdException Locked=3D"false" Priority=3D"62" SemiHidden=3D"false"
   UnhideWhenUsed=3D"false" Name=3D"Light Grid Accent 3"/>
  <w:LsdException Locked=3D"false" Priority=3D"63" SemiHidden=3D"false"
   UnhideWhenUsed=3D"false" Name=3D"Medium Shading 1 Accent 3"/>
  <w:LsdException Locked=3D"false" Priority=3D"64" SemiHidden=3D"false"
   UnhideWhenUsed=3D"false" Name=3D"Medium Shading 2 Accent 3"/>
  <w:LsdException Locked=3D"false" Priority=3D"65" SemiHidden=3D"false"
   UnhideWhenUsed=3D"false" Name=3D"Medium List 1 Accent 3"/>
  <w:LsdException Locked=3D"false" Priority=3D"66" SemiHidden=3D"false"
   UnhideWhenUsed=3D"false" Name=3D"Medium List 2 Accent 3"/>
  <w:LsdException Locked=3D"false" Priority=3D"67" SemiHidden=3D"false"
   UnhideWhenUsed=3D"false" Name=3D"Medium Grid 1 Accent 3"/>
  <w:LsdException Locked=3D"false" Priority=3D"68" SemiHidden=3D"false"
   UnhideWhenUsed=3D"false" Name=3D"Medium Grid 2 Accent 3"/>
  <w:LsdException Locked=3D"false" Priority=3D"69" SemiHidden=3D"false"
   UnhideWhenUsed=3D"false" Name=3D"Medium Grid 3 Accent 3"/>
  <w:LsdException Locked=3D"false" Priority=3D"70" SemiHidden=3D"false"
   UnhideWhenUsed=3D"false" Name=3D"Dark List Accent 3"/>
  <w:LsdException Locked=3D"false" Priority=3D"71" SemiHidden=3D"false"
   UnhideWhenUsed=3D"false" Name=3D"Colorful Shading Accent 3"/>
  <w:LsdException Locked=3D"false" Priority=3D"72" SemiHidden=3D"false"
   UnhideWhenUsed=3D"false" Name=3D"Colorful List Accent 3"/>
  <w:LsdException Locked=3D"false" Priority=3D"73" SemiHidden=3D"false"
   UnhideWhenUsed=3D"false" Name=3D"Colorful Grid Accent 3"/>
  <w:LsdException Locked=3D"false" Priority=3D"60" SemiHidden=3D"false"
   UnhideWhenUsed=3D"false" Name=3D"Light Shading Accent 4"/>
  <w:LsdException Locked=3D"false" Priority=3D"61" SemiHidden=3D"false"
   UnhideWhenUsed=3D"false" Name=3D"Light List Accent 4"/>
  <w:LsdException Locked=3D"false" Priority=3D"62" SemiHidden=3D"false"
   UnhideWhenUsed=3D"false" Name=3D"Light Grid Accent 4"/>
  <w:LsdException Locked=3D"false" Priority=3D"63" SemiHidden=3D"false"
   UnhideWhenUsed=3D"false" Name=3D"Medium Shading 1 Accent 4"/>
  <w:LsdException Locked=3D"false" Priority=3D"64" SemiHidden=3D"false"
   UnhideWhenUsed=3D"false" Name=3D"Medium Shading 2 Accent 4"/>
  <w:LsdException Locked=3D"false" Priority=3D"65" SemiHidden=3D"false"
   UnhideWhenUsed=3D"false" Name=3D"Medium List 1 Accent 4"/>
  <w:LsdException Locked=3D"false" Priority=3D"66" SemiHidden=3D"false"
   UnhideWhenUsed=3D"false" Name=3D"Medium List 2 Accent 4"/>
  <w:LsdException Locked=3D"false" Priority=3D"67" SemiHidden=3D"false"
   UnhideWhenUsed=3D"false" Name=3D"Medium Grid 1 Accent 4"/>
  <w:LsdException Locked=3D"false" Priority=3D"68" SemiHidden=3D"false"
   UnhideWhenUsed=3D"false" Name=3D"Medium Grid 2 Accent 4"/>
  <w:LsdException Locked=3D"false" Priority=3D"69" SemiHidden=3D"false"
   UnhideWhenUsed=3D"false" Name=3D"Medium Grid 3 Accent 4"/>
  <w:LsdException Locked=3D"false" Priority=3D"70" SemiHidden=3D"false"
   UnhideWhenUsed=3D"false" Name=3D"Dark List Accent 4"/>
  <w:LsdException Locked=3D"false" Priority=3D"71" SemiHidden=3D"false"
   UnhideWhenUsed=3D"false" Name=3D"Colorful Shading Accent 4"/>
  <w:LsdException Locked=3D"false" Priority=3D"72" SemiHidden=3D"false"
   UnhideWhenUsed=3D"false" Name=3D"Colorful List Accent 4"/>
  <w:LsdException Locked=3D"false" Priority=3D"73" SemiHidden=3D"false"
   UnhideWhenUsed=3D"false" Name=3D"Colorful Grid Accent 4"/>
  <w:LsdException Locked=3D"false" Priority=3D"60" SemiHidden=3D"false"
   UnhideWhenUsed=3D"false" Name=3D"Light Shading Accent 5"/>
  <w:LsdException Locked=3D"false" Priority=3D"61" SemiHidden=3D"false"
   UnhideWhenUsed=3D"false" Name=3D"Light List Accent 5"/>
  <w:LsdException Locked=3D"false" Priority=3D"62" SemiHidden=3D"false"
   UnhideWhenUsed=3D"false" Name=3D"Light Grid Accent 5"/>
  <w:LsdException Locked=3D"false" Priority=3D"63" SemiHidden=3D"false"
   UnhideWhenUsed=3D"false" Name=3D"Medium Shading 1 Accent 5"/>
  <w:LsdException Locked=3D"false" Priority=3D"64" SemiHidden=3D"false"
   UnhideWhenUsed=3D"false" Name=3D"Medium Shading 2 Accent 5"/>
  <w:LsdException Locked=3D"false" Priority=3D"65" SemiHidden=3D"false"
   UnhideWhenUsed=3D"false" Name=3D"Medium List 1 Accent 5"/>
  <w:LsdException Locked=3D"false" Priority=3D"66" SemiHidden=3D"false"
   UnhideWhenUsed=3D"false" Name=3D"Medium List 2 Accent 5"/>
  <w:LsdException Locked=3D"false" Priority=3D"67" SemiHidden=3D"false"
   UnhideWhenUsed=3D"false" Name=3D"Medium Grid 1 Accent 5"/>
  <w:LsdException Locked=3D"false" Priority=3D"68" SemiHidden=3D"false"
   UnhideWhenUsed=3D"false" Name=3D"Medium Grid 2 Accent 5"/>
  <w:LsdException Locked=3D"false" Priority=3D"69" SemiHidden=3D"false"
   UnhideWhenUsed=3D"false" Name=3D"Medium Grid 3 Accent 5"/>
  <w:LsdException Locked=3D"false" Priority=3D"70" SemiHidden=3D"false"
   UnhideWhenUsed=3D"false" Name=3D"Dark List Accent 5"/>
  <w:LsdException Locked=3D"false" Priority=3D"71" SemiHidden=3D"false"
   UnhideWhenUsed=3D"false" Name=3D"Colorful Shading Accent 5"/>
  <w:LsdException Locked=3D"false" Priority=3D"72" SemiHidden=3D"false"
   UnhideWhenUsed=3D"false" Name=3D"Colorful List Accent 5"/>
  <w:LsdException Locked=3D"false" Priority=3D"73" SemiHidden=3D"false"
   UnhideWhenUsed=3D"false" Name=3D"Colorful Grid Accent 5"/>
  <w:LsdException Locked=3D"false" Priority=3D"60" SemiHidden=3D"false"
   UnhideWhenUsed=3D"false" Name=3D"Light Shading Accent 6"/>
  <w:LsdException Locked=3D"false" Priority=3D"61" SemiHidden=3D"false"
   UnhideWhenUsed=3D"false" Name=3D"Light List Accent 6"/>
  <w:LsdException Locked=3D"false" Priority=3D"62" SemiHidden=3D"false"
   UnhideWhenUsed=3D"false" Name=3D"Light Grid Accent 6"/>
  <w:LsdException Locked=3D"false" Priority=3D"63" SemiHidden=3D"false"
   UnhideWhenUsed=3D"false" Name=3D"Medium Shading 1 Accent 6"/>
  <w:LsdException Locked=3D"false" Priority=3D"64" SemiHidden=3D"false"
   UnhideWhenUsed=3D"false" Name=3D"Medium Shading 2 Accent 6"/>
  <w:LsdException Locked=3D"false" Priority=3D"65" SemiHidden=3D"false"
   UnhideWhenUsed=3D"false" Name=3D"Medium List 1 Accent 6"/>
  <w:LsdException Locked=3D"false" Priority=3D"66" SemiHidden=3D"false"
   UnhideWhenUsed=3D"false" Name=3D"Medium List 2 Accent 6"/>
  <w:LsdException Locked=3D"false" Priority=3D"67" SemiHidden=3D"false"
   UnhideWhenUsed=3D"false" Name=3D"Medium Grid 1 Accent 6"/>
  <w:LsdException Locked=3D"false" Priority=3D"68" SemiHidden=3D"false"
   UnhideWhenUsed=3D"false" Name=3D"Medium Grid 2 Accent 6"/>
  <w:LsdException Locked=3D"false" Priority=3D"69" SemiHidden=3D"false"
   UnhideWhenUsed=3D"false" Name=3D"Medium Grid 3 Accent 6"/>
  <w:LsdException Locked=3D"false" Priority=3D"70" SemiHidden=3D"false"
   UnhideWhenUsed=3D"false" Name=3D"Dark List Accent 6"/>
  <w:LsdException Locked=3D"false" Priority=3D"71" SemiHidden=3D"false"
   UnhideWhenUsed=3D"false" Name=3D"Colorful Shading Accent 6"/>
  <w:LsdException Locked=3D"false" Priority=3D"72" SemiHidden=3D"false"
   UnhideWhenUsed=3D"false" Name=3D"Colorful List Accent 6"/>
  <w:LsdException Locked=3D"false" Priority=3D"73" SemiHidden=3D"false"
   UnhideWhenUsed=3D"false" Name=3D"Colorful Grid Accent 6"/>
  <w:LsdException Locked=3D"false" Priority=3D"19" SemiHidden=3D"false"
   UnhideWhenUsed=3D"false" QFormat=3D"true" Name=3D"Subtle Emphasis"/>
  <w:LsdException Locked=3D"false" Priority=3D"21" SemiHidden=3D"false"
   UnhideWhenUsed=3D"false" QFormat=3D"true" Name=3D"Intense Emphasis"/>
  <w:LsdException Locked=3D"false" Priority=3D"31" SemiHidden=3D"false"
   UnhideWhenUsed=3D"false" QFormat=3D"true" Name=3D"Subtle Reference"/>
  <w:LsdException Locked=3D"false" Priority=3D"32" SemiHidden=3D"false"
   UnhideWhenUsed=3D"false" QFormat=3D"true" Name=3D"Intense Reference"/>
  <w:LsdException Locked=3D"false" Priority=3D"33" SemiHidden=3D"false"
   UnhideWhenUsed=3D"false" QFormat=3D"true" Name=3D"Book Title"/>
  <w:LsdException Locked=3D"false" Priority=3D"37" Name=3D"Bibliography"/>
  <w:LsdException Locked=3D"false" Priority=3D"39" QFormat=3D"true" Name=3D=
"TOC Heading"/>
 </w:LatentStyles>
</xml><![endif]-->
<style>
<!--
 /* Font Definitions */
 @font-face
	{font-family:"Cambria Math";
	panose-1:2 4 5 3 5 4 6 3 2 4;
	mso-font-charset:0;
	mso-generic-font-family:roman;
	mso-font-pitch:variable;
	mso-font-signature:-1610611985 1107304683 0 0 159 0;}
@font-face
	{font-family:Calibri;
	panose-1:2 15 5 2 2 2 4 3 2 4;
	mso-font-charset:0;
	mso-generic-font-family:swiss;
	mso-font-pitch:variable;
	mso-font-signature:-1610611985 1073750139 0 0 159 0;}
@font-face
	{font-family:Tahoma;
	panose-1:2 11 6 4 3 5 4 4 2 4;
	mso-font-charset:0;
	mso-generic-font-family:swiss;
	mso-font-pitch:variable;
	mso-font-signature:1627400839 -2147483648 8 0 66047 0;}
@font-face
	{font-family:Verdana;
	panose-1:2 11 6 4 3 5 4 4 2 4;
	mso-font-charset:0;
	mso-generic-font-family:swiss;
	mso-font-pitch:variable;
	mso-font-signature:536871559 0 0 0 415 0;}
 /* Style Definitions */
 p.MsoNormal, li.MsoNormal, div.MsoNormal
	{mso-style-unhide:no;
	mso-style-qformat:yes;
	mso-style-parent:"";
	margin-top:0in;
	margin-right:0in;
	margin-bottom:10.0pt;
	margin-left:0in;
	line-height:115%;
	mso-pagination:widow-orphan;
	font-size:11.0pt;
	font-family:"Calibri","sans-serif";
	mso-ascii-font-family:Calibri;
	mso-ascii-theme-font:minor-latin;
	mso-fareast-font-family:Calibri;
	mso-fareast-theme-font:minor-latin;
	mso-hansi-font-family:Calibri;
	mso-hansi-theme-font:minor-latin;
	mso-bidi-font-family:"Times New Roman";
	mso-bidi-theme-font:minor-bidi;}
h3
	{mso-style-noshow:yes;
	mso-style-priority:9;
	mso-style-qformat:yes;
	mso-style-link:"Heading 3 Char";
	mso-margin-top-alt:auto;
	margin-right:0in;
	mso-margin-bottom-alt:auto;
	margin-left:0in;
	mso-pagination:widow-orphan;
	mso-outline-level:3;
	font-size:12.0pt;
	font-family:"Times New Roman","serif";
	mso-fareast-font-family:"Times New Roman";
	font-weight:normal;}
a:link, span.MsoHyperlink
	{mso-style-noshow:yes;
	mso-style-priority:99;
	color:#444444;
	text-decoration:underline;
	text-underline:single;}
a:visited, span.MsoHyperlinkFollowed
	{mso-style-noshow:yes;
	mso-style-priority:99;
	color:#919191;
	mso-themecolor:followedhyperlink;
	text-decoration:underline;
	text-underline:single;}
p
	{mso-style-noshow:yes;
	mso-style-priority:99;
	mso-margin-top-alt:auto;
	margin-right:0in;
	mso-margin-bottom-alt:auto;
	margin-left:0in;
	mso-pagination:widow-orphan;
	font-size:12.0pt;
	font-family:"Times New Roman","serif";
	mso-fareast-font-family:"Times New Roman";}
p.MsoAcetate, li.MsoAcetate, div.MsoAcetate
	{mso-style-noshow:yes;
	mso-style-priority:99;
	mso-style-link:"Balloon Text Char";
	margin:0in;
	margin-bottom:.0001pt;
	mso-pagination:widow-orphan;
	font-size:8.0pt;
	font-family:"Tahoma","sans-serif";
	mso-fareast-font-family:Calibri;
	mso-fareast-theme-font:minor-latin;}
span.Heading3Char
	{mso-style-name:"Heading 3 Char";
	mso-style-noshow:yes;
	mso-style-priority:9;
	mso-style-unhide:no;
	mso-style-locked:yes;
	mso-style-link:"Heading 3";
	mso-ansi-font-size:12.0pt;
	mso-bidi-font-size:12.0pt;
	font-family:"Times New Roman","serif";
	mso-ascii-font-family:"Times New Roman";
	mso-fareast-font-family:"Times New Roman";
	mso-hansi-font-family:"Times New Roman";
	mso-bidi-font-family:"Times New Roman";}
span.BalloonTextChar
	{mso-style-name:"Balloon Text Char";
	mso-style-noshow:yes;
	mso-style-priority:99;
	mso-style-unhide:no;
	mso-style-locked:yes;
	mso-style-link:"Balloon Text";
	mso-ansi-font-size:8.0pt;
	mso-bidi-font-size:8.0pt;
	font-family:"Tahoma","sans-serif";
	mso-ascii-font-family:Tahoma;
	mso-hansi-font-family:Tahoma;
	mso-bidi-font-family:Tahoma;}
span.klink
	{mso-style-name:klink;
	mso-style-unhide:no;
	font-family:"Verdana","sans-serif";
	mso-ascii-font-family:Verdana;
	mso-hansi-font-family:Verdana;}
span.SpellE
	{mso-style-name:"";
	mso-spl-e:yes;}
span.GramE
	{mso-style-name:"";
	mso-gram-e:yes;}
.MsoChpDefault
	{mso-style-type:export-only;
	mso-default-props:yes;
	font-size:10.0pt;
	mso-ansi-font-size:10.0pt;
	mso-bidi-font-size:10.0pt;
	mso-ascii-font-family:Calibri;
	mso-ascii-theme-font:minor-latin;
	mso-fareast-font-family:Calibri;
	mso-fareast-theme-font:minor-latin;
	mso-hansi-font-family:Calibri;
	mso-hansi-theme-font:minor-latin;
	mso-bidi-font-family:"Times New Roman";
	mso-bidi-theme-font:minor-bidi;}
@page Section1
	{size:372.8pt 468.05pt;
	margin:1.0in 1.0in 1.0in 1.0in;
	mso-header-margin:.5in;
	mso-footer-margin:.5in;
	border:solid windowtext 1.0pt;
	mso-border-alt:solid windowtext .5pt;
	padding:24.0pt 24.0pt 24.0pt 24.0pt;
	mso-paper-source:0;}
div.Section1
	{page:Section1;}
-->
</style>
<!--[if gte mso 10]>
<style>
 /* Style Definitions */
 table.MsoNormalTable
	{mso-style-name:"Table Normal";
	mso-tstyle-rowband-size:0;
	mso-tstyle-colband-size:0;
	mso-style-noshow:yes;
	mso-style-priority:99;
	mso-style-qformat:yes;
	mso-style-parent:"";
	mso-padding-alt:0in 5.4pt 0in 5.4pt;
	mso-para-margin:0in;
	mso-para-margin-bottom:.0001pt;
	mso-pagination:widow-orphan;
	font-size:10.0pt;
	font-family:"Calibri","sans-serif";
	mso-ascii-font-family:Calibri;
	mso-ascii-theme-font:minor-latin;
	mso-hansi-font-family:Calibri;
	mso-hansi-theme-font:minor-latin;}
</style>
<![endif]--><!--[if gte mso 9]><xml>
 <o:shapedefaults v:ext=3D"edit" spidmax=3D"3074">
  <o:colormenu v:ext=3D"edit" fillcolor=3D"none [3213]"/>
 </o:shapedefaults></xml><![endif]--><!--[if gte mso 9]><xml>
 <o:shapelayout v:ext=3D"edit">
  <o:idmap v:ext=3D"edit" data=3D"1"/>
 </o:shapelayout></xml><![endif]-->
</head>

<body width=90% bgcolor=3Dblack lang=3DEN-US link=3D"#444444" vlink=3D"#919191" style=
=3D'tab-interval:
.5in'>

<div class=3DSection1>

<p class=3DMsoNormal style=3D'margin-bottom:0in;margin-bottom:.0001pt;line-=
height:
10.5pt'><b><span style=3D'font-size:8.5pt;font-family:"Verdana","sans-serif=
";
mso-fareast-font-family:"Times New Roman";mso-bidi-font-family:"Times New R=
oman";
color:#BDD5DA'>Secure ASP.NET coding practice for three most critical
vulnerabilities in Web Application</span></b><span style=3D'font-size:8.5pt;
font-family:"Verdana","sans-serif";mso-fareast-font-family:"Times New Roman=
";
mso-bidi-font-family:"Times New Roman";color:#BDD5DA'> <o:p></o:p></span></=
p>

<p class=3DMsoNormal style=3D'mso-margin-top-alt:auto;mso-margin-bottom-alt=
:auto;
line-height:17.25pt;mso-outline-level:2'><span style=3D'font-size:16.0pt;
font-family:"Verdana","sans-serif";mso-fareast-font-family:"Times New Roman=
";
mso-bidi-font-family:"Times New Roman";color:#BDD5DA;letter-spacing:-.75pt;
mso-font-kerning:18.0pt'>Secure ASP.NET coding practice for three most crit=
ical
vulnerabilities in Web Application<o:p></o:p></span></p>

<p class=3DMsoNormal style=3D'mso-margin-top-alt:auto;mso-margin-bottom-alt=
:auto;
line-height:13.5pt'><span style=3D'font-size:9.0pt;font-family:"Verdana","s=
ans-serif";
mso-fareast-font-family:"Times New Roman";mso-bidi-font-family:"Times New R=
oman";
color:#BDD5DA'>Secure ASP.NET coding practice for 3 most critical vulnerabi=
lities
in Web Application<o:p></o:p></span></p>

<p class=3DMsoNormal style=3D'margin-bottom:0in;margin-bottom:.0001pt;line-=
height:
13.5pt'><span style=3D'font-size:9.0pt;font-family:"Verdana","sans-serif";
mso-fareast-font-family:"Times New Roman";mso-bidi-font-family:"Times New R=
oman";
color:#BDD5DA'>Introduction: <o:p></o:p></span></p>

<p class=3DMsoNormal style=3D'mso-margin-top-alt:auto;mso-margin-bottom-alt=
:auto;
line-height:13.5pt'><span style=3D'font-size:9.0pt;font-family:"Verdana","s=
ans-serif";
mso-fareast-font-family:"Times New Roman";mso-bidi-font-family:"Times New R=
oman";
color:#BDD5DA'>ASP.NET provides several exciting security controls, but the=
se
need to be understood properly and used wisely. Failing to use the ASP.NET
functions properly results in an insecure web application. We see therefore
that ASP.NET does not exempt the programmer from following coding standards=
 and
procedures in order to write safe and </span><span style=3D'color:#BDD5DA'>=
<a
href=3D"http://www.articlesbase.com/security-articles/secure-aspnet-coding-=
practice-for-three-most-critical-vulnerabilities-in-web-application-889853.=
html"
target=3D"_new"><span style=3D'font-size:9.0pt;mso-bidi-font-size:11.0pt;
font-family:"Verdana","sans-serif";mso-fareast-font-family:"Times New Roman=
";
mso-bidi-font-family:"Times New Roman";color:#BDD5DA'>secure application</s=
pan></a></span><span
style=3D'font-size:9.0pt;font-family:"Verdana","sans-serif";mso-fareast-fon=
t-family:
"Times New Roman";mso-bidi-font-family:"Times New Roman";color:#BDD5DA'> co=
de.<o:p></o:p></span></p>

<p class=3DMsoNormal style=3D'mso-margin-top-alt:auto;mso-margin-bottom-alt=
:auto;
line-height:13.5pt'><span style=3D'font-size:9.0pt;font-family:"Verdana","s=
ans-serif";
mso-fareast-font-family:"Times New Roman";mso-bidi-font-family:"Times New R=
oman";
color:#BDD5DA'>In this paper we will discuss about the code level mitigation
for three most frequently found vulnerabilities:<o:p></o:p></span></p>

<p class=3DMsoNormal style=3D'mso-margin-top-alt:auto;mso-margin-bottom-alt=
:auto;
line-height:13.5pt'><i style=3D'mso-bidi-font-style:normal'><span
style=3D'font-size:9.0pt;font-family:"Verdana","sans-serif";mso-fareast-fon=
t-family:
"Times New Roman";mso-bidi-font-family:"Times New Roman";color:#BDD5DA'>Cro=
ss
Site Scripting<o:p></o:p></span></i></p>

<p class=3DMsoNormal style=3D'mso-margin-top-alt:auto;mso-margin-bottom-alt=
:auto;
line-height:13.5pt'><i style=3D'mso-bidi-font-style:normal'><span
style=3D'font-size:9.0pt;font-family:"Verdana","sans-serif";mso-fareast-fon=
t-family:
"Times New Roman";mso-bidi-font-family:"Times New Roman";color:#BDD5DA'>SQL
Injection<o:p></o:p></span></i></p>

<p class=3DMsoNormal style=3D'mso-margin-top-alt:auto;mso-margin-bottom-alt=
:auto;
line-height:13.5pt'><i style=3D'mso-bidi-font-style:normal'><span
style=3D'font-size:9.0pt;font-family:"Verdana","sans-serif";mso-fareast-fon=
t-family:
"Times New Roman";mso-bidi-font-family:"Times New Roman";color:#BDD5DA'>Inf=
ormation
Leakage<o:p></o:p></span></i></p>

<p class=3DMsoNormal style=3D'margin-bottom:0in;margin-bottom:.0001pt;line-=
height:
13.5pt'><i style=3D'mso-bidi-font-style:normal'><span style=3D'font-size:9.=
0pt;
font-family:"Verdana","sans-serif";mso-fareast-font-family:"Times New Roman=
";
mso-bidi-font-family:"Times New Roman";color:#BDD5DA'>Cross Site Scripting:=
 <o:p></o:p></span></i></p>

<p class=3DMsoNormal style=3D'mso-margin-top-alt:auto;mso-margin-bottom-alt=
:auto;
line-height:13.5pt'><span style=3D'font-size:9.0pt;font-family:"Verdana","s=
ans-serif";
mso-fareast-font-family:"Times New Roman";mso-bidi-font-family:"Times New R=
oman";
color:#BDD5DA'>An application is vulnerable to Cross Site Scripting if
malicious user input is embedded in the HTML response without passing throu=
gh
any particular validation process. Let&#8217;s take a look on a vulnerable
chunk of code<o:p></o:p></span></p>

<p class=3DMsoNormal style=3D'mso-margin-top-alt:auto;mso-margin-bottom-alt=
:auto;
line-height:13.5pt'><b><i><span style=3D'font-size:9.0pt;mso-bidi-font-size=
:11.0pt;
font-family:"Verdana","sans-serif";mso-fareast-font-family:"Times New Roman=
";
mso-bidi-font-family:"Times New Roman";color:#BDD5DA'>&lt;%@ Page <span
class=3DSpellE>ValidateRequest</span>=3D&quot;false&quot; %&gt;</span></i><=
/b><span
style=3D'font-size:9.0pt;font-family:"Verdana","sans-serif";mso-fareast-fon=
t-family:
"Times New Roman";mso-bidi-font-family:"Times New Roman";color:#BDD5DA'><o:=
p></o:p></span></p>

<p class=3DMsoNormal style=3D'mso-margin-top-alt:auto;mso-margin-bottom-alt=
:auto;
line-height:13.5pt'><b><i><span style=3D'font-size:9.0pt;mso-bidi-font-size=
:11.0pt;
font-family:"Verdana","sans-serif";mso-fareast-font-family:"Times New Roman=
";
mso-bidi-font-family:"Times New Roman";color:#BDD5DA'>&lt;<span class=3DGra=
mE>html</span>&gt;</span></i></b><span
style=3D'font-size:9.0pt;font-family:"Verdana","sans-serif";mso-fareast-fon=
t-family:
"Times New Roman";mso-bidi-font-family:"Times New Roman";color:#BDD5DA'><o:=
p></o:p></span></p>

<p class=3DMsoNormal style=3D'mso-margin-top-alt:auto;mso-margin-bottom-alt=
:auto;
line-height:13.5pt'><b><i><span style=3D'font-size:9.0pt;mso-bidi-font-size=
:11.0pt;
font-family:"Verdana","sans-serif";mso-fareast-font-family:"Times New Roman=
";
mso-bidi-font-family:"Times New Roman";color:#BDD5DA'>&lt;script <span
class=3DSpellE>runat</span>=3D&quot;server&quot;&gt;</span></i></b><span
style=3D'font-size:9.0pt;font-family:"Verdana","sans-serif";mso-fareast-fon=
t-family:
"Times New Roman";mso-bidi-font-family:"Times New Roman";color:#BDD5DA'><o:=
p></o:p></span></p>

<p class=3DMsoNormal style=3D'mso-margin-top-alt:auto;mso-margin-bottom-alt=
:auto;
line-height:13.5pt'><span class=3DGramE><b><i><span style=3D'font-size:9.0p=
t;
mso-bidi-font-size:11.0pt;font-family:"Verdana","sans-serif";mso-fareast-fo=
nt-family:
"Times New Roman";mso-bidi-font-family:"Times New Roman";color:#BDD5DA'>voi=
d</span></i></b></span><b><i><span
style=3D'font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:"Verdana","s=
ans-serif";
mso-fareast-font-family:"Times New Roman";mso-bidi-font-family:"Times New R=
oman";
color:#BDD5DA'> <span class=3DSpellE>buttonsubmit_Click</span>(Object sende=
r, <span
class=3DSpellE>EventArgs</span> e)</span></i></b><span style=3D'font-size:9=
.0pt;
font-family:"Verdana","sans-serif";mso-fareast-font-family:"Times New Roman=
";
mso-bidi-font-family:"Times New Roman";color:#BDD5DA'><o:p></o:p></span></p>

<p class=3DMsoNormal style=3D'mso-margin-top-alt:auto;mso-margin-bottom-alt=
:auto;
line-height:13.5pt'><b><i><span style=3D'font-size:9.0pt;mso-bidi-font-size=
:11.0pt;
font-family:"Verdana","sans-serif";mso-fareast-font-family:"Times New Roman=
";
mso-bidi-font-family:"Times New Roman";color:#BDD5DA'>{</span></i></b><span
style=3D'font-size:9.0pt;font-family:"Verdana","sans-serif";mso-fareast-fon=
t-family:
"Times New Roman";mso-bidi-font-family:"Times New Roman";color:#BDD5DA'><o:=
p></o:p></span></p>

<p class=3DMsoNormal style=3D'mso-margin-top-alt:auto;mso-margin-bottom-alt=
:auto;
line-height:13.5pt'><span class=3DSpellE><span class=3DGramE><b><i><span
style=3D'font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:"Verdana","s=
ans-serif";
mso-fareast-font-family:"Times New Roman";mso-bidi-font-family:"Times New R=
oman";
color:#BDD5DA'>Response.Write</span></i></b></span></span><span class=3DGra=
mE><b><i><span
style=3D'font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:"Verdana","s=
ans-serif";
mso-fareast-font-family:"Times New Roman";mso-bidi-font-family:"Times New R=
oman";
color:#BDD5DA'>(</span></i></b></span><span class=3DSpellE><b><i><span
style=3D'font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:"Verdana","s=
ans-serif";
mso-fareast-font-family:"Times New Roman";mso-bidi-font-family:"Times New R=
oman";
color:#BDD5DA'>comment.Text</span></i></b></span><b><i><span style=3D'font-=
size:
9.0pt;mso-bidi-font-size:11.0pt;font-family:"Verdana","sans-serif";mso-fare=
ast-font-family:
"Times New Roman";mso-bidi-font-family:"Times New Roman";color:#BDD5DA'>);<=
/span></i></b><span
style=3D'font-size:9.0pt;font-family:"Verdana","sans-serif";mso-fareast-fon=
t-family:
"Times New Roman";mso-bidi-font-family:"Times New Roman";color:#BDD5DA'><o:=
p></o:p></span></p>

<p class=3DMsoNormal style=3D'mso-margin-top-alt:auto;mso-margin-bottom-alt=
:auto;
line-height:13.5pt'><b><i><span style=3D'font-size:9.0pt;mso-bidi-font-size=
:11.0pt;
font-family:"Verdana","sans-serif";mso-fareast-font-family:"Times New Roman=
";
mso-bidi-font-family:"Times New Roman";color:#BDD5DA'>}</span></i></b><span
style=3D'font-size:9.0pt;font-family:"Verdana","sans-serif";mso-fareast-fon=
t-family:
"Times New Roman";mso-bidi-font-family:"Times New Roman";color:#BDD5DA'><o:=
p></o:p></span></p>

<p class=3DMsoNormal style=3D'mso-margin-top-alt:auto;mso-margin-bottom-alt=
:auto;
line-height:13.5pt'><b><i><span style=3D'font-size:9.0pt;mso-bidi-font-size=
:11.0pt;
font-family:"Verdana","sans-serif";mso-fareast-font-family:"Times New Roman=
";
mso-bidi-font-family:"Times New Roman";color:#BDD5DA'>&lt;/script&gt;</span=
></i></b><span
style=3D'font-size:9.0pt;font-family:"Verdana","sans-serif";mso-fareast-fon=
t-family:
"Times New Roman";mso-bidi-font-family:"Times New Roman";color:#BDD5DA'><o:=
p></o:p></span></p>

<p class=3DMsoNormal style=3D'mso-margin-top-alt:auto;mso-margin-bottom-alt=
:auto;
line-height:13.5pt'><b><i><span style=3D'font-size:9.0pt;mso-bidi-font-size=
:11.0pt;
font-family:"Verdana","sans-serif";mso-fareast-font-family:"Times New Roman=
";
mso-bidi-font-family:"Times New Roman";color:#BDD5DA'>&lt;<span class=3DGra=
mE>body</span>&gt;</span></i></b><span
style=3D'font-size:9.0pt;font-family:"Verdana","sans-serif";mso-fareast-fon=
t-family:
"Times New Roman";mso-bidi-font-family:"Times New Roman";color:#BDD5DA'><o:=
p></o:p></span></p>

<p class=3DMsoNormal style=3D'mso-margin-top-alt:auto;mso-margin-bottom-alt=
:auto;
line-height:13.5pt'><b><i><span style=3D'font-size:9.0pt;mso-bidi-font-size=
:11.0pt;
font-family:"Verdana","sans-serif";mso-fareast-font-family:"Times New Roman=
";
mso-bidi-font-family:"Times New Roman";color:#BDD5DA'>&lt;form <span
class=3DSpellE>runat</span>=3D&quot;server&quot;&gt;</span></i></b><span
style=3D'font-size:9.0pt;font-family:"Verdana","sans-serif";mso-fareast-fon=
t-family:
"Times New Roman";mso-bidi-font-family:"Times New Roman";color:#BDD5DA'><o:=
p></o:p></span></p>

<p class=3DMsoNormal style=3D'mso-margin-top-alt:auto;mso-margin-bottom-alt=
:auto;
line-height:13.5pt'><b><i><span style=3D'font-size:9.0pt;mso-bidi-font-size=
:11.0pt;
font-family:"Verdana","sans-serif";mso-fareast-font-family:"Times New Roman=
";
mso-bidi-font-family:"Times New Roman";color:#BDD5DA'>&lt;<span class=3DSpe=
llE>asp<span
class=3DGramE>:TextBox</span></span> <span class=3DSpellE>runat</span>=3D&q=
uot;server&quot;
/&gt;</span></i></b><span style=3D'font-size:9.0pt;font-family:"Verdana","s=
ans-serif";
mso-fareast-font-family:"Times New Roman";mso-bidi-font-family:"Times New R=
oman";
color:#BDD5DA'><o:p></o:p></span></p>

<p class=3DMsoNormal style=3D'mso-margin-top-alt:auto;mso-margin-bottom-alt=
:auto;
line-height:13.5pt'><b><i><span style=3D'font-size:9.0pt;mso-bidi-font-size=
:11.0pt;
font-family:"Verdana","sans-serif";mso-fareast-font-family:"Times New Roman=
";
mso-bidi-font-family:"Times New Roman";color:#BDD5DA'>&lt;<span class=3DSpe=
llE>asp<span
class=3DGramE>:Button</span></span> <span class=3DSpellE>runat</span>=3D&qu=
ot;server&quot;
</span></i></b><span style=3D'font-size:9.0pt;font-family:"Verdana","sans-s=
erif";
mso-fareast-font-family:"Times New Roman";mso-bidi-font-family:"Times New R=
oman";
color:#BDD5DA'><o:p></o:p></span></p>

<p class=3DMsoNormal style=3D'mso-margin-top-alt:auto;mso-margin-bottom-alt=
:auto;
line-height:13.5pt'><b><i><span style=3D'font-size:9.0pt;mso-bidi-font-size=
:11.0pt;
font-family:"Verdana","sans-serif";mso-fareast-font-family:"Times New Roman=
";
mso-bidi-font-family:"Times New Roman";color:#BDD5DA'>Text=3D&quot;<span
class=3DSpellE>SubmitComment</span>&quot; /&gt;</span></i></b><span
style=3D'font-size:9.0pt;font-family:"Verdana","sans-serif";mso-fareast-fon=
t-family:
"Times New Roman";mso-bidi-font-family:"Times New Roman";color:#BDD5DA'><o:=
p></o:p></span></p>

<p class=3DMsoNormal style=3D'mso-margin-top-alt:auto;mso-margin-bottom-alt=
:auto;
line-height:13.5pt'><b><i><span style=3D'font-size:9.0pt;mso-bidi-font-size=
:11.0pt;
font-family:"Verdana","sans-serif";mso-fareast-font-family:"Times New Roman=
";
mso-bidi-font-family:"Times New Roman";color:#BDD5DA'>&lt;/form&gt;</span><=
/i></b><span
style=3D'font-size:9.0pt;font-family:"Verdana","sans-serif";mso-fareast-fon=
t-family:
"Times New Roman";mso-bidi-font-family:"Times New Roman";color:#BDD5DA'><o:=
p></o:p></span></p>

<p class=3DMsoNormal style=3D'mso-margin-top-alt:auto;mso-margin-bottom-alt=
:auto;
line-height:13.5pt'><b><i><span style=3D'font-size:9.0pt;mso-bidi-font-size=
:11.0pt;
font-family:"Verdana","sans-serif";mso-fareast-font-family:"Times New Roman=
";
mso-bidi-font-family:"Times New Roman";color:#BDD5DA'>&lt;/body&gt;</span><=
/i></b><span
style=3D'font-size:9.0pt;font-family:"Verdana","sans-serif";mso-fareast-fon=
t-family:
"Times New Roman";mso-bidi-font-family:"Times New Roman";color:#BDD5DA'><o:=
p></o:p></span></p>

<p class=3DMsoNormal style=3D'mso-margin-top-alt:auto;mso-margin-bottom-alt=
:auto;
line-height:13.5pt'><b><i><span style=3D'font-size:9.0pt;mso-bidi-font-size=
:11.0pt;
font-family:"Verdana","sans-serif";mso-fareast-font-family:"Times New Roman=
";
mso-bidi-font-family:"Times New Roman";color:#BDD5DA'>&lt;/html&gt;</span><=
/i></b><span
style=3D'font-size:9.0pt;font-family:"Verdana","sans-serif";mso-fareast-fon=
t-family:
"Times New Roman";mso-bidi-font-family:"Times New Roman";color:#BDD5DA'><o:=
p></o:p></span></p>

<p class=3DMsoNormal style=3D'mso-margin-top-alt:auto;mso-margin-bottom-alt=
:auto;
line-height:13.5pt'><span style=3D'font-size:9.0pt;font-family:"Verdana","s=
ans-serif";
mso-fareast-font-family:"Times New Roman";mso-bidi-font-family:"Times New R=
oman";
color:#BDD5DA'>Now an attacker can send malicious request with embedded
JavaScript through the comment textbox which will be executed at the
client&#8217;s browser. To see that this is possible, the above vulnerable
script can be fed with the following input:<o:p></o:p></span></p>

<p class=3DMsoNormal style=3D'mso-margin-top-alt:auto;mso-margin-bottom-alt=
:auto;
line-height:13.5pt'><b><i><span style=3D'font-size:9.0pt;mso-bidi-font-size=
:11.0pt;
font-family:"Verdana","sans-serif";mso-fareast-font-family:"Times New Roman=
";
mso-bidi-font-family:"Times New Roman";color:#BDD5DA'>&lt;<span class=3DGra=
mE>script&gt;</span>alert([removed])&lt;/script&gt;</span></i></b><span
style=3D'font-size:9.0pt;font-family:"Verdana","sans-serif";mso-fareast-fon=
t-family:
"Times New Roman";mso-bidi-font-family:"Times New Roman";color:#BDD5DA'><o:=
p></o:p></span></p>

<p class=3DMsoNormal style=3D'mso-margin-top-alt:auto;mso-margin-bottom-alt=
:auto;
line-height:13.5pt'><span style=3D'font-size:9.0pt;font-family:"Verdana","s=
ans-serif";
mso-fareast-font-family:"Times New Roman";mso-bidi-font-family:"Times New R=
oman";
color:#BDD5DA'>Now this type of script injection attack can be mitigated by
adopting a two tire security approach. User input validation will form the
first tire of security while HTML-encoding on outgoing user data will form a
second layer of security. So we can start assuming that all user input is
malicious and to safely allow restricted HTML input developers/testers shou=
ld
adopt three security approaches as follows:<o:p></o:p></span></p>

<p class=3DMsoNormal style=3D'mso-margin-top-alt:auto;mso-margin-bottom-alt=
:auto;
line-height:13.5pt'><span style=3D'font-size:9.0pt;font-family:"Verdana","s=
ans-serif";
mso-fareast-font-family:"Times New Roman";mso-bidi-font-family:"Times New R=
oman";
color:#BDD5DA'>a)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Add the </span><span
class=3DSpellE><b><span style=3D'font-size:9.0pt;mso-bidi-font-size:11.0pt;
font-family:"Verdana","sans-serif";mso-fareast-font-family:"Times New Roman=
";
mso-bidi-font-family:"Times New Roman";color:#BDD5DA'>ValidateRequest</span=
></b></span><b><span
style=3D'font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:"Verdana","s=
ans-serif";
mso-fareast-font-family:"Times New Roman";mso-bidi-font-family:"Times New R=
oman";
color:#BDD5DA'>=3D&quot;false&quot;</span></b><span style=3D'font-size:9.0p=
t;
font-family:"Verdana","sans-serif";mso-fareast-font-family:"Times New Roman=
";
mso-bidi-font-family:"Times New Roman";color:#BDD5DA'> attribute to the </s=
pan><b><span
style=3D'font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:"Verdana","s=
ans-serif";
mso-fareast-font-family:"Times New Roman";mso-bidi-font-family:"Times New R=
oman";
color:#BDD5DA'>@ Page</span></b><span style=3D'font-size:9.0pt;font-family:=
"Verdana","sans-serif";
mso-fareast-font-family:"Times New Roman";mso-bidi-font-family:"Times New R=
oman";
color:#BDD5DA'> directive to disable the ASP.NET request validation.<o:p></=
o:p></span></p>

<p class=3DMsoNormal style=3D'mso-margin-top-alt:auto;mso-margin-bottom-alt=
:auto;
line-height:13.5pt'><span style=3D'font-size:9.0pt;font-family:"Verdana","s=
ans-serif";
mso-fareast-font-family:"Times New Roman";mso-bidi-font-family:"Times New R=
oman";
color:#BDD5DA'>b)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Encode the string input wit=
h <span
class=3DSpellE>HtmlEncode</span> function.<o:p></o:p></span></p>

<p class=3DMsoNormal style=3D'mso-margin-top-alt:auto;mso-margin-bottom-alt=
:auto;
line-height:13.5pt'><span style=3D'font-size:9.0pt;font-family:"Verdana","s=
ans-serif";
mso-fareast-font-family:"Times New Roman";mso-bidi-font-family:"Times New R=
oman";
color:#BDD5DA'>c)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; White listing approach
can be adopted by using a String Builder and calling its Replace method to
selectively remove the encoding on the HTML elements that you want to permi=
t.<o:p></o:p></span></p>

<p class=3DMsoNormal style=3D'mso-margin-top-alt:auto;mso-margin-bottom-alt=
:auto;
line-height:13.5pt'><span style=3D'font-size:9.0pt;font-family:"Verdana","s=
ans-serif";
mso-fareast-font-family:"Times New Roman";mso-bidi-font-family:"Times New R=
oman";
color:#BDD5DA'>The following .<span class=3DSpellE>aspx</span> code depicts=
 this
as an example.<o:p></o:p></span></p>

<p class=3DMsoNormal style=3D'mso-margin-top-alt:auto;mso-margin-bottom-alt=
:auto;
line-height:13.5pt'><b><i><span style=3D'font-size:9.0pt;mso-bidi-font-size=
:11.0pt;
font-family:"Verdana","sans-serif";mso-fareast-font-family:"Times New Roman=
";
mso-bidi-font-family:"Times New Roman";color:#BDD5DA'>&lt;%@ Page <span
class=3DSpellE>ValidateRequest</span>=3D&quot;false&quot;%&gt;</span></i></=
b><span
style=3D'font-size:9.0pt;font-family:"Verdana","sans-serif";mso-fareast-fon=
t-family:
"Times New Roman";mso-bidi-font-family:"Times New Roman";color:#BDD5DA'><o:=
p></o:p></span></p>

<p class=3DMsoNormal style=3D'mso-margin-top-alt:auto;mso-margin-bottom-alt=
:auto;
line-height:13.5pt'><b><i><span style=3D'font-size:9.0pt;mso-bidi-font-size=
:11.0pt;
font-family:"Verdana","sans-serif";mso-fareast-font-family:"Times New Roman=
";
mso-bidi-font-family:"Times New Roman";color:#BDD5DA'>&lt;script <span
class=3DSpellE>runat</span>=3D&quot;server&quot;&gt;</span></i></b><span
style=3D'font-size:9.0pt;font-family:"Verdana","sans-serif";mso-fareast-fon=
t-family:
"Times New Roman";mso-bidi-font-family:"Times New Roman";color:#BDD5DA'><o:=
p></o:p></span></p>

<p class=3DMsoNormal style=3D'mso-margin-top-alt:auto;mso-margin-bottom-alt=
:auto;
line-height:13.5pt'><span class=3DGramE><b><i><span style=3D'font-size:9.0p=
t;
mso-bidi-font-size:11.0pt;font-family:"Verdana","sans-serif";mso-fareast-fo=
nt-family:
"Times New Roman";mso-bidi-font-family:"Times New Roman";color:#BDD5DA'>voi=
d</span></i></b></span><b><i><span
style=3D'font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:"Verdana","s=
ans-serif";
mso-fareast-font-family:"Times New Roman";mso-bidi-font-family:"Times New R=
oman";
color:#BDD5DA'> <span class=3DSpellE>submitbutton_Click</span>(object sende=
r, <span
class=3DSpellE>EventArgs</span> e)</span></i></b><span style=3D'font-size:9=
.0pt;
font-family:"Verdana","sans-serif";mso-fareast-font-family:"Times New Roman=
";
mso-bidi-font-family:"Times New Roman";color:#BDD5DA'><o:p></o:p></span></p>

<p class=3DMsoNormal style=3D'mso-margin-top-alt:auto;mso-margin-bottom-alt=
:auto;
line-height:13.5pt'><b><i><span style=3D'font-size:9.0pt;mso-bidi-font-size=
:11.0pt;
font-family:"Verdana","sans-serif";mso-fareast-font-family:"Times New Roman=
";
mso-bidi-font-family:"Times New Roman";color:#BDD5DA'>{</span></i></b><span
style=3D'font-size:9.0pt;font-family:"Verdana","sans-serif";mso-fareast-fon=
t-family:
"Times New Roman";mso-bidi-font-family:"Times New Roman";color:#BDD5DA'><o:=
p></o:p></span></p>

<p class=3DMsoNormal style=3D'mso-margin-top-alt:auto;mso-margin-bottom-alt=
:auto;
line-height:13.5pt'><span class=3DSpellE><b><i><span style=3D'font-size:9.0=
pt;
mso-bidi-font-size:11.0pt;font-family:"Verdana","sans-serif";mso-fareast-fo=
nt-family:
"Times New Roman";mso-bidi-font-family:"Times New Roman";color:#BDD5DA'>Str=
ingBuilder</span></i></b></span><b><i><span
style=3D'font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:"Verdana","s=
ans-serif";
mso-fareast-font-family:"Times New Roman";mso-bidi-font-family:"Times New R=
oman";
color:#BDD5DA'> stringbuilder1 =3D new <span class=3DSpellE><span class=3DG=
ramE>StringBuilder</span></span><span
class=3DGramE>(</span></span></i></b><span style=3D'font-size:9.0pt;font-fa=
mily:
"Verdana","sans-serif";mso-fareast-font-family:"Times New Roman";mso-bidi-f=
ont-family:
"Times New Roman";color:#BDD5DA'><o:p></o:p></span></p>

<p class=3DMsoNormal style=3D'mso-margin-top-alt:auto;mso-margin-bottom-alt=
:auto;
line-height:13.5pt'><span class=3DSpellE><span class=3DGramE><b><i><span
style=3D'font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:"Verdana","s=
ans-serif";
mso-fareast-font-family:"Times New Roman";mso-bidi-font-family:"Times New R=
oman";
color:#BDD5DA'>HttpUtility.HtmlEncode</span></i></b></span></span><span
class=3DGramE><b><i><span style=3D'font-size:9.0pt;mso-bidi-font-size:11.0p=
t;
font-family:"Verdana","sans-serif";mso-fareast-font-family:"Times New Roman=
";
mso-bidi-font-family:"Times New Roman";color:#BDD5DA'>(</span></i></b></spa=
n><b><i><span
style=3D'font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:"Verdana","s=
ans-serif";
mso-fareast-font-family:"Times New Roman";mso-bidi-font-family:"Times New R=
oman";
color:#BDD5DA'>Txt1.Text));</span></i></b><span style=3D'font-size:9.0pt;
font-family:"Verdana","sans-serif";mso-fareast-font-family:"Times New Roman=
";
mso-bidi-font-family:"Times New Roman";color:#BDD5DA'><o:p></o:p></span></p>

<p class=3DMsoNormal style=3D'mso-margin-top-alt:auto;mso-margin-bottom-alt=
:auto;
line-height:13.5pt'><b><i><span style=3D'font-size:9.0pt;mso-bidi-font-size=
:11.0pt;
font-family:"Verdana","sans-serif";mso-fareast-font-family:"Times New Roman=
";
mso-bidi-font-family:"Times New Roman";color:#BDD5DA'>// <span class=3DGram=
E>Selectively</span>
allow </span></i></b><i><span style=3D'font-size:9.0pt;mso-bidi-font-size:1=
1.0pt;
font-family:"Verdana","sans-serif";mso-fareast-font-family:"Times New Roman=
";
mso-bidi-font-family:"Times New Roman";color:#BDD5DA'>&lt;b&gt; and &lt;<sp=
an
class=3DSpellE>i</span>&gt;</span></i><span style=3D'font-size:9.0pt;font-f=
amily:
"Verdana","sans-serif";mso-fareast-font-family:"Times New Roman";mso-bidi-f=
ont-family:
"Times New Roman";color:#BDD5DA'><o:p></o:p></span></p>

<p class=3DMsoNormal style=3D'mso-margin-top-alt:auto;mso-margin-bottom-alt=
:auto;
line-height:13.5pt'><span class=3DGramE><i><span style=3D'font-size:9.0pt;
mso-bidi-font-size:11.0pt;font-family:"Verdana","sans-serif";mso-fareast-fo=
nt-family:
"Times New Roman";mso-bidi-font-family:"Times New Roman";color:#BDD5DA'>str=
ingbuilder1.Replace(</span></i></span><i><span
style=3D'font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:"Verdana","s=
ans-serif";
mso-fareast-font-family:"Times New Roman";mso-bidi-font-family:"Times New R=
oman";
color:#BDD5DA'>&quot;&amp;lt;b&amp;gt;&quot;, &quot;&lt;b&gt;&quot;);</span=
></i><span
style=3D'font-size:9.0pt;font-family:"Verdana","sans-serif";mso-fareast-fon=
t-family:
"Times New Roman";mso-bidi-font-family:"Times New Roman";color:#BDD5DA'><o:=
p></o:p></span></p>

<p class=3DMsoNormal style=3D'mso-margin-top-alt:auto;mso-margin-bottom-alt=
:auto;
line-height:13.5pt'><span class=3DGramE><i><span style=3D'font-size:9.0pt;
mso-bidi-font-size:11.0pt;font-family:"Verdana","sans-serif";mso-fareast-fo=
nt-family:
"Times New Roman";mso-bidi-font-family:"Times New Roman";color:#BDD5DA'>str=
ingbuilder1.Replace(</span></i></span><i><span
style=3D'font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:"Verdana","s=
ans-serif";
mso-fareast-font-family:"Times New Roman";mso-bidi-font-family:"Times New R=
oman";
color:#BDD5DA'>&quot;&amp;<span class=3DSpellE>lt</span>;/<span class=3DSpe=
llE>b&amp;gt</span>;&quot;,
&quot;<b>&quot;);</b></span></i><span style=3D'font-size:9.0pt;font-family:=
"Verdana","sans-serif";
mso-fareast-font-family:"Times New Roman";mso-bidi-font-family:"Times New R=
oman";
color:#BDD5DA'><o:p></o:p></span></p>

<p class=3DMsoNormal style=3D'mso-margin-top-alt:auto;mso-margin-bottom-alt=
:auto;
line-height:13.5pt'><span class=3DGramE><i><span style=3D'font-size:9.0pt;
mso-bidi-font-size:11.0pt;font-family:"Verdana","sans-serif";mso-fareast-fo=
nt-family:
"Times New Roman";mso-bidi-font-family:"Times New Roman";color:#BDD5DA'>str=
ingbuilder1<b>.Replace(</b></span></i></span><b><i><span
style=3D'font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:"Verdana","s=
ans-serif";
mso-fareast-font-family:"Times New Roman";mso-bidi-font-family:"Times New R=
oman";
color:#BDD5DA'>&quot;&amp;lt;i&amp;gt;&quot;, &quot;&lt;<span class=3DSpell=
E>i</span>&gt;&quot;);</span></i></b><span
style=3D'font-size:9.0pt;font-family:"Verdana","sans-serif";mso-fareast-fon=
t-family:
"Times New Roman";mso-bidi-font-family:"Times New Roman";color:#BDD5DA'><o:=
p></o:p></span></p>

<p class=3DMsoNormal style=3D'mso-margin-top-alt:auto;mso-margin-bottom-alt=
:auto;
line-height:13.5pt'><span class=3DGramE><i><span style=3D'font-size:9.0pt;
mso-bidi-font-size:11.0pt;font-family:"Verdana","sans-serif";mso-fareast-fo=
nt-family:
"Times New Roman";mso-bidi-font-family:"Times New Roman";color:#BDD5DA'>str=
ingbuilder1<b>.Replace(</b></span></i></span><b><i><span
style=3D'font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:"Verdana","s=
ans-serif";
mso-fareast-font-family:"Times New Roman";mso-bidi-font-family:"Times New R=
oman";
color:#BDD5DA'>&quot;&amp;lt;/i&amp;gt;&quot;, &quot;&quot;);</span></i></b=
><span
style=3D'font-size:9.0pt;font-family:"Verdana","sans-serif";mso-fareast-fon=
t-family:
"Times New Roman";mso-bidi-font-family:"Times New Roman";color:#BDD5DA'><o:=
p></o:p></span></p>

<p class=3DMsoNormal style=3D'mso-margin-top-alt:auto;mso-margin-bottom-alt=
:auto;
line-height:13.5pt'><span class=3DSpellE><span class=3DGramE><b><i><span
style=3D'font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:"Verdana","s=
ans-serif";
mso-fareast-font-family:"Times New Roman";mso-bidi-font-family:"Times New R=
oman";
color:#BDD5DA'>Response.Write</span></i></b></span></span><span class=3DGra=
mE><b><i><span
style=3D'font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:"Verdana","s=
ans-serif";
mso-fareast-font-family:"Times New Roman";mso-bidi-font-family:"Times New R=
oman";
color:#BDD5DA'>(</span></i></b></span><i><span style=3D'font-size:9.0pt;
mso-bidi-font-size:11.0pt;font-family:"Verdana","sans-serif";mso-fareast-fo=
nt-family:
"Times New Roman";mso-bidi-font-family:"Times New Roman";color:#BDD5DA'>str=
ingbuilder1<b>.ToString());</b></span></i><span
style=3D'font-size:9.0pt;font-family:"Verdana","sans-serif";mso-fareast-fon=
t-family:
"Times New Roman";mso-bidi-font-family:"Times New Roman";color:#BDD5DA'><o:=
p></o:p></span></p>

<p class=3DMsoNormal style=3D'mso-margin-top-alt:auto;mso-margin-bottom-alt=
:auto;
line-height:13.5pt'><b><i><span style=3D'font-size:9.0pt;mso-bidi-font-size=
:11.0pt;
font-family:"Verdana","sans-serif";mso-fareast-font-family:"Times New Roman=
";
mso-bidi-font-family:"Times New Roman";color:#BDD5DA'>}</span></i></b><span
style=3D'font-size:9.0pt;font-family:"Verdana","sans-serif";mso-fareast-fon=
t-family:
"Times New Roman";mso-bidi-font-family:"Times New Roman";color:#BDD5DA'><o:=
p></o:p></span></p>

<p class=3DMsoNormal style=3D'mso-margin-top-alt:auto;mso-margin-bottom-alt=
:auto;
line-height:13.5pt'><b><i><span style=3D'font-size:9.0pt;mso-bidi-font-size=
:11.0pt;
font-family:"Verdana","sans-serif";mso-fareast-font-family:"Times New Roman=
";
mso-bidi-font-family:"Times New Roman";color:#BDD5DA'>&lt;/script&gt;</span=
></i></b><span
style=3D'font-size:9.0pt;font-family:"Verdana","sans-serif";mso-fareast-fon=
t-family:
"Times New Roman";mso-bidi-font-family:"Times New Roman";color:#BDD5DA'><o:=
p></o:p></span></p>

<p class=3DMsoNormal style=3D'mso-margin-top-alt:auto;mso-margin-bottom-alt=
:auto;
line-height:13.5pt'><b><i><span style=3D'font-size:9.0pt;mso-bidi-font-size=
:11.0pt;
font-family:"Verdana","sans-serif";mso-fareast-font-family:"Times New Roman=
";
mso-bidi-font-family:"Times New Roman";color:#BDD5DA'>&lt;<span class=3DGra=
mE>html</span>&gt;</span></i></b><span
style=3D'font-size:9.0pt;font-family:"Verdana","sans-serif";mso-fareast-fon=
t-family:
"Times New Roman";mso-bidi-font-family:"Times New Roman";color:#BDD5DA'><o:=
p></o:p></span></p>

<p class=3DMsoNormal style=3D'mso-margin-top-alt:auto;mso-margin-bottom-alt=
:auto;
line-height:13.5pt'><b><i><span style=3D'font-size:9.0pt;mso-bidi-font-size=
:11.0pt;
font-family:"Verdana","sans-serif";mso-fareast-font-family:"Times New Roman=
";
mso-bidi-font-family:"Times New Roman";color:#BDD5DA'>&lt;<span class=3DGra=
mE>body</span>&gt;</span></i></b><span
style=3D'font-size:9.0pt;font-family:"Verdana","sans-serif";mso-fareast-fon=
t-family:
"Times New Roman";mso-bidi-font-family:"Times New Roman";color:#BDD5DA'><o:=
p></o:p></span></p>

<p class=3DMsoNormal style=3D'mso-margin-top-alt:auto;mso-margin-bottom-alt=
:auto;
line-height:13.5pt'><b><i><span style=3D'font-size:9.0pt;mso-bidi-font-size=
:11.0pt;
font-family:"Verdana","sans-serif";mso-fareast-font-family:"Times New Roman=
";
mso-bidi-font-family:"Times New Roman";color:#BDD5DA'>&lt;form <span
class=3DSpellE>runat</span>=3D&quot;server&quot;&gt;</span></i></b><span
style=3D'font-size:9.0pt;font-family:"Verdana","sans-serif";mso-fareast-fon=
t-family:
"Times New Roman";mso-bidi-font-family:"Times New Roman";color:#BDD5DA'><o:=
p></o:p></span></p>

<p class=3DMsoNormal style=3D'mso-margin-top-alt:auto;mso-margin-bottom-alt=
:auto;
line-height:13.5pt'><b><i><span style=3D'font-size:9.0pt;mso-bidi-font-size=
:11.0pt;
font-family:"Verdana","sans-serif";mso-fareast-font-family:"Times New Roman=
";
mso-bidi-font-family:"Times New Roman";color:#BDD5DA'>&lt;<span class=3DGra=
mE>div</span>&gt;</span></i></b><span
style=3D'font-size:9.0pt;font-family:"Verdana","sans-serif";mso-fareast-fon=
t-family:
"Times New Roman";mso-bidi-font-family:"Times New Roman";color:#BDD5DA'><o:=
p></o:p></span></p>

<p class=3DMsoNormal style=3D'mso-margin-top-alt:auto;mso-margin-bottom-alt=
:auto;
line-height:13.5pt'><b><i><span style=3D'font-size:9.0pt;mso-bidi-font-size=
:11.0pt;
font-family:"Verdana","sans-serif";mso-fareast-font-family:"Times New Roman=
";
mso-bidi-font-family:"Times New Roman";color:#BDD5DA'>&lt;<span class=3DSpe=
llE>asp<span
class=3DGramE>:TextBox</span></span> <span class=3DSpellE>Runat</span>=3D&q=
uot;server&quot;
</span></i></b><span style=3D'font-size:9.0pt;font-family:"Verdana","sans-s=
erif";
mso-fareast-font-family:"Times New Roman";mso-bidi-font-family:"Times New R=
oman";
color:#BDD5DA'><o:p></o:p></span></p>

<p class=3DMsoNormal style=3D'mso-margin-top-alt:auto;mso-margin-bottom-alt=
:auto;
line-height:13.5pt'><span class=3DSpellE><b><i><span style=3D'font-size:9.0=
pt;
mso-bidi-font-size:11.0pt;font-family:"Verdana","sans-serif";mso-fareast-fo=
nt-family:
"Times New Roman";mso-bidi-font-family:"Times New Roman";color:#BDD5DA'>Tex=
tMode</span></i></b></span><b><i><span
style=3D'font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:"Verdana","s=
ans-serif";
mso-fareast-font-family:"Times New Roman";mso-bidi-font-family:"Times New R=
oman";
color:#BDD5DA'>=3D&quot;<span class=3DSpellE>MultiLine</span>&quot;
Width=3D&quot;318px&quot;</span></i></b><span style=3D'font-size:9.0pt;font=
-family:
"Verdana","sans-serif";mso-fareast-font-family:"Times New Roman";mso-bidi-f=
ont-family:
"Times New Roman";color:#BDD5DA'><o:p></o:p></span></p>

<p class=3DMsoNormal style=3D'mso-margin-top-alt:auto;mso-margin-bottom-alt=
:auto;
line-height:13.5pt'><b><i><span style=3D'font-size:9.0pt;mso-bidi-font-size=
:11.0pt;
font-family:"Verdana","sans-serif";mso-fareast-font-family:"Times New Roman=
";
mso-bidi-font-family:"Times New Roman";color:#BDD5DA'>Height=3D&quot;168px&=
quot;&gt;&lt;/<span
class=3DSpellE>asp<span class=3DGramE>:TextBox</span></span>&gt;</span></i>=
</b><span
style=3D'font-size:9.0pt;font-family:"Verdana","sans-serif";mso-fareast-fon=
t-family:
"Times New Roman";mso-bidi-font-family:"Times New Roman";color:#BDD5DA'><o:=
p></o:p></span></p>

<p class=3DMsoNormal style=3D'mso-margin-top-alt:auto;mso-margin-bottom-alt=
:auto;
line-height:13.5pt'><b><i><span style=3D'font-size:9.0pt;mso-bidi-font-size=
:11.0pt;
font-family:"Verdana","sans-serif";mso-fareast-font-family:"Times New Roman=
";
mso-bidi-font-family:"Times New Roman";color:#BDD5DA'>&lt;<span class=3DSpe=
llE>asp<span
class=3DGramE>:Button</span></span> <span class=3DSpellE>Runat</span>=3D&qu=
ot;server&quot;
</span></i></b><span style=3D'font-size:9.0pt;font-family:"Verdana","sans-s=
erif";
mso-fareast-font-family:"Times New Roman";mso-bidi-font-family:"Times New R=
oman";
color:#BDD5DA'><o:p></o:p></span></p>

<p class=3DMsoNormal style=3D'mso-margin-top-alt:auto;mso-margin-bottom-alt=
:auto;
line-height:13.5pt'><b><i><span style=3D'font-size:9.0pt;mso-bidi-font-size=
:11.0pt;
font-family:"Verdana","sans-serif";mso-fareast-font-family:"Times New Roman=
";
mso-bidi-font-family:"Times New Roman";color:#BDD5DA'>Text=3D&quot;Submit&q=
uot; <span
class=3DSpellE>OnClick</span>=3D&quot;<span class=3DSpellE>submitbutton_Cli=
ck</span>&quot;
/&gt;</span></i></b><span style=3D'font-size:9.0pt;font-family:"Verdana","s=
ans-serif";
mso-fareast-font-family:"Times New Roman";mso-bidi-font-family:"Times New R=
oman";
color:#BDD5DA'><o:p></o:p></span></p>

<p class=3DMsoNormal style=3D'mso-margin-top-alt:auto;mso-margin-bottom-alt=
:auto;
line-height:13.5pt'><b><i><span style=3D'font-size:9.0pt;mso-bidi-font-size=
:11.0pt;
font-family:"Verdana","sans-serif";mso-fareast-font-family:"Times New Roman=
";
mso-bidi-font-family:"Times New Roman";color:#BDD5DA'>&lt;/div&gt;</span></=
i></b><span
style=3D'font-size:9.0pt;font-family:"Verdana","sans-serif";mso-fareast-fon=
t-family:
"Times New Roman";mso-bidi-font-family:"Times New Roman";color:#BDD5DA'><o:=
p></o:p></span></p>

<p class=3DMsoNormal style=3D'mso-margin-top-alt:auto;mso-margin-bottom-alt=
:auto;
line-height:13.5pt'><b><i><span style=3D'font-size:9.0pt;mso-bidi-font-size=
:11.0pt;
font-family:"Verdana","sans-serif";mso-fareast-font-family:"Times New Roman=
";
mso-bidi-font-family:"Times New Roman";color:#BDD5DA'>&lt;/form&gt;</span><=
/i></b><span
style=3D'font-size:9.0pt;font-family:"Verdana","sans-serif";mso-fareast-fon=
t-family:
"Times New Roman";mso-bidi-font-family:"Times New Roman";color:#BDD5DA'><o:=
p></o:p></span></p>

<p class=3DMsoNormal style=3D'mso-margin-top-alt:auto;mso-margin-bottom-alt=
:auto;
line-height:13.5pt'><b><i><span style=3D'font-size:9.0pt;mso-bidi-font-size=
:11.0pt;
font-family:"Verdana","sans-serif";mso-fareast-font-family:"Times New Roman=
";
mso-bidi-font-family:"Times New Roman";color:#BDD5DA'>&lt;/body&gt;</span><=
/i></b><span
style=3D'font-size:9.0pt;font-family:"Verdana","sans-serif";mso-fareast-fon=
t-family:
"Times New Roman";mso-bidi-font-family:"Times New Roman";color:#BDD5DA'><o:=
p></o:p></span></p>

<p class=3DMsoNormal style=3D'mso-margin-top-alt:auto;mso-margin-bottom-alt=
:auto;
line-height:13.5pt'><span style=3D'font-size:9.0pt;font-family:"Verdana","s=
ans-serif";
mso-fareast-font-family:"Times New Roman";mso-bidi-font-family:"Times New R=
oman";
color:#BDD5DA'>The above .<span class=3DSpellE>aspx</span> page code shows =
this
approach. The page disables ASP.NET request validation by setting </span><s=
pan
class=3DSpellE><b><span style=3D'font-size:9.0pt;mso-bidi-font-size:11.0pt;
font-family:"Verdana","sans-serif";mso-fareast-font-family:"Times New Roman=
";
mso-bidi-font-family:"Times New Roman";color:#BDD5DA'>ValidateRequest</span=
></b></span><b><span
style=3D'font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:"Verdana","s=
ans-serif";
mso-fareast-font-family:"Times New Roman";mso-bidi-font-family:"Times New R=
oman";
color:#BDD5DA'>=3D&quot;false&quot;</span></b><span style=3D'font-size:9.0p=
t;
font-family:"Verdana","sans-serif";mso-fareast-font-family:"Times New Roman=
";
mso-bidi-font-family:"Times New Roman";color:#BDD5DA'>. It HTML-encodes the
input and then selectively allows the &lt;</span><b><span style=3D'font-siz=
e:
9.0pt;mso-bidi-font-size:11.0pt;font-family:"Verdana","sans-serif";mso-fare=
ast-font-family:
"Times New Roman";mso-bidi-font-family:"Times New Roman";color:#BDD5DA'>b</=
span></b><span
style=3D'font-size:9.0pt;font-family:"Verdana","sans-serif";mso-fareast-fon=
t-family:
"Times New Roman";mso-bidi-font-family:"Times New Roman";color:#BDD5DA'>&gt;
and &lt;</span><span class=3DSpellE><b><span style=3D'font-size:9.0pt;mso-b=
idi-font-size:
11.0pt;font-family:"Verdana","sans-serif";mso-fareast-font-family:"Times Ne=
w Roman";
mso-bidi-font-family:"Times New Roman";color:#BDD5DA'>i</span></b></span><s=
pan
style=3D'font-size:9.0pt;font-family:"Verdana","sans-serif";mso-fareast-fon=
t-family:
"Times New Roman";mso-bidi-font-family:"Times New Roman";color:#BDD5DA'>&gt;
HTML elements to support simple text formatting.<o:p></o:p></span></p>

<p class=3DMsoNormal style=3D'mso-margin-top-alt:auto;mso-margin-bottom-alt=
:auto;
line-height:13.5pt'><span style=3D'font-size:9.0pt;font-family:"Verdana","s=
ans-serif";
mso-fareast-font-family:"Times New Roman";mso-bidi-font-family:"Times New R=
oman";
color:#BDD5DA'>Now the second tire of security can be brought into the fram=
e by
encoding the output to know that the text contains HTML special characters =
or
not.<o:p></o:p></span></p>

<p class=3DMsoNormal style=3D'margin-bottom:0in;margin-bottom:.0001pt;line-=
height:
13.5pt'><span class=3DSpellE><span class=3DGramE><b><i><span style=3D'font-=
size:9.0pt;
mso-bidi-font-size:11.0pt;font-family:"Verdana","sans-serif";mso-fareast-fo=
nt-family:
"Times New Roman";mso-bidi-font-family:"Times New Roman";color:#BDD5DA'>Res=
ponse.Write</span></i></b></span></span><span
class=3DGramE><b><i><span style=3D'font-size:9.0pt;mso-bidi-font-size:11.0p=
t;
font-family:"Verdana","sans-serif";mso-fareast-font-family:"Times New Roman=
";
mso-bidi-font-family:"Times New Roman";color:#BDD5DA'>(</span></i></b></spa=
n><span
class=3DSpellE><b><i><span style=3D'font-size:9.0pt;mso-bidi-font-size:11.0=
pt;
font-family:"Verdana","sans-serif";mso-fareast-font-family:"Times New Roman=
";
mso-bidi-font-family:"Times New Roman";color:#BDD5DA'>HttpUtility.HtmlEncod=
e</span></i></b></span><b><i><span
style=3D'font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:"Verdana","s=
ans-serif";
mso-fareast-font-family:"Times New Roman";mso-bidi-font-family:"Times New R=
oman";
color:#BDD5DA'>(<span class=3DSpellE>Request.Form</span>[&quot;text&quot;])=
);</span></i></b><span
style=3D'font-size:9.0pt;font-family:"Verdana","sans-serif";mso-fareast-fon=
t-family:
"Times New Roman";mso-bidi-font-family:"Times New Roman";color:#BDD5DA'> </=
span><b><i><span
style=3D'font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:"Verdana","s=
ans-serif";
mso-fareast-font-family:"Times New Roman";mso-bidi-font-family:"Times New R=
oman";
color:#BDD5DA'>&nbsp;</span></i></b><span style=3D'font-size:9.0pt;font-fam=
ily:
"Verdana","sans-serif";mso-fareast-font-family:"Times New Roman";mso-bidi-f=
ont-family:
"Times New Roman";color:#BDD5DA'> Or in case of URL strings that contain in=
put to
the client. </span><b><i><span style=3D'font-size:9.0pt;mso-bidi-font-size:=
11.0pt;
font-family:"Verdana","sans-serif";mso-fareast-font-family:"Times New Roman=
";
mso-bidi-font-family:"Times New Roman";color:#BDD5DA'>&nbsp;</span></i></b>=
<span
style=3D'font-size:9.0pt;font-family:"Verdana","sans-serif";mso-fareast-fon=
t-family:
"Times New Roman";mso-bidi-font-family:"Times New Roman";color:#BDD5DA'> <o=
:p></o:p></span></p>

<p class=3DMsoNormal style=3D'mso-margin-top-alt:auto;mso-margin-bottom-alt=
:auto;
line-height:13.5pt'><span class=3DSpellE><span class=3DGramE><b><i><span
style=3D'font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:"Verdana","s=
ans-serif";
mso-fareast-font-family:"Times New Roman";mso-bidi-font-family:"Times New R=
oman";
color:#BDD5DA'>Response.Write</span></i></b></span></span><span class=3DGra=
mE><b><i><span
style=3D'font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:"Verdana","s=
ans-serif";
mso-fareast-font-family:"Times New Roman";mso-bidi-font-family:"Times New R=
oman";
color:#BDD5DA'>(</span></i></b></span><span class=3DSpellE><b><i><span
style=3D'font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:"Verdana","s=
ans-serif";
mso-fareast-font-family:"Times New Roman";mso-bidi-font-family:"Times New R=
oman";
color:#BDD5DA'>HttpUtility.UrlEncode</span></i></b></span><b><i><span
style=3D'font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:"Verdana","s=
ans-serif";
mso-fareast-font-family:"Times New Roman";mso-bidi-font-family:"Times New R=
oman";
color:#BDD5DA'>(<span class=3DSpellE>urlString</span>));</span></i></b><span
style=3D'font-size:9.0pt;font-family:"Verdana","sans-serif";mso-fareast-fon=
t-family:
"Times New Roman";mso-bidi-font-family:"Times New Roman";color:#BDD5DA'><o:=
p></o:p></span></p>

<p class=3DMsoNormal style=3D'margin-bottom:0in;margin-bottom:.0001pt;line-=
height:
13.5pt'><b><i><span style=3D'font-size:9.0pt;mso-bidi-font-size:11.0pt;
font-family:"Verdana","sans-serif";mso-fareast-font-family:"Times New Roman=
";
mso-bidi-font-family:"Times New Roman";color:#BDD5DA'>&nbsp;</span></i></b>=
<span
style=3D'font-size:9.0pt;font-family:"Verdana","sans-serif";mso-fareast-fon=
t-family:
"Times New Roman";mso-bidi-font-family:"Times New Roman";color:#BDD5DA'> <o=
:p></o:p></span></p>

<p class=3DMsoNormal style=3D'mso-margin-top-alt:auto;mso-margin-bottom-alt=
:auto;
line-height:13.5pt'><span style=3D'font-size:9.0pt;font-family:"Verdana","s=
ans-serif";
mso-fareast-font-family:"Times New Roman";mso-bidi-font-family:"Times New R=
oman";
color:#BDD5DA'>As a result, the HTML response stream of the malicious input=
 </span><b><i><span
style=3D'font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:"Verdana","s=
ans-serif";
mso-fareast-font-family:"Times New Roman";mso-bidi-font-family:"Times New R=
oman";
color:#BDD5DA'>&lt;script&gt;<span class=3DGramE>alert(</span>[removed])&lt=
;/script&gt;
</span></i></b><span style=3D'font-size:9.0pt;font-family:"Verdana","sans-s=
erif";
mso-fareast-font-family:"Times New Roman";mso-bidi-font-family:"Times New R=
oman";
color:#BDD5DA'>will look like this<o:p></o:p></span></p>

<p class=3DMsoNormal style=3D'mso-margin-top-alt:auto;mso-margin-bottom-alt=
:auto;
line-height:13.5pt'><b><i><span style=3D'font-size:9.0pt;mso-bidi-font-size=
:11.0pt;
font-family:"Verdana","sans-serif";mso-fareast-font-family:"Times New Roman=
";
mso-bidi-font-family:"Times New Roman";color:#BDD5DA'>&amp;<span class=3DSp=
ellE>lt<span
class=3DGramE>;script</span>&amp;gt;alert</span>([removed])&amp;<span
class=3DSpellE>lt</span>;/<span class=3DSpellE>script&amp;gt</span>;</span>=
</i></b><span
style=3D'font-size:9.0pt;font-family:"Verdana","sans-serif";mso-fareast-fon=
t-family:
"Times New Roman";mso-bidi-font-family:"Times New Roman";color:#BDD5DA'><o:=
p></o:p></span></p>

<p class=3DMsoNormal style=3D'mso-margin-top-alt:auto;mso-margin-bottom-alt=
:auto;
line-height:13.5pt'><span style=3D'font-size:9.0pt;font-family:"Verdana","s=
ans-serif";
mso-fareast-font-family:"Times New Roman";mso-bidi-font-family:"Times New R=
oman";
color:#BDD5DA'>This will ultimately restrict the browser to execute the <sp=
an
class=3DSpellE>Javascript</span> code because no HTL &lt;script&gt; tag is
present any more in the <span class=3DSpellE>response.The</span> greater-th=
an and
less-than symbols are replaced by their HTML-encoded <span class=3DSpellE>o=
utput,&amp;lt</span>;
and &amp;gt; respectively.<o:p></o:p></span></p>

<p class=3DMsoNormal style=3D'mso-margin-top-alt:auto;mso-margin-bottom-alt=
:auto;
line-height:13.5pt'><span style=3D'font-size:9.0pt;font-family:"Verdana","s=
ans-serif";
mso-fareast-font-family:"Times New Roman";mso-bidi-font-family:"Times New R=
oman";
color:#BDD5DA'>In addition to this two tire security approach discussed abo=
ve,
we can also use the following countermeasures to prevent cross site scripti=
ng
as further safe guards.<o:p></o:p></span></p>

<p class=3DMsoNormal style=3D'mso-margin-top-alt:auto;mso-margin-bottom-alt=
:auto;
line-height:13.5pt'><b><span style=3D'font-size:9.0pt;mso-bidi-font-size:11=
.0pt;
font-family:"Verdana","sans-serif";mso-fareast-font-family:"Times New Roman=
";
mso-bidi-font-family:"Times New Roman";color:#BDD5DA'>Setting the correct
character encoding:</span></b><span style=3D'font-size:9.0pt;font-family:"V=
erdana","sans-serif";
mso-fareast-font-family:"Times New Roman";mso-bidi-font-family:"Times New R=
oman";
color:#BDD5DA'><o:p></o:p></span></p>

<p class=3DMsoNormal style=3D'mso-margin-top-alt:auto;mso-margin-bottom-alt=
:auto;
line-height:13.5pt'><span style=3D'font-size:9.0pt;font-family:"Verdana","s=
ans-serif";
mso-fareast-font-family:"Times New Roman";mso-bidi-font-family:"Times New R=
oman";
color:#BDD5DA'>Character encoding can be done in page level or in configura=
tion
level. To set the Character encoding at the page level we can use </span><b=
><span
style=3D'font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:"Verdana","s=
ans-serif";
mso-fareast-font-family:"Times New Roman";mso-bidi-font-family:"Times New R=
oman";
color:#BDD5DA'>&lt;<span class=3DGramE>meta</span>&gt;</span></b><span
style=3D'font-size:9.0pt;font-family:"Verdana","sans-serif";mso-fareast-fon=
t-family:
"Times New Roman";mso-bidi-font-family:"Times New Roman";color:#BDD5DA'>
element or the </span><span class=3DSpellE><b><span style=3D'font-size:9.0p=
t;
mso-bidi-font-size:11.0pt;font-family:"Verdana","sans-serif";mso-fareast-fo=
nt-family:
"Times New Roman";mso-bidi-font-family:"Times New Roman";color:#BDD5DA'>Res=
ponseEncoding</span></b></span><span
style=3D'font-size:9.0pt;font-family:"Verdana","sans-serif";mso-fareast-fon=
t-family:
"Times New Roman";mso-bidi-font-family:"Times New Roman";color:#BDD5DA'>
page-level attribute as follows:<o:p></o:p></span></p>

<p class=3DMsoNormal style=3D'margin-bottom:0in;margin-bottom:.0001pt;line-=
height:
13.5pt'><b><i><span style=3D'font-size:9.0pt;mso-bidi-font-size:11.0pt;
font-family:"Verdana","sans-serif";mso-fareast-font-family:"Times New Roman=
";
mso-bidi-font-family:"Times New Roman";color:#BDD5DA'>&lt;% @ Page <span
class=3DSpellE>ResponseEncoding</span>=3D&quot;iso-8859-1&quot; %&gt;</span=
></i></b><span
style=3D'font-size:9.0pt;font-family:"Verdana","sans-serif";mso-fareast-fon=
t-family:
"Times New Roman";mso-bidi-font-family:"Times New Roman";color:#BDD5DA'> </=
span><b><i><span
style=3D'font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:"Verdana","s=
ans-serif";
mso-fareast-font-family:"Times New Roman";mso-bidi-font-family:"Times New R=
oman";
color:#BDD5DA'>R</span></i></b><span style=3D'font-size:9.0pt;font-family:"=
Verdana","sans-serif";
mso-fareast-font-family:"Times New Roman";mso-bidi-font-family:"Times New R=
oman";
color:#BDD5DA'> </span><b><i><span style=3D'font-size:9.0pt;mso-bidi-font-s=
ize:
11.0pt;font-family:"Verdana","sans-serif";mso-fareast-font-family:"Times Ne=
w Roman";
mso-bidi-font-family:"Times New Roman";color:#BDD5DA'>&lt;<span class=3DGra=
mE>meta</span>
http-equiv=3D&quot;Content Type&quot;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;content=3D&quot;text/html; <span
class=3DSpellE>charset</span>=3DISO-8859-1&quot; /&gt;</span></i></b><span
style=3D'font-size:9.0pt;font-family:"Verdana","sans-serif";mso-fareast-fon=
t-family:
"Times New Roman";mso-bidi-font-family:"Times New Roman";color:#BDD5DA'> </=
span><b><i><span
style=3D'font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:"Verdana","s=
ans-serif";
mso-fareast-font-family:"Times New Roman";mso-bidi-font-family:"Times New R=
oman";
color:#BDD5DA'>&nbsp;</span></i></b><span style=3D'font-size:9.0pt;font-fam=
ily:
"Verdana","sans-serif";mso-fareast-font-family:"Times New Roman";mso-bidi-f=
ont-family:
"Times New Roman";color:#BDD5DA'> <o:p></o:p></span></p>

<p class=3DMsoNormal style=3D'mso-margin-top-alt:auto;mso-margin-bottom-alt=
:auto;
line-height:13.5pt'><span style=3D'font-size:9.0pt;font-family:"Verdana","s=
ans-serif";
mso-fareast-font-family:"Times New Roman";mso-bidi-font-family:"Times New R=
oman";
color:#BDD5DA'>To set the Character encoding at the configuration level we =
have
to bring certain changes in <span class=3DSpellE>Web.config</span> file as
follows:<o:p></o:p></span></p>

<p class=3DMsoNormal style=3D'margin-bottom:0in;margin-bottom:.0001pt;line-=
height:
13.5pt'><b><i><span style=3D'font-size:9.0pt;mso-bidi-font-size:11.0pt;
font-family:"Verdana","sans-serif";mso-fareast-font-family:"Times New Roman=
";
mso-bidi-font-family:"Times New Roman";color:#BDD5DA'>&lt;<span class=3DGra=
mE>configuration</span>&gt;</span></i></b><span
style=3D'font-size:9.0pt;font-family:"Verdana","sans-serif";mso-fareast-fon=
t-family:
"Times New Roman";mso-bidi-font-family:"Times New Roman";color:#BDD5DA'> </=
span><b><i><span
style=3D'font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:"Verdana","s=
ans-serif";
mso-fareast-font-family:"Times New Roman";mso-bidi-font-family:"Times New R=
oman";
color:#BDD5DA'>&nbsp;&nbsp; &lt;system.web&gt;</span></i></b><span
style=3D'font-size:9.0pt;font-family:"Verdana","sans-serif";mso-fareast-fon=
t-family:
"Times New Roman";mso-bidi-font-family:"Times New Roman";color:#BDD5DA'> </=
span><b><i><span
style=3D'font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:"Verdana","s=
ans-serif";
mso-fareast-font-family:"Times New Roman";mso-bidi-font-family:"Times New R=
oman";
color:#BDD5DA'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;globalization
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class=3DSpellE>=
requestEncoding</span>=3D&quot;iso-8859-1&quot;</span></i></b><span
style=3D'font-size:9.0pt;font-family:"Verdana","sans-serif";mso-fareast-fon=
t-family:
"Times New Roman";mso-bidi-font-family:"Times New Roman";color:#BDD5DA'> </=
span><b><i><span
style=3D'font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:"Verdana","s=
ans-serif";
mso-fareast-font-family:"Times New Roman";mso-bidi-font-family:"Times New R=
oman";
color:#BDD5DA'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span
class=3DSpellE>responseEncoding</span>=3D&quot;iso-8859-1&quot;/&gt;</span>=
</i></b><span
style=3D'font-size:9.0pt;font-family:"Verdana","sans-serif";mso-fareast-fon=
t-family:
"Times New Roman";mso-bidi-font-family:"Times New Roman";color:#BDD5DA'> </=
span><b><i><span
style=3D'font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:"Verdana","s=
ans-serif";
mso-fareast-font-family:"Times New Roman";mso-bidi-font-family:"Times New R=
oman";
color:#BDD5DA'>&nbsp;&nbsp; &lt;/system.web&gt;</span></i></b><span
style=3D'font-size:9.0pt;font-family:"Verdana","sans-serif";mso-fareast-fon=
t-family:
"Times New Roman";mso-bidi-font-family:"Times New Roman";color:#BDD5DA'> </=
span><b><i><span
style=3D'font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:"Verdana","s=
ans-serif";
mso-fareast-font-family:"Times New Roman";mso-bidi-font-family:"Times New R=
oman";
color:#BDD5DA'>&lt;/configuration&gt;</span></i></b><span style=3D'font-siz=
e:
9.0pt;font-family:"Verdana","sans-serif";mso-fareast-font-family:"Times New=
 Roman";
mso-bidi-font-family:"Times New Roman";color:#BDD5DA'> <o:p></o:p></span></=
p>

<p class=3DMsoNormal style=3D'mso-margin-top-alt:auto;mso-margin-bottom-alt=
:auto;
line-height:13.5pt'><b><span style=3D'font-size:9.0pt;mso-bidi-font-size:11=
.0pt;
font-family:"Verdana","sans-serif";mso-fareast-font-family:"Times New Roman=
";
mso-bidi-font-family:"Times New Roman";color:#BDD5DA'>Use white listing
approach rather than black listing:</span></b><span style=3D'font-size:9.0p=
t;
font-family:"Verdana","sans-serif";mso-fareast-font-family:"Times New Roman=
";
mso-bidi-font-family:"Times New Roman";color:#BDD5DA'><o:p></o:p></span></p>

<p class=3DMsoNormal style=3D'mso-margin-top-alt:auto;mso-margin-bottom-alt=
:auto;
line-height:13.5pt'><span style=3D'font-size:9.0pt;font-family:"Verdana","s=
ans-serif";
mso-fareast-font-family:"Times New Roman";mso-bidi-font-family:"Times New R=
oman";
color:#BDD5DA'>Sanitizing user input by filtering out known malicious
characters is a common practice. But we should not rely on this approach
because an attacker can usually find an alternative means of bypassing your
validation. Instead, your code should check for known secure, safe input. T=
here
are other safe ways of representing these malicious characters. For example
&lt; (less than) and &gt; (greater than) can be represented as &amp;<span
class=3DSpellE>lt</span>; and &amp;gt; respectively.<o:p></o:p></span></p>

<p class=3DMsoNormal style=3D'mso-margin-top-alt:auto;mso-margin-bottom-alt=
:auto;
line-height:13.5pt'><b><span style=3D'font-size:9.0pt;mso-bidi-font-size:11=
.0pt;
font-family:"Verdana","sans-serif";mso-fareast-font-family:"Times New Roman=
";
mso-bidi-font-family:"Times New Roman";color:#BDD5DA'>Using the <span
class=3DSpellE>HttpOnly</span> Cookie Option:</span></b><span style=3D'font=
-size:
9.0pt;font-family:"Verdana","sans-serif";mso-fareast-font-family:"Times New=
 Roman";
mso-bidi-font-family:"Times New Roman";color:#BDD5DA'><o:p></o:p></span></p>

<p class=3DMsoNormal style=3D'mso-margin-top-alt:auto;mso-margin-bottom-alt=
:auto;
line-height:13.5pt'><span class=3DSpellE><span style=3D'font-size:9.0pt;fon=
t-family:
"Verdana","sans-serif";mso-fareast-font-family:"Times New Roman";mso-bidi-f=
ont-family:
"Times New Roman";color:#BDD5DA'>HttpOnly</span></span><span style=3D'font-=
size:
9.0pt;font-family:"Verdana","sans-serif";mso-fareast-font-family:"Times New=
 Roman";
mso-bidi-font-family:"Times New Roman";color:#BDD5DA'> cookie attribute is
supported by Internet Explorer 6 Service Pack 1 and later, which prevents
client-side scripts from accessing a cookie from the [removed] property.
Instead, the script returns an empty string. The cookie is still sent to the
server whenever the user browses to a </span><span style=3D'color:#BDD5DA'>=
<a
href=3D"http://www.articlesbase.com/security-articles/secure-aspnet-coding-=
practice-for-three-most-critical-vulnerabilities-in-web-application-889853.=
html"
target=3D"_new"><span style=3D'font-size:9.0pt;mso-bidi-font-size:11.0pt;
font-family:"Verdana","sans-serif";mso-fareast-font-family:"Times New Roman=
";
mso-bidi-font-family:"Times New Roman";color:#BDD5DA'>Web site</span></a></=
span><span
style=3D'font-size:9.0pt;font-family:"Verdana","sans-serif";mso-fareast-fon=
t-family:
"Times New Roman";mso-bidi-font-family:"Times New Roman";color:#BDD5DA'> in=
 the
current domain.<o:p></o:p></span></p>

<p class=3DMsoNormal style=3D'mso-margin-top-alt:auto;mso-margin-bottom-alt=
:auto;
line-height:13.5pt'><b><span style=3D'font-size:9.0pt;mso-bidi-font-size:11=
.0pt;
font-family:"Verdana","sans-serif";mso-fareast-font-family:"Times New Roman=
";
mso-bidi-font-family:"Times New Roman";color:#BDD5DA'>SQL Injection:</span>=
</b><span
style=3D'font-size:9.0pt;font-family:"Verdana","sans-serif";mso-fareast-fon=
t-family:
"Times New Roman";mso-bidi-font-family:"Times New Roman";color:#BDD5DA'><o:=
p></o:p></span></p>

<p class=3DMsoNormal style=3D'mso-margin-top-alt:auto;mso-margin-bottom-alt=
:auto;
line-height:13.5pt'><span style=3D'font-size:9.0pt;font-family:"Verdana","s=
ans-serif";
mso-fareast-font-family:"Times New Roman";mso-bidi-font-family:"Times New R=
oman";
color:#BDD5DA'>Secure coding practice in ASP.NET against SQL injection
vulnerability should focus on the following countermeasures:<o:p></o:p></sp=
an></p>

<p class=3DMsoNormal style=3D'mso-margin-top-alt:auto;mso-margin-bottom-alt=
:auto;
line-height:13.5pt'><b><span style=3D'font-size:9.0pt;mso-bidi-font-size:11=
.0pt;
font-family:"Verdana","sans-serif";mso-fareast-font-family:"Times New Roman=
";
mso-bidi-font-family:"Times New Roman";color:#BDD5DA'>Constrain user suppli=
ed
input</span></b><span style=3D'font-size:9.0pt;font-family:"Verdana","sans-=
serif";
mso-fareast-font-family:"Times New Roman";mso-bidi-font-family:"Times New R=
oman";
color:#BDD5DA'><o:p></o:p></span></p>

<p class=3DMsoNormal style=3D'mso-margin-top-alt:auto;mso-margin-bottom-alt=
:auto;
line-height:13.5pt'><span style=3D'font-size:9.0pt;font-family:"Verdana","s=
ans-serif";
mso-fareast-font-family:"Times New Roman";mso-bidi-font-family:"Times New R=
oman";
color:#BDD5DA'>Before applying any countermeasure at the code level we shou=
ld
be concerned about the potential risk associated with denying a list of
unacceptable characters (blacklisting) because it is always possible to
overlook an unacceptable character when defining the list. Also this kind of
validation approach can be easily bypassed by representing an unacceptable
character in an alternate format.<o:p></o:p></span></p>

<p class=3DMsoNormal style=3D'mso-margin-top-alt:auto;mso-margin-bottom-alt=
:auto;
line-height:13.5pt'><span style=3D'font-size:9.0pt;font-family:"Verdana","s=
ans-serif";
mso-fareast-font-family:"Times New Roman";mso-bidi-font-family:"Times New R=
oman";
color:#BDD5DA'>ASP.NET server side <span class=3DSpellE>validator</span>
controls, such as the </span><span class=3DSpellE><b><span style=3D'font-si=
ze:9.0pt;
mso-bidi-font-size:11.0pt;font-family:"Verdana","sans-serif";mso-fareast-fo=
nt-family:
"Times New Roman";mso-bidi-font-family:"Times New Roman";color:#BDD5DA'>Reg=
ularExpressionValidator</span></b></span><span
style=3D'font-size:9.0pt;font-family:"Verdana","sans-serif";mso-fareast-fon=
t-family:
"Times New Roman";mso-bidi-font-family:"Times New Roman";color:#BDD5DA'> an=
d </span><span
class=3DSpellE><b><span style=3D'font-size:9.0pt;mso-bidi-font-size:11.0pt;
font-family:"Verdana","sans-serif";mso-fareast-font-family:"Times New Roman=
";
mso-bidi-font-family:"Times New Roman";color:#BDD5DA'>RangeValidator</span>=
</b></span><span
style=3D'font-size:9.0pt;font-family:"Verdana","sans-serif";mso-fareast-fon=
t-family:
"Times New Roman";mso-bidi-font-family:"Times New Roman";color:#BDD5DA'>
controls can be used to constrain input. Alternatively we can also the </sp=
an><span
class=3DSpellE><b><span style=3D'font-size:9.0pt;mso-bidi-font-size:11.0pt;
font-family:"Verdana","sans-serif";mso-fareast-font-family:"Times New Roman=
";
mso-bidi-font-family:"Times New Roman";color:#BDD5DA'>Regex</span></b></spa=
n><span
style=3D'font-size:9.0pt;font-family:"Verdana","sans-serif";mso-fareast-fon=
t-family:
"Times New Roman";mso-bidi-font-family:"Times New Roman";color:#BDD5DA'> cl=
ass
in our server-side code to constrain input.<o:p></o:p></span></p>

<p class=3DMsoNormal style=3D'mso-margin-top-alt:auto;mso-margin-bottom-alt=
:auto;
line-height:13.5pt'><span style=3D'font-size:9.0pt;font-family:"Verdana","s=
ans-serif";
mso-fareast-font-family:"Times New Roman";mso-bidi-font-family:"Times New R=
oman";
color:#BDD5DA'>When user input is captured by an ASP.NET </span><span
class=3DSpellE><b><span style=3D'font-size:9.0pt;mso-bidi-font-size:11.0pt;
font-family:"Verdana","sans-serif";mso-fareast-font-family:"Times New Roman=
";
mso-bidi-font-family:"Times New Roman";color:#BDD5DA'>TextBox</span></b></s=
pan><span
style=3D'font-size:9.0pt;font-family:"Verdana","sans-serif";mso-fareast-fon=
t-family:
"Times New Roman";mso-bidi-font-family:"Times New Roman";color:#BDD5DA'>
control, we can constrain its input by using a </span><span class=3DSpellE>=
<b><span
style=3D'font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:"Verdana","s=
ans-serif";
mso-fareast-font-family:"Times New Roman";mso-bidi-font-family:"Times New R=
oman";
color:#BDD5DA'>RegularExpressionValidator</span></b></span><span
style=3D'font-size:9.0pt;font-family:"Verdana","sans-serif";mso-fareast-fon=
t-family:
"Times New Roman";mso-bidi-font-family:"Times New Roman";color:#BDD5DA'>
control as shown in the following <span class=3DSpellE>aspx</span> code<span
class=3DGramE>..</span><o:p></o:p></span></p>

<p class=3DMsoNormal style=3D'margin-bottom:0in;margin-bottom:.0001pt;line-=
height:
13.5pt'><b><i><span style=3D'font-size:9.0pt;mso-bidi-font-size:11.0pt;
font-family:"Verdana","sans-serif";mso-fareast-font-family:"Times New Roman=
";
mso-bidi-font-family:"Times New Roman";color:#BDD5DA'>&lt;%@ %&gt;</span></=
i></b><span
style=3D'font-size:9.0pt;font-family:"Verdana","sans-serif";mso-fareast-fon=
t-family:
"Times New Roman";mso-bidi-font-family:"Times New Roman";color:#BDD5DA'> </=
span><b><i><span
style=3D'font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:"Verdana","s=
ans-serif";
mso-fareast-font-family:"Times New Roman";mso-bidi-font-family:"Times New R=
oman";
color:#BDD5DA'>&lt;form <span class=3DSpellE>runat</span>=3D&quot;server&qu=
ot;&gt;</span></i></b><span
style=3D'font-size:9.0pt;font-family:"Verdana","sans-serif";mso-fareast-fon=
t-family:
"Times New Roman";mso-bidi-font-family:"Times New Roman";color:#BDD5DA'> </=
span><b><i><span
style=3D'font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:"Verdana","s=
ans-serif";
mso-fareast-font-family:"Times New Roman";mso-bidi-font-family:"Times New R=
oman";
color:#BDD5DA'>&nbsp;&nbsp;&nbsp; &lt;<span class=3DSpellE>asp:TextBox</spa=
n> <span
class=3DSpellE>runat</span>=3D&quot;server&quot;/&gt;</span></i></b><span
style=3D'font-size:9.0pt;font-family:"Verdana","sans-serif";mso-fareast-fon=
t-family:
"Times New Roman";mso-bidi-font-family:"Times New Roman";color:#BDD5DA'> </=
span><b><i><span
style=3D'font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:"Verdana","s=
ans-serif";
mso-fareast-font-family:"Times New Roman";mso-bidi-font-family:"Times New R=
oman";
color:#BDD5DA'>&nbsp;&nbsp;&nbsp; &lt;<span class=3DSpellE>asp:RegularExpre=
ssionValidator</span>
<span class=3DSpellE>runat</span>=3D&quot;server&quot;&nbsp;&nbsp;&nbsp;&nb=
sp;&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nb=
sp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span
class=3DSpellE>ErrorMessage</span>=3D&quot;Incorrect data&quot;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nb=
sp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span
class=3DSpellE>ControlToValidate</span>=3D&quot;text1&quot;&nbsp;&nbsp;&nbs=
p;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nb=
sp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span
class=3DSpellE>ValidationExpression</span>=3D&quot;^\d{3}-\d{2}-\d{4}$&quot=
; /&gt;</span></i></b><span
style=3D'font-size:9.0pt;font-family:"Verdana","sans-serif";mso-fareast-fon=
t-family:
"Times New Roman";mso-bidi-font-family:"Times New Roman";color:#BDD5DA'> </=
span><b><i><span
style=3D'font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:"Verdana","s=
ans-serif";
mso-fareast-font-family:"Times New Roman";mso-bidi-font-family:"Times New R=
oman";
color:#BDD5DA'>&lt;/form&gt;</span></i></b><span style=3D'font-size:9.0pt;
font-family:"Verdana","sans-serif";mso-fareast-font-family:"Times New Roman=
";
mso-bidi-font-family:"Times New Roman";color:#BDD5DA'> </span><b><i><span
style=3D'font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:"Verdana","s=
ans-serif";
mso-fareast-font-family:"Times New Roman";mso-bidi-font-family:"Times New R=
oman";
color:#BDD5DA'>&nbsp;</span></i></b><span style=3D'font-size:9.0pt;font-fam=
ily:
"Verdana","sans-serif";mso-fareast-font-family:"Times New Roman";mso-bidi-f=
ont-family:
"Times New Roman";color:#BDD5DA'> If the user input is from another source,
such as an HTML control, a query string parameter, or a cookie, you can
constrain it by using the </span><span class=3DSpellE><b><span style=3D'fon=
t-size:
9.0pt;mso-bidi-font-size:11.0pt;font-family:"Verdana","sans-serif";mso-fare=
ast-font-family:
"Times New Roman";mso-bidi-font-family:"Times New Roman";color:#BDD5DA'>Reg=
ex</span></b></span><span
style=3D'font-size:9.0pt;font-family:"Verdana","sans-serif";mso-fareast-fon=
t-family:
"Times New Roman";mso-bidi-font-family:"Times New Roman";color:#BDD5DA'> cl=
ass
from the </span><span class=3DSpellE><b><span style=3D'font-size:9.0pt;mso-=
bidi-font-size:
11.0pt;font-family:"Verdana","sans-serif";mso-fareast-font-family:"Times Ne=
w Roman";
mso-bidi-font-family:"Times New Roman";color:#BDD5DA'>System.Text.RegularEx=
pressions</span></b></span><span
style=3D'font-size:9.0pt;font-family:"Verdana","sans-serif";mso-fareast-fon=
t-family:
"Times New Roman";mso-bidi-font-family:"Times New Roman";color:#BDD5DA'>
namespace. The following example assumes that the input is obtained from a
cookie. &nbsp; </span><span class=3DGramE><b><i><span style=3D'font-size:9.=
0pt;
mso-bidi-font-size:11.0pt;font-family:"Verdana","sans-serif";mso-fareast-fo=
nt-family:
"Times New Roman";mso-bidi-font-family:"Times New Roman";color:#BDD5DA'>if<=
/span></i></b></span><b><i><span
style=3D'font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:"Verdana","s=
ans-serif";
mso-fareast-font-family:"Times New Roman";mso-bidi-font-family:"Times New R=
oman";
color:#BDD5DA'> (<span class=3DSpellE>Regex.IsMatch</span>(<span class=3DSp=
ellE>Request.Cookies</span>[&quot;SSN&quot;],
&quot;^\d{3}-\d{2}-\d{4}$&quot;))</span></i></b><span style=3D'font-size:9.=
0pt;
font-family:"Verdana","sans-serif";mso-fareast-font-family:"Times New Roman=
";
mso-bidi-font-family:"Times New Roman";color:#BDD5DA'> </span><b><i><span
style=3D'font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:"Verdana","s=
ans-serif";
mso-fareast-font-family:"Times New Roman";mso-bidi-font-family:"Times New R=
oman";
color:#BDD5DA'>{</span></i></b><span style=3D'font-size:9.0pt;font-family:"=
Verdana","sans-serif";
mso-fareast-font-family:"Times New Roman";mso-bidi-font-family:"Times New R=
oman";
color:#BDD5DA'> </span><b><i><span style=3D'font-size:9.0pt;mso-bidi-font-s=
ize:
11.0pt;font-family:"Verdana","sans-serif";mso-fareast-font-family:"Times Ne=
w Roman";
mso-bidi-font-family:"Times New Roman";color:#BDD5DA'>&nbsp;&nbsp;&nbsp; //
perform the database task</span></i></b><span style=3D'font-size:9.0pt;
font-family:"Verdana","sans-serif";mso-fareast-font-family:"Times New Roman=
";
mso-bidi-font-family:"Times New Roman";color:#BDD5DA'> </span><b><i><span
style=3D'font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:"Verdana","s=
ans-serif";
mso-fareast-font-family:"Times New Roman";mso-bidi-font-family:"Times New R=
oman";
color:#BDD5DA'>}</span></i></b><span style=3D'font-size:9.0pt;font-family:"=
Verdana","sans-serif";
mso-fareast-font-family:"Times New Roman";mso-bidi-font-family:"Times New R=
oman";
color:#BDD5DA'> </span><b><i><span style=3D'font-size:9.0pt;mso-bidi-font-s=
ize:
11.0pt;font-family:"Verdana","sans-serif";mso-fareast-font-family:"Times Ne=
w Roman";
mso-bidi-font-family:"Times New Roman";color:#BDD5DA'>else</span></i></b><s=
pan
style=3D'font-size:9.0pt;font-family:"Verdana","sans-serif";mso-fareast-fon=
t-family:
"Times New Roman";mso-bidi-font-family:"Times New Roman";color:#BDD5DA'> </=
span><b><i><span
style=3D'font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:"Verdana","s=
ans-serif";
mso-fareast-font-family:"Times New Roman";mso-bidi-font-family:"Times New R=
oman";
color:#BDD5DA'>{</span></i></b><span style=3D'font-size:9.0pt;font-family:"=
Verdana","sans-serif";
mso-fareast-font-family:"Times New Roman";mso-bidi-font-family:"Times New R=
oman";
color:#BDD5DA'> </span><b><i><span style=3D'font-size:9.0pt;mso-bidi-font-s=
ize:
11.0pt;font-family:"Verdana","sans-serif";mso-fareast-font-family:"Times Ne=
w Roman";
mso-bidi-font-family:"Times New Roman";color:#BDD5DA'>&nbsp;&nbsp;&nbsp; //
handle exception</span></i></b><span style=3D'font-size:9.0pt;font-family:"=
Verdana","sans-serif";
mso-fareast-font-family:"Times New Roman";mso-bidi-font-family:"Times New R=
oman";
color:#BDD5DA'> </span><b><i><span style=3D'font-size:9.0pt;mso-bidi-font-s=
ize:
11.0pt;font-family:"Verdana","sans-serif";mso-fareast-font-family:"Times Ne=
w Roman";
mso-bidi-font-family:"Times New Roman";color:#BDD5DA'>}</span></i></b><span
style=3D'font-size:9.0pt;font-family:"Verdana","sans-serif";mso-fareast-fon=
t-family:
"Times New Roman";mso-bidi-font-family:"Times New Roman";color:#BDD5DA'> &n=
bsp;
<o:p></o:p></span></p>

<p class=3DMsoNormal style=3D'mso-margin-top-alt:auto;mso-margin-bottom-alt=
:auto;
line-height:13.5pt'><span style=3D'font-size:9.0pt;font-family:"Verdana","s=
ans-serif";
mso-fareast-font-family:"Times New Roman";mso-bidi-font-family:"Times New R=
oman";
color:#BDD5DA'>User supplied input parameters need to be validated before b=
eing
used in SQL statements. The following </span><span style=3D'color:#BDD5DA'>=
<a
href=3D"http://www.articlesbase.com/security-articles/secure-aspnet-coding-=
practice-for-three-most-critical-vulnerabilities-in-web-application-889853.=
html"
target=3D"_new"><span style=3D'font-size:9.0pt;mso-bidi-font-size:11.0pt;
font-family:"Verdana","sans-serif";mso-fareast-font-family:"Times New Roman=
";
mso-bidi-font-family:"Times New Roman";color:#BDD5DA'>data access</span></a=
></span><span
style=3D'font-size:9.0pt;font-family:"Verdana","sans-serif";mso-fareast-fon=
t-family:
"Times New Roman";mso-bidi-font-family:"Times New Roman";color:#BDD5DA'>
routine can be taken as an example of how validate user input parameters.<o=
:p></o:p></span></p>

<p class=3DMsoNormal style=3D'margin-bottom:0in;margin-bottom:.0001pt;line-=
height:
13.5pt'><b><i><span style=3D'font-size:9.0pt;mso-bidi-font-size:11.0pt;
font-family:"Verdana","sans-serif";mso-fareast-font-family:"Times New Roman=
";
mso-bidi-font-family:"Times New Roman";color:#BDD5DA'>&nbsp;</span></i></b>=
<span
style=3D'font-size:9.0pt;font-family:"Verdana","sans-serif";mso-fareast-fon=
t-family:
"Times New Roman";mso-bidi-font-family:"Times New Roman";color:#BDD5DA'> </=
span><span
class=3DGramE><b><i><span style=3D'font-size:9.0pt;mso-bidi-font-size:11.0p=
t;
font-family:"Verdana","sans-serif";mso-fareast-font-family:"Times New Roman=
";
mso-bidi-font-family:"Times New Roman";color:#BDD5DA'>using</span></i></b><=
/span><b><i><span
style=3D'font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:"Verdana","s=
ans-serif";
mso-fareast-font-family:"Times New Roman";mso-bidi-font-family:"Times New R=
oman";
color:#BDD5DA'> System;</span></i></b><span style=3D'font-size:9.0pt;font-f=
amily:
"Verdana","sans-serif";mso-fareast-font-family:"Times New Roman";mso-bidi-f=
ont-family:
"Times New Roman";color:#BDD5DA'> </span><b><i><span style=3D'font-size:9.0=
pt;
mso-bidi-font-size:11.0pt;font-family:"Verdana","sans-serif";mso-fareast-fo=
nt-family:
"Times New Roman";mso-bidi-font-family:"Times New Roman";color:#BDD5DA'>usi=
ng <span
class=3DSpellE>System.Text.RegularExpressions</span>;</span></i></b><span
style=3D'font-size:9.0pt;font-family:"Verdana","sans-serif";mso-fareast-fon=
t-family:
"Times New Roman";mso-bidi-font-family:"Times New Roman";color:#BDD5DA'> </=
span><b><i><span
style=3D'font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:"Verdana","s=
ans-serif";
mso-fareast-font-family:"Times New Roman";mso-bidi-font-family:"Times New R=
oman";
color:#BDD5DA'>public void <span class=3DSpellE>useraccount</span>(string
username, string password)</span></i></b><span style=3D'font-size:9.0pt;
font-family:"Verdana","sans-serif";mso-fareast-font-family:"Times New Roman=
";
mso-bidi-font-family:"Times New Roman";color:#BDD5DA'> </span><b><i><span
style=3D'font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:"Verdana","s=
ans-serif";
mso-fareast-font-family:"Times New Roman";mso-bidi-font-family:"Times New R=
oman";
color:#BDD5DA'>{</span></i></b><span style=3D'font-size:9.0pt;font-family:"=
Verdana","sans-serif";
mso-fareast-font-family:"Times New Roman";mso-bidi-font-family:"Times New R=
oman";
color:#BDD5DA'> </span><b><i><span style=3D'font-size:9.0pt;mso-bidi-font-s=
ize:
11.0pt;font-family:"Verdana","sans-serif";mso-fareast-font-family:"Times Ne=
w Roman";
mso-bidi-font-family:"Times New Roman";color:#BDD5DA'>&nbsp;&nbsp;&nbsp; //
check username contains only lower case or upper case letters,
&nbsp;&nbsp;&nbsp;&nbsp;// the apostrophe, a dot, or white space. Also chec=
k it
is &nbsp;&nbsp;&nbsp;&nbsp;// between 1 and 40 characters long</span></i></=
b><span
style=3D'font-size:9.0pt;font-family:"Verdana","sans-serif";mso-fareast-fon=
t-family:
"Times New Roman";mso-bidi-font-family:"Times New Roman";color:#BDD5DA'> </=
span><b><i><span
style=3D'font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:"Verdana","s=
ans-serif";
mso-fareast-font-family:"Times New Roman";mso-bidi-font-family:"Times New R=
oman";
color:#BDD5DA'>&nbsp;&nbsp;&nbsp; if ( !<span class=3DSpellE>Regex.IsMatch<=
/span>(<span
class=3DSpellE>userIDTxt.Text</span>, @&quot;^[a-<span class=3DSpellE>zA</s=
pan>-Z'./s]{1,40}$&quot;))</span></i></b><span
style=3D'font-size:9.0pt;font-family:"Verdana","sans-serif";mso-fareast-fon=
t-family:
"Times New Roman";mso-bidi-font-family:"Times New Roman";color:#BDD5DA'> </=
span><b><i><span
style=3D'font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:"Verdana","s=
ans-serif";
mso-fareast-font-family:"Times New Roman";mso-bidi-font-family:"Times New R=
oman";
color:#BDD5DA'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; throw new <span class=3DSpell=
E>FormatException</span>(&quot;Invalid
username format&quot;);</span></i></b><span style=3D'font-size:9.0pt;font-f=
amily:
"Verdana","sans-serif";mso-fareast-font-family:"Times New Roman";mso-bidi-f=
ont-family:
"Times New Roman";color:#BDD5DA'> </span><b><i><span style=3D'font-size:9.0=
pt;
mso-bidi-font-size:11.0pt;font-family:"Verdana","sans-serif";mso-fareast-fo=
nt-family:
"Times New Roman";mso-bidi-font-family:"Times New Roman";color:#BDD5DA'>&nb=
sp;</span></i></b><span
style=3D'font-size:9.0pt;font-family:"Verdana","sans-serif";mso-fareast-fon=
t-family:
"Times New Roman";mso-bidi-font-family:"Times New Roman";color:#BDD5DA'> </=
span><b><i><span
style=3D'font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:"Verdana","s=
ans-serif";
mso-fareast-font-family:"Times New Roman";mso-bidi-font-family:"Times New R=
oman";
color:#BDD5DA'>&nbsp;&nbsp;&nbsp; // Check password contains at least one
digit, one lower case &nbsp;&nbsp;&nbsp;&nbsp;// letter, one uppercase lett=
er,
and is between 8 and 10 &nbsp;&nbsp;&nbsp;&nbsp;// characters long</span></=
i></b><span
style=3D'font-size:9.0pt;font-family:"Verdana","sans-serif";mso-fareast-fon=
t-family:
"Times New Roman";mso-bidi-font-family:"Times New Roman";color:#BDD5DA'> </=
span><b><i><span
style=3D'font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:"Verdana","s=
ans-serif";
mso-fareast-font-family:"Times New Roman";mso-bidi-font-family:"Times New R=
oman";
color:#BDD5DA'>&nbsp;&nbsp;&nbsp; if ( !<span class=3DSpellE>Regex.IsMatch<=
/span>(<span
class=3DSpellE>passwordTxt.Text</span>,
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nb=
sp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;@&quot;^(?=3D.*\d)=
(?=3D.*[a-z])(?=3D.*[A-Z]).{8,10}$&quot;
))</span></i></b><span style=3D'font-size:9.0pt;font-family:"Verdana","sans=
-serif";
mso-fareast-font-family:"Times New Roman";mso-bidi-font-family:"Times New R=
oman";
color:#BDD5DA'> </span><b><i><span style=3D'font-size:9.0pt;mso-bidi-font-s=
ize:
11.0pt;font-family:"Verdana","sans-serif";mso-fareast-font-family:"Times Ne=
w Roman";
mso-bidi-font-family:"Times New Roman";color:#BDD5DA'>&nbsp;&nbsp;&nbsp;&nb=
sp;&nbsp;
throw new <span class=3DSpellE>FormatException</span>(&quot;Invalid password
format&quot;);</span></i></b><span style=3D'font-size:9.0pt;font-family:"Ve=
rdana","sans-serif";
mso-fareast-font-family:"Times New Roman";mso-bidi-font-family:"Times New R=
oman";
color:#BDD5DA'> </span><b><i><span style=3D'font-size:9.0pt;mso-bidi-font-s=
ize:
11.0pt;font-family:"Verdana","sans-serif";mso-fareast-font-family:"Times Ne=
w Roman";
mso-bidi-font-family:"Times New Roman";color:#BDD5DA'>&nbsp;</span></i></b>=
<span
style=3D'font-size:9.0pt;font-family:"Verdana","sans-serif";mso-fareast-fon=
t-family:
"Times New Roman";mso-bidi-font-family:"Times New Roman";color:#BDD5DA'> </=
span><b><i><span
style=3D'font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:"Verdana","s=
ans-serif";
mso-fareast-font-family:"Times New Roman";mso-bidi-font-family:"Times New R=
oman";
color:#BDD5DA'>&nbsp;&nbsp;&nbsp; // Perform data access operation (using t=
ype
safe parameters)</span></i></b><span style=3D'font-size:9.0pt;font-family:"=
Verdana","sans-serif";
mso-fareast-font-family:"Times New Roman";mso-bidi-font-family:"Times New R=
oman";
color:#BDD5DA'> </span><b><i><span style=3D'font-size:9.0pt;mso-bidi-font-s=
ize:
11.0pt;font-family:"Verdana","sans-serif";mso-fareast-font-family:"Times Ne=
w Roman";
mso-bidi-font-family:"Times New Roman";color:#BDD5DA'>&nbsp;&nbsp;&nbsp; ..=
.</span></i></b><span
style=3D'font-size:9.0pt;font-family:"Verdana","sans-serif";mso-fareast-fon=
t-family:
"Times New Roman";mso-bidi-font-family:"Times New Roman";color:#BDD5DA'> </=
span><b><i><span
style=3D'font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:"Verdana","s=
ans-serif";
mso-fareast-font-family:"Times New Roman";mso-bidi-font-family:"Times New R=
oman";
color:#BDD5DA'>}</span></i></b><span style=3D'font-size:9.0pt;font-family:"=
Verdana","sans-serif";
mso-fareast-font-family:"Times New Roman";mso-bidi-font-family:"Times New R=
oman";
color:#BDD5DA'> </span><b><i><span style=3D'font-size:9.0pt;mso-bidi-font-s=
ize:
11.0pt;font-family:"Verdana","sans-serif";mso-fareast-font-family:"Times Ne=
w Roman";
mso-bidi-font-family:"Times New Roman";color:#BDD5DA'>&nbsp;</span></i></b>=
<span
style=3D'font-size:9.0pt;font-family:"Verdana","sans-serif";mso-fareast-fon=
t-family:
"Times New Roman";mso-bidi-font-family:"Times New Roman";color:#BDD5DA'> <o=
:p></o:p></span></p>

<p class=3DMsoNormal style=3D'mso-margin-top-alt:auto;mso-margin-bottom-alt=
:auto;
line-height:13.5pt'><b><span style=3D'font-size:9.0pt;mso-bidi-font-size:11=
.0pt;
font-family:"Verdana","sans-serif";mso-fareast-font-family:"Times New Roman=
";
mso-bidi-font-family:"Times New Roman";color:#BDD5DA'>Use parameterized sto=
red
procedures:</span></b><span style=3D'font-size:9.0pt;font-family:"Verdana",=
"sans-serif";
mso-fareast-font-family:"Times New Roman";mso-bidi-font-family:"Times New R=
oman";
color:#BDD5DA'><o:p></o:p></span></p>

<p class=3DMsoNormal style=3D'mso-margin-top-alt:auto;mso-margin-bottom-alt=
:auto;
line-height:13.5pt'><span style=3D'font-size:9.0pt;font-family:"Verdana","s=
ans-serif";
mso-fareast-font-family:"Times New Roman";mso-bidi-font-family:"Times New R=
oman";
color:#BDD5DA'>The following code shows how to use parameters with </span><=
span
style=3D'color:#BDD5DA'><a
href=3D"http://www.articlesbase.com/security-articles/secure-aspnet-coding-=
practice-for-three-most-critical-vulnerabilities-in-web-application-889853.=
html"
target=3D"_new"><span style=3D'font-size:9.0pt;mso-bidi-font-size:11.0pt;
font-family:"Verdana","sans-serif";mso-fareast-font-family:"Times New Roman=
";
mso-bidi-font-family:"Times New Roman";color:#BDD5DA'>stored procedures</sp=
an></a></span><span
style=3D'font-size:9.0pt;font-family:"Verdana","sans-serif";mso-fareast-fon=
t-family:
"Times New Roman";mso-bidi-font-family:"Times New Roman";color:#BDD5DA'>.<o=
:p></o:p></span></p>

<p class=3DMsoNormal style=3D'margin-bottom:0in;margin-bottom:.0001pt;line-=
height:
13.5pt'><b><i><span style=3D'font-size:9.0pt;mso-bidi-font-size:11.0pt;
font-family:"Verdana","sans-serif";mso-fareast-font-family:"Times New Roman=
";
mso-bidi-font-family:"Times New Roman";color:#BDD5DA'>using <span class=3DS=
pellE>System.Data</span>;</span></i></b><span
style=3D'font-size:9.0pt;font-family:"Verdana","sans-serif";mso-fareast-fon=
t-family:
"Times New Roman";mso-bidi-font-family:"Times New Roman";color:#BDD5DA'> </=
span><b><i><span
style=3D'font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:"Verdana","s=
ans-serif";
mso-fareast-font-family:"Times New Roman";mso-bidi-font-family:"Times New R=
oman";
color:#BDD5DA'>using <span class=3DSpellE>System.Data.SqlClient</span>;</sp=
an></i></b><span
style=3D'font-size:9.0pt;font-family:"Verdana","sans-serif";mso-fareast-fon=
t-family:
"Times New Roman";mso-bidi-font-family:"Times New Roman";color:#BDD5DA'> </=
span><b><i><span
style=3D'font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:"Verdana","s=
ans-serif";
mso-fareast-font-family:"Times New Roman";mso-bidi-font-family:"Times New R=
oman";
color:#BDD5DA'>&nbsp;</span></i></b><span style=3D'font-size:9.0pt;font-fam=
ily:
"Verdana","sans-serif";mso-fareast-font-family:"Times New Roman";mso-bidi-f=
ont-family:
"Times New Roman";color:#BDD5DA'> </span><b><i><span style=3D'font-size:9.0=
pt;
mso-bidi-font-size:11.0pt;font-family:"Verdana","sans-serif";mso-fareast-fo=
nt-family:
"Times New Roman";mso-bidi-font-family:"Times New Roman";color:#BDD5DA'>usi=
ng (<span
class=3DSpellE>SqlConnection</span> connection =3D new <span class=3DSpellE=
>SqlConnection</span>(<span
class=3DSpellE>connectionString</span>))</span></i></b><span style=3D'font-=
size:
9.0pt;font-family:"Verdana","sans-serif";mso-fareast-font-family:"Times New=
 Roman";
mso-bidi-font-family:"Times New Roman";color:#BDD5DA'> </span><b><i><span
style=3D'font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:"Verdana","s=
ans-serif";
mso-fareast-font-family:"Times New Roman";mso-bidi-font-family:"Times New R=
oman";
color:#BDD5DA'>{</span></i></b><span style=3D'font-size:9.0pt;font-family:"=
Verdana","sans-serif";
mso-fareast-font-family:"Times New Roman";mso-bidi-font-family:"Times New R=
oman";
color:#BDD5DA'> </span><b><i><span style=3D'font-size:9.0pt;mso-bidi-font-s=
ize:
11.0pt;font-family:"Verdana","sans-serif";mso-fareast-font-family:"Times Ne=
w Roman";
mso-bidi-font-family:"Times New Roman";color:#BDD5DA'>&nbsp; <span
class=3DSpellE>DataSet</span> <span class=3DSpellE>userDataset</span> =3D n=
ew <span
class=3DSpellE>DataSet</span>();</span></i></b><span style=3D'font-size:9.0=
pt;
font-family:"Verdana","sans-serif";mso-fareast-font-family:"Times New Roman=
";
mso-bidi-font-family:"Times New Roman";color:#BDD5DA'> </span><b><i><span
style=3D'font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:"Verdana","s=
ans-serif";
mso-fareast-font-family:"Times New Roman";mso-bidi-font-family:"Times New R=
oman";
color:#BDD5DA'>&nbsp; <span class=3DSpellE>SqlDataAdapter</span> <span
class=3DSpellE>myCommand</span> =3D new <span class=3DSpellE>SqlDataAdapter=
</span>(
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nb=
sp;&quot;LoginStoredProcedure&quot;,
connection);</span></i></b><span style=3D'font-size:9.0pt;font-family:"Verd=
ana","sans-serif";
mso-fareast-font-family:"Times New Roman";mso-bidi-font-family:"Times New R=
oman";
color:#BDD5DA'> </span><b><i><span style=3D'font-size:9.0pt;mso-bidi-font-s=
ize:
11.0pt;font-family:"Verdana","sans-serif";mso-fareast-font-family:"Times Ne=
w Roman";
mso-bidi-font-family:"Times New Roman";color:#BDD5DA'>&nbsp; <span
class=3DSpellE>myCommand.SelectCommand.CommandType</span> =3D <span class=
=3DSpellE>CommandType.StoredProcedure</span>;</span></i></b><span
style=3D'font-size:9.0pt;font-family:"Verdana","sans-serif";mso-fareast-fon=
t-family:
"Times New Roman";mso-bidi-font-family:"Times New Roman";color:#BDD5DA'> </=
span><b><i><span
style=3D'font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:"Verdana","s=
ans-serif";
mso-fareast-font-family:"Times New Roman";mso-bidi-font-family:"Times New R=
oman";
color:#BDD5DA'>&nbsp; <span class=3DSpellE>myCommand.SelectCommand.Paramete=
rs.Add</span>(&quot;@<span
class=3DSpellE>au_id</span>&quot;, <span class=3DSpellE>SqlDbType.VarChar</=
span>,
12);</span></i></b><span style=3D'font-size:9.0pt;font-family:"Verdana","sa=
ns-serif";
mso-fareast-font-family:"Times New Roman";mso-bidi-font-family:"Times New R=
oman";
color:#BDD5DA'> </span><b><i><span style=3D'font-size:9.0pt;mso-bidi-font-s=
ize:
11.0pt;font-family:"Verdana","sans-serif";mso-fareast-font-family:"Times Ne=
w Roman";
mso-bidi-font-family:"Times New Roman";color:#BDD5DA'>&nbsp; <span
class=3DSpellE>myCommand.SelectCommand.Parameters</span>[&quot;@<span
class=3DSpellE>au_id</span>&quot;].Value =3D <span class=3DSpellE>SSN.Text<=
/span>;</span></i></b><span
style=3D'font-size:9.0pt;font-family:"Verdana","sans-serif";mso-fareast-fon=
t-family:
"Times New Roman";mso-bidi-font-family:"Times New Roman";color:#BDD5DA'> </=
span><b><i><span
style=3D'font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:"Verdana","s=
ans-serif";
mso-fareast-font-family:"Times New Roman";mso-bidi-font-family:"Times New R=
oman";
color:#BDD5DA'>&nbsp;</span></i></b><span style=3D'font-size:9.0pt;font-fam=
ily:
"Verdana","sans-serif";mso-fareast-font-family:"Times New Roman";mso-bidi-f=
ont-family:
"Times New Roman";color:#BDD5DA'> </span><b><i><span style=3D'font-size:9.0=
pt;
mso-bidi-font-size:11.0pt;font-family:"Verdana","sans-serif";mso-fareast-fo=
nt-family:
"Times New Roman";mso-bidi-font-family:"Times New Roman";color:#BDD5DA'>&nb=
sp; <span
class=3DSpellE>myCommand.Fill</span>(<span class=3DSpellE>userDataset</span=
>);</span></i></b><span
style=3D'font-size:9.0pt;font-family:"Verdana","sans-serif";mso-fareast-fon=
t-family:
"Times New Roman";mso-bidi-font-family:"Times New Roman";color:#BDD5DA'> </=
span><b><i><span
style=3D'font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:"Verdana","s=
ans-serif";
mso-fareast-font-family:"Times New Roman";mso-bidi-font-family:"Times New R=
oman";
color:#BDD5DA'>}</span></i></b><span style=3D'font-size:9.0pt;font-family:"=
Verdana","sans-serif";
mso-fareast-font-family:"Times New Roman";mso-bidi-font-family:"Times New R=
oman";
color:#BDD5DA'> </span><b><i><span style=3D'font-size:9.0pt;mso-bidi-font-s=
ize:
11.0pt;font-family:"Verdana","sans-serif";mso-fareast-font-family:"Times Ne=
w Roman";
mso-bidi-font-family:"Times New Roman";color:#BDD5DA'>&nbsp;</span></i></b>=
<span
style=3D'font-size:9.0pt;font-family:"Verdana","sans-serif";mso-fareast-fon=
t-family:
"Times New Roman";mso-bidi-font-family:"Times New Roman";color:#BDD5DA'> In=
 the
above example the </span><b><span style=3D'font-size:9.0pt;mso-bidi-font-si=
ze:
11.0pt;font-family:"Verdana","sans-serif";mso-fareast-font-family:"Times Ne=
w Roman";
mso-bidi-font-family:"Times New Roman";color:#BDD5DA'>@<span class=3DSpellE=
>au_id</span></span></b><span
style=3D'font-size:9.0pt;font-family:"Verdana","sans-serif";mso-fareast-fon=
t-family:
"Times New Roman";mso-bidi-font-family:"Times New Roman";color:#BDD5DA'>
parameter is treated as a literal value and not as executable code. Also, t=
he
parameter is checked for type and length. In the preceding code example, the
input value cannot be longer than 12 characters. <span class=3DGramE>If the=
 data
does not conform to the type or length defined by the parameter, the <span
class=3DSpellE><b><span style=3D'mso-bidi-font-size:11.0pt'>SqlParameter</s=
pan></b></span>
class throws an exception.</span> <o:p></o:p></span></p>

<p class=3DMsoNormal style=3D'mso-margin-top-alt:auto;mso-margin-bottom-alt=
:auto;
line-height:13.5pt'><span style=3D'font-size:9.0pt;font-family:"Verdana","s=
ans-serif";
mso-fareast-font-family:"Times New Roman";mso-bidi-font-family:"Times New R=
oman";
color:#BDD5DA'>Note: Using stored procedure with parameters does not
necessarily prevent SQL <span class=3DSpellE>injection.Take</span> a look a=
t the
following stored procedure:<o:p></o:p></span></p>

<p class=3DMsoNormal style=3D'margin-bottom:0in;margin-bottom:.0001pt;line-=
height:
13.5pt'><b><i><span style=3D'font-size:9.0pt;mso-bidi-font-size:11.0pt;
font-family:"Verdana","sans-serif";mso-fareast-font-family:"Times New Roman=
";
mso-bidi-font-family:"Times New Roman";color:#BDD5DA'>&nbsp;</span></i></b>=
<span
style=3D'font-size:9.0pt;font-family:"Verdana","sans-serif";mso-fareast-fon=
t-family:
"Times New Roman";mso-bidi-font-family:"Times New Roman";color:#BDD5DA'> </=
span><b><i><span
style=3D'font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:"Verdana","s=
ans-serif";
mso-fareast-font-family:"Times New Roman";mso-bidi-font-family:"Times New R=
oman";
color:#BDD5DA'>&nbsp;</span></i></b><span style=3D'font-size:9.0pt;font-fam=
ily:
"Verdana","sans-serif";mso-fareast-font-family:"Times New Roman";mso-bidi-f=
ont-family:
"Times New Roman";color:#BDD5DA'> </span><b><i><span style=3D'font-size:9.0=
pt;
mso-bidi-font-size:11.0pt;font-family:"Verdana","sans-serif";mso-fareast-fo=
nt-family:
"Times New Roman";mso-bidi-font-family:"Times New Roman";color:#BDD5DA'>CRE=
ATE
PROCEDURE <span class=3DSpellE>dbo.RunQuery</span></span></i></b><span
style=3D'font-size:9.0pt;font-family:"Verdana","sans-serif";mso-fareast-fon=
t-family:
"Times New Roman";mso-bidi-font-family:"Times New Roman";color:#BDD5DA'> </=
span><b><i><span
style=3D'font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:"Verdana","s=
ans-serif";
mso-fareast-font-family:"Times New Roman";mso-bidi-font-family:"Times New R=
oman";
color:#BDD5DA'>@<span class=3DSpellE>var</span> <span class=3DSpellE>ntext<=
/span></span></i></b><span
style=3D'font-size:9.0pt;font-family:"Verdana","sans-serif";mso-fareast-fon=
t-family:
"Times New Roman";mso-bidi-font-family:"Times New Roman";color:#BDD5DA'> </=
span><b><i><span
style=3D'font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:"Verdana","s=
ans-serif";
mso-fareast-font-family:"Times New Roman";mso-bidi-font-family:"Times New R=
oman";
color:#BDD5DA'>AS</span></i></b><span style=3D'font-size:9.0pt;font-family:=
"Verdana","sans-serif";
mso-fareast-font-family:"Times New Roman";mso-bidi-font-family:"Times New R=
oman";
color:#BDD5DA'> </span><b><i><span style=3D'font-size:9.0pt;mso-bidi-font-s=
ize:
11.0pt;font-family:"Verdana","sans-serif";mso-fareast-font-family:"Times Ne=
w Roman";
mso-bidi-font-family:"Times New Roman";color:#BDD5DA'>&nbsp;&nbsp;&nbsp;&nb=
sp;&nbsp;&nbsp;&nbsp;
exec <span class=3DSpellE>sp_executesql</span> @<span class=3DSpellE>var</s=
pan></span></i></b><span
style=3D'font-size:9.0pt;font-family:"Verdana","sans-serif";mso-fareast-fon=
t-family:
"Times New Roman";mso-bidi-font-family:"Times New Roman";color:#BDD5DA'> </=
span><b><i><span
style=3D'font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:"Verdana","s=
ans-serif";
mso-fareast-font-family:"Times New Roman";mso-bidi-font-family:"Times New R=
oman";
color:#BDD5DA'>GO</span></i></b><span style=3D'font-size:9.0pt;font-family:=
"Verdana","sans-serif";
mso-fareast-font-family:"Times New Roman";mso-bidi-font-family:"Times New R=
oman";
color:#BDD5DA'> <o:p></o:p></span></p>

<p class=3DMsoNormal style=3D'mso-margin-top-alt:auto;mso-margin-bottom-alt=
:auto;
line-height:13.5pt'><span style=3D'font-size:9.0pt;font-family:"Verdana","s=
ans-serif";
mso-fareast-font-family:"Times New Roman";mso-bidi-font-family:"Times New R=
oman";
color:#BDD5DA'>Now despite being a parameterized stored <span class=3DGramE=
>procedure
,</span> this one executes whatever is passed to <span class=3DSpellE>it.Co=
nsider</span>
the @<span class=3DSpellE>var</span> variable being set to:<o:p></o:p></spa=
n></p>

<p class=3DMsoNormal style=3D'mso-margin-top-alt:auto;mso-margin-bottom-alt=
:auto;
line-height:13.5pt'><b><i><span style=3D'font-size:9.0pt;mso-bidi-font-size=
:11.0pt;
font-family:"Verdana","sans-serif";mso-fareast-font-family:"Times New Roman=
";
mso-bidi-font-family:"Times New Roman";color:#BDD5DA'>DROP TABLE USERS;</sp=
an></i></b><span
style=3D'font-size:9.0pt;font-family:"Verdana","sans-serif";mso-fareast-fon=
t-family:
"Times New Roman";mso-bidi-font-family:"Times New Roman";color:#BDD5DA'><o:=
p></o:p></span></p>

<p class=3DMsoNormal style=3D'mso-margin-top-alt:auto;mso-margin-bottom-alt=
:auto;
line-height:13.5pt'><b><span style=3D'font-size:9.0pt;mso-bidi-font-size:11=
.0pt;
font-family:"Verdana","sans-serif";mso-fareast-font-family:"Times New Roman=
";
mso-bidi-font-family:"Times New Roman";color:#BDD5DA'>Use parameterized dyn=
amic
<span class=3DSpellE>sql</span>:</span></b><span style=3D'font-size:9.0pt;
font-family:"Verdana","sans-serif";mso-fareast-font-family:"Times New Roman=
";
mso-bidi-font-family:"Times New Roman";color:#BDD5DA'><o:p></o:p></span></p>

<p class=3DMsoNormal style=3D'mso-margin-top-alt:auto;mso-margin-bottom-alt=
:auto;
line-height:13.5pt'><span style=3D'font-size:9.0pt;font-family:"Verdana","s=
ans-serif";
mso-fareast-font-family:"Times New Roman";mso-bidi-font-family:"Times New R=
oman";
color:#BDD5DA'>Now if you are not using stored procedure, you still should =
use
parameters when constructing dynamic SQL statements. The following code sho=
ws
how to use parameters with dynamic SQL statement.<o:p></o:p></span></p>

<p class=3DMsoNormal style=3D'margin-bottom:0in;margin-bottom:.0001pt;line-=
height:
13.5pt'><b><i><span style=3D'font-size:9.0pt;mso-bidi-font-size:11.0pt;
font-family:"Verdana","sans-serif";mso-fareast-font-family:"Times New Roman=
";
mso-bidi-font-family:"Times New Roman";color:#BDD5DA'>using <span class=3DS=
pellE>System.Data</span>;</span></i></b><span
style=3D'font-size:9.0pt;font-family:"Verdana","sans-serif";mso-fareast-fon=
t-family:
"Times New Roman";mso-bidi-font-family:"Times New Roman";color:#BDD5DA'> </=
span><b><i><span
style=3D'font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:"Verdana","s=
ans-serif";
mso-fareast-font-family:"Times New Roman";mso-bidi-font-family:"Times New R=
oman";
color:#BDD5DA'>using <span class=3DSpellE>System.Data.SqlClient</span>;</sp=
an></i></b><span
style=3D'font-size:9.0pt;font-family:"Verdana","sans-serif";mso-fareast-fon=
t-family:
"Times New Roman";mso-bidi-font-family:"Times New Roman";color:#BDD5DA'> </=
span><b><i><span
style=3D'font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:"Verdana","s=
ans-serif";
mso-fareast-font-family:"Times New Roman";mso-bidi-font-family:"Times New R=
oman";
color:#BDD5DA'>&nbsp;</span></i></b><span style=3D'font-size:9.0pt;font-fam=
ily:
"Verdana","sans-serif";mso-fareast-font-family:"Times New Roman";mso-bidi-f=
ont-family:
"Times New Roman";color:#BDD5DA'> </span><b><i><span style=3D'font-size:9.0=
pt;
mso-bidi-font-size:11.0pt;font-family:"Verdana","sans-serif";mso-fareast-fo=
nt-family:
"Times New Roman";mso-bidi-font-family:"Times New Roman";color:#BDD5DA'>usi=
ng (<span
class=3DSpellE>SqlConnection</span> connection =3D new <span class=3DSpellE=
>SqlConnection</span>(<span
class=3DSpellE>connectionString</span>))</span></i></b><span style=3D'font-=
size:
9.0pt;font-family:"Verdana","sans-serif";mso-fareast-font-family:"Times New=
 Roman";
mso-bidi-font-family:"Times New Roman";color:#BDD5DA'> </span><b><i><span
style=3D'font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:"Verdana","s=
ans-serif";
mso-fareast-font-family:"Times New Roman";mso-bidi-font-family:"Times New R=
oman";
color:#BDD5DA'>{</span></i></b><span style=3D'font-size:9.0pt;font-family:"=
Verdana","sans-serif";
mso-fareast-font-family:"Times New Roman";mso-bidi-font-family:"Times New R=
oman";
color:#BDD5DA'> </span><b><i><span style=3D'font-size:9.0pt;mso-bidi-font-s=
ize:
11.0pt;font-family:"Verdana","sans-serif";mso-fareast-font-family:"Times Ne=
w Roman";
mso-bidi-font-family:"Times New Roman";color:#BDD5DA'>&nbsp; <span
class=3DSpellE>DataSet</span> <span class=3DSpellE>userDataset</span> =3D n=
ew <span
class=3DSpellE>DataSet</span>();</span></i></b><span style=3D'font-size:9.0=
pt;
font-family:"Verdana","sans-serif";mso-fareast-font-family:"Times New Roman=
";
mso-bidi-font-family:"Times New Roman";color:#BDD5DA'> </span><b><i><span
style=3D'font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:"Verdana","s=
ans-serif";
mso-fareast-font-family:"Times New Roman";mso-bidi-font-family:"Times New R=
oman";
color:#BDD5DA'>&nbsp; <span class=3DSpellE>SqlDataAdapter</span> <span
class=3DSpellE>myDataAdapter</span> =3D new <span class=3DSpellE>SqlDataAda=
pter</span>(</span></i></b><span
style=3D'font-size:9.0pt;font-family:"Verdana","sans-serif";mso-fareast-fon=
t-family:
"Times New Roman";mso-bidi-font-family:"Times New Roman";color:#BDD5DA'> </=
span><b><i><span
style=3D'font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:"Verdana","s=
ans-serif";
mso-fareast-font-family:"Times New Roman";mso-bidi-font-family:"Times New R=
oman";
color:#BDD5DA'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &quot;SELEC=
T <span
class=3DSpellE>au_lname</span>, <span class=3DSpellE>au_fname</span> FROM A=
uthors
WHERE <span class=3DSpellE>au_id</span> =3D @au_id&quot;,
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;connection);&nbsp;&nb=
sp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=
&nbsp;
&nbsp;&nbsp;<span class=3DSpellE>myCommand.SelectCommand.Parameters.Add</sp=
an>(&quot;@<span
class=3DSpellE>au_id</span>&quot;, <span class=3DSpellE>SqlDbType.VarChar</=
span>,
11);</span></i></b><span style=3D'font-size:9.0pt;font-family:"Verdana","sa=
ns-serif";
mso-fareast-font-family:"Times New Roman";mso-bidi-font-family:"Times New R=
oman";
color:#BDD5DA'> </span><b><i><span style=3D'font-size:9.0pt;mso-bidi-font-s=
ize:
11.0pt;font-family:"Verdana","sans-serif";mso-fareast-font-family:"Times Ne=
w Roman";
mso-bidi-font-family:"Times New Roman";color:#BDD5DA'>&nbsp; <span
class=3DSpellE>myCommand.SelectCommand.Parameters</span>[&quot;@<span
class=3DSpellE>au_id</span>&quot;].Value =3D <span class=3DSpellE>SSN.Text<=
/span>;</span></i></b><span
style=3D'font-size:9.0pt;font-family:"Verdana","sans-serif";mso-fareast-fon=
t-family:
"Times New Roman";mso-bidi-font-family:"Times New Roman";color:#BDD5DA'> </=
span><b><i><span
style=3D'font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:"Verdana","s=
ans-serif";
mso-fareast-font-family:"Times New Roman";mso-bidi-font-family:"Times New R=
oman";
color:#BDD5DA'>&nbsp; <span class=3DSpellE>myDataAdapter.Fill</span>(<span
class=3DSpellE>userDataset</span>);</span></i></b><span style=3D'font-size:=
9.0pt;
font-family:"Verdana","sans-serif";mso-fareast-font-family:"Times New Roman=
";
mso-bidi-font-family:"Times New Roman";color:#BDD5DA'> </span><b><i><span
style=3D'font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:"Verdana","s=
ans-serif";
mso-fareast-font-family:"Times New Roman";mso-bidi-font-family:"Times New R=
oman";
color:#BDD5DA'>}</span></i></b><span style=3D'font-size:9.0pt;font-family:"=
Verdana","sans-serif";
mso-fareast-font-family:"Times New Roman";mso-bidi-font-family:"Times New R=
oman";
color:#BDD5DA'> </span><b><i><span style=3D'font-size:9.0pt;mso-bidi-font-s=
ize:
11.0pt;font-family:"Verdana","sans-serif";mso-fareast-font-family:"Times Ne=
w Roman";
mso-bidi-font-family:"Times New Roman";color:#BDD5DA'>&nbsp;</span></i></b>=
<span
style=3D'font-size:9.0pt;font-family:"Verdana","sans-serif";mso-fareast-fon=
t-family:
"Times New Roman";mso-bidi-font-family:"Times New Roman";color:#BDD5DA'> <o=
:p></o:p></span></p>

<p class=3DMsoNormal style=3D'mso-margin-top-alt:auto;mso-margin-bottom-alt=
:auto;
line-height:13.5pt'><b><span style=3D'font-size:9.0pt;mso-bidi-font-size:11=
.0pt;
font-family:"Verdana","sans-serif";mso-fareast-font-family:"Times New Roman=
";
mso-bidi-font-family:"Times New Roman";color:#BDD5DA'>Using a least privile=
ged
database account:</span></b><span style=3D'font-size:9.0pt;font-family:"Ver=
dana","sans-serif";
mso-fareast-font-family:"Times New Roman";mso-bidi-font-family:"Times New R=
oman";
color:#BDD5DA'><o:p></o:p></span></p>

<p class=3DMsoNormal style=3D'mso-margin-top-alt:auto;mso-margin-bottom-alt=
:auto;
line-height:13.5pt'><span style=3D'font-size:9.0pt;font-family:"Verdana","s=
ans-serif";
mso-fareast-font-family:"Times New Roman";mso-bidi-font-family:"Times New R=
oman";
color:#BDD5DA'>Your application should connect to the database by using a
least-privileged account. If you use Windows authentication to connect, the
Windows account should be least-privileged from an operating </span><span
style=3D'color:#BDD5DA'><a
href=3D"http://www.articlesbase.com/security-articles/secure-aspnet-coding-=
practice-for-three-most-critical-vulnerabilities-in-web-application-889853.=
html"
target=3D"_new"><span style=3D'font-size:9.0pt;mso-bidi-font-size:11.0pt;
font-family:"Verdana","sans-serif";mso-fareast-font-family:"Times New Roman=
";
mso-bidi-font-family:"Times New Roman";color:#BDD5DA'>system</span></a></sp=
an><span
style=3D'font-size:9.0pt;font-family:"Verdana","sans-serif";mso-fareast-fon=
t-family:
"Times New Roman";mso-bidi-font-family:"Times New Roman";color:#BDD5DA'>
perspective and should have limited privileges and limited ability to access
Windows resources. Additionally, whether or not you use Windows authenticat=
ion
or SQL authentication, the corresponding SQL Server login should be restric=
ted
by permissions in the database.<o:p></o:p></span></p>

<p class=3DMsoNormal style=3D'mso-margin-top-alt:auto;mso-margin-bottom-alt=
:auto;
line-height:13.5pt'><span style=3D'font-size:9.0pt;font-family:"Verdana","s=
ans-serif";
mso-fareast-font-family:"Times New Roman";mso-bidi-font-family:"Times New R=
oman";
color:#BDD5DA'>If your ASP.NET application only performs database lookups a=
nd
does not update any data, you only need to grant read access to the tables.
This limits the damage that an attacker can cause if the attacker succeeds =
in a
SQL injection attack.<o:p></o:p></span></p>

<p class=3DMsoNormal style=3D'mso-margin-top-alt:auto;mso-margin-bottom-alt=
:auto;
line-height:13.5pt;mso-outline-level:3'><span style=3D'font-size:9.0pt;
font-family:"Verdana","sans-serif";mso-fareast-font-family:"Times New Roman=
";
mso-bidi-font-family:"Times New Roman";color:#BDD5DA'>Avoid Disclosing Error
Information<o:p></o:p></span></p>

<p class=3DMsoNormal style=3D'mso-margin-top-alt:auto;mso-margin-bottom-alt=
:auto;
line-height:13.5pt'><span style=3D'font-size:9.0pt;font-family:"Verdana","s=
ans-serif";
mso-fareast-font-family:"Times New Roman";mso-bidi-font-family:"Times New R=
oman";
color:#BDD5DA'>Use structured exception handling to catch errors and prevent
them from propagating back to the client. Log detailed error information
locally, but return limited error details to the client.<o:p></o:p></span><=
/p>

<p class=3DMsoNormal style=3D'mso-margin-top-alt:auto;mso-margin-bottom-alt=
:auto;
line-height:13.5pt'><span style=3D'font-size:9.0pt;font-family:"Verdana","s=
ans-serif";
mso-fareast-font-family:"Times New Roman";mso-bidi-font-family:"Times New R=
oman";
color:#BDD5DA'>If errors occur while the user is connecting to the database=
, be
sure that you provide only limited information about the nature of the erro=
r to
the user. If you disclose information related to </span><span style=3D'colo=
r:
yellow'><a
href=3D"http://www.articlesbase.com/security-articles/secure-aspnet-coding-=
practice-for-three-most-critical-vulnerabilities-in-web-application-889853.=
html"
target=3D"_new"><span style=3D'font-size:9.0pt;mso-bidi-font-size:11.0pt;
font-family:"Verdana","sans-serif";mso-fareast-font-family:"Times New Roman=
";
mso-bidi-font-family:"Times New Roman";color:#BDD5DA'>data access</span></a=
></span><span
style=3D'font-size:9.0pt;font-family:"Verdana","sans-serif";mso-fareast-fon=
t-family:
"Times New Roman";mso-bidi-font-family:"Times New Roman";color:#BDD5DA'> and
database errors, you could provide a malicious user with useful information
that he or she can use to compromise your database security. Attackers use =
the
information in detailed error messages to help deconstruct a SQL query that
they are trying to inject with malicious code. A detailed error message may
reveal valuable information such as the connection string, SQL server name,=
 or
table and database naming conventions.<o:p></o:p></span></p>

<p class=3DMsoNormal style=3D'mso-margin-top-alt:auto;mso-margin-bottom-alt=
:auto;
line-height:13.5pt'><b><span style=3D'font-size:9.0pt;mso-bidi-font-size:11=
.0pt;
font-family:"Verdana","sans-serif";mso-fareast-font-family:"Times New Roman=
";
mso-bidi-font-family:"Times New Roman";color:#BDD5DA'>Information leakage:
Remember that __VIEWSTATE data can be viewed</span></b><span style=3D'font-=
size:
9.0pt;font-family:"Verdana","sans-serif";mso-fareast-font-family:"Times New=
 Roman";
mso-bidi-font-family:"Times New Roman";color:#BDD5DA'><o:p></o:p></span></p>

<p class=3DMsoNormal style=3D'mso-margin-top-alt:auto;mso-margin-bottom-alt=
:auto;
line-height:13.5pt'><span style=3D'font-size:9.0pt;font-family:"Verdana","s=
ans-serif";
mso-fareast-font-family:"Times New Roman";mso-bidi-font-family:"Times New R=
oman";
color:#BDD5DA'>The __VIEWSTATE&#8217;s Base64 encoding can be easily decode=
d,
and the __VIEWSTATE data can be exposed with minimal effort. Now the attack=
er
can see the information that may be sensitive, such as internal state data =
of
the <span class=3DSpellE>application.To</span> encrypt the __VIEWSTATE data=
 we
have to add the <span class=3DSpellE>machineKey</span> attribute in <span
class=3DSpellE><span class=3DGramE>web.config</span></span><span class=3DGr=
amE>
&nbsp;file</span> as follows:<o:p></o:p></span></p>

<p class=3DMsoNormal style=3D'mso-margin-top-alt:auto;mso-margin-bottom-alt=
:auto;
line-height:13.5pt'><b><i><span style=3D'font-size:9.0pt;mso-bidi-font-size=
:11.0pt;
font-family:"Verdana","sans-serif";mso-fareast-font-family:"Times New Roman=
";
mso-bidi-font-family:"Times New Roman";color:#BDD5DA'>&lt;<span class=3DGra=
mE>configuration</span>&gt;</span></i></b><span
style=3D'font-size:9.0pt;font-family:"Verdana","sans-serif";mso-fareast-fon=
t-family:
"Times New Roman";mso-bidi-font-family:"Times New Roman";color:#BDD5DA'><o:=
p></o:p></span></p>

<p class=3DMsoNormal style=3D'mso-margin-top-alt:auto;mso-margin-bottom-alt=
:auto;
line-height:13.5pt'><b><i><span style=3D'font-size:9.0pt;mso-bidi-font-size=
:11.0pt;
font-family:"Verdana","sans-serif";mso-fareast-font-family:"Times New Roman=
";
mso-bidi-font-family:"Times New Roman";color:#BDD5DA'>&lt;system.web&gt;</s=
pan></i></b><span
style=3D'font-size:9.0pt;font-family:"Verdana","sans-serif";mso-fareast-fon=
t-family:
"Times New Roman";mso-bidi-font-family:"Times New Roman";color:#BDD5DA'><o:=
p></o:p></span></p>

<p class=3DMsoNormal style=3D'mso-margin-top-alt:auto;mso-margin-bottom-alt=
:auto;
line-height:13.5pt'><b><i><span style=3D'font-size:9.0pt;mso-bidi-font-size=
:11.0pt;
font-family:"Verdana","sans-serif";mso-fareast-font-family:"Times New Roman=
";
mso-bidi-font-family:"Times New Roman";color:#BDD5DA'>&lt;<span class=3DSpe=
llE>machineKey</span>
validation=3D&quot;3DES&quot;/&gt;</span></i></b><span style=3D'font-size:9=
.0pt;
font-family:"Verdana","sans-serif";mso-fareast-font-family:"Times New Roman=
";
mso-bidi-font-family:"Times New Roman";color:#BDD5DA'><o:p></o:p></span></p>

<p class=3DMsoNormal style=3D'mso-margin-top-alt:auto;mso-margin-bottom-alt=
:auto;
line-height:13.5pt'><b><i><span style=3D'font-size:9.0pt;mso-bidi-font-size=
:11.0pt;
font-family:"Verdana","sans-serif";mso-fareast-font-family:"Times New Roman=
";
mso-bidi-font-family:"Times New Roman";color:#BDD5DA'>&lt;/system.web&gt;</=
span></i></b><span
style=3D'font-size:9.0pt;font-family:"Verdana","sans-serif";mso-fareast-fon=
t-family:
"Times New Roman";mso-bidi-font-family:"Times New Roman";color:#BDD5DA'><o:=
p></o:p></span></p>

<p class=3DMsoNormal style=3D'mso-margin-top-alt:auto;mso-margin-bottom-alt=
:auto;
line-height:13.5pt'><b><i><span style=3D'font-size:9.0pt;mso-bidi-font-size=
:11.0pt;
font-family:"Verdana","sans-serif";mso-fareast-font-family:"Times New Roman=
";
mso-bidi-font-family:"Times New Roman";color:#BDD5DA'>&lt;/configuration&gt=
;</span></i></b><span
style=3D'font-size:9.0pt;font-family:"Verdana","sans-serif";mso-fareast-fon=
t-family:
"Times New Roman";mso-bidi-font-family:"Times New Roman";color:#BDD5DA'><o:=
p></o:p></span></p>

<p class=3DMsoNormal style=3D'margin-bottom:0in;margin-bottom:.0001pt;line-=
height:
10.5pt'><span style=3D'font-size:8.5pt;font-family:"Verdana","sans-serif";
mso-fareast-font-family:"Times New Roman";mso-bidi-font-family:"Times New R=
oman";
color:black;display:none;mso-hide:all'>Retrieved from &quot;</span><a
href=3D"http://www.articlesbase.com/security-articles/secure-aspnet-coding-=
practice-for-three-most-critical-vulnerabilities-in-web-application-889853.=
html"><span
style=3D'font-size:8.5pt;mso-bidi-font-size:11.0pt;font-family:"Verdana","s=
ans-serif";
mso-fareast-font-family:"Times New Roman";mso-bidi-font-family:"Times New R=
oman";
display:none;mso-hide:all'>http://www.articlesbase.com/security-articles/se=
cure-aspnet-coding-practice-for-three-most-critical-vulnerabilities-in-web-=
application-889853.html</span></a><span
style=3D'font-size:8.5pt;font-family:"Verdana","sans-serif";mso-fareast-fon=
t-family:
"Times New Roman";mso-bidi-font-family:"Times New Roman";color:black;
display:none;mso-hide:all'>&quot;<o:p></o:p></span></p>

<p class=3DMsoNormal><o:p>&nbsp;</o:p></p>

</div>

</body>

</html>

------=_NextPart_01CAF0E9.D7984FD0
Content-Location: file:///C:/486BB0C5/practice_files/themedata.thmx
Content-Transfer-Encoding: base64
Content-Type: application/vnd.ms-officetheme

UEsDBBQABgAIAAAAIQCCirwT+gAAABwCAAATAAAAW0NvbnRlbnRfVHlwZXNdLnhtbKyRy2rDMBBF
94X+g9C22HK6KKXYzqJJd30s0g8Y5LEtao+ENAnJ33fsuFC6CC10IxBizpl7Va6P46AOGJPzVOlV
XmiFZH3jqKv0++4pu9cqMVADgyes9AmTXtfXV+XuFDApmaZU6Z45PBiTbI8jpNwHJHlpfRyB5Ro7
E8B+QIfmtijujPXESJzxxNB1+SoLRNegeoPILzCKx7Cg8Pv5DCSAmAtYq8czYVqi0hDC4CywRDAH
an7oM9+2zmLj7X4UaT6DF9jNBDO/XGD1P+ov5wZb2A+stkfp4lx/xCH9LdtSay6Tc/7Uu5AuGC6X
t7Rh5r+tPwEAAP//AwBQSwMEFAAGAAgAAAAhAKXWp+fAAAAANgEAAAsAAABfcmVscy8ucmVsc4SP
z2rDMAyH74W9g9F9UdLDGCV2L6WQQy+jfQDhKH9oIhvbG+vbT8cGCrsIhKTv96k9/q6L+eGU5yAW
mqoGw+JDP8to4XY9v3+CyYWkpyUIW3hwhqN727VfvFDRozzNMRulSLYwlRIPiNlPvFKuQmTRyRDS
SkXbNGIkf6eRcV/XH5ieGeA2TNP1FlLXN2Cuj6jJ/7PDMMyeT8F/ryzlRQRuN5RMaeRioagv41O9
kKhlqtQe0LW4+db9AQAA//8DAFBLAwQUAAYACAAAACEAa3mWFoMAAACKAAAAHAAAAHRoZW1lL3Ro
ZW1lL3RoZW1lTWFuYWdlci54bWwMzE0KwyAQQOF9oXeQ2TdjuyhFYrLLrrv2AEOcGkHHoNKf29fl
44M3zt8U1ZtLDVksnAcNimXNLoi38Hwspxuo2kgcxSxs4ccV5ul4GMm0jRPfSchzUX0j1ZCFrbXd
INa1K9Uh7yzdXrkkaj2LR1fo0/cp4kXrKyYKAjj9AQAA//8DAFBLAwQUAAYACAAAACEAqn1sqIgG
AABTGwAAFgAAAHRoZW1lL3RoZW1lL3RoZW1lMS54bWzsWc1vHDUUvyPxP1hzb5PNF0nUTdV8NdCm
jbLboh7fznhn3HjGI9ubdG+oPSIhIQriQCVuHBBQqZW4lL8mUARF6r/Asz2za2dn27SNoILuSMmO
/fP7fs/P3gsX7+ScHFKpmCjaUev8bERoEYuEFWk7utHdPrccEaWhSICLgrajIVXRxbX337sAqzqj
OSW4vlCr0I4yrcvVmRkV4zCo86KkBc71hcxB46tMZxIJR0g35zNzs7NLMzmwIiIF5Ej2er/PYkq6
hmS0VhPf4vhaaGUGYi47hjStVlyWMFQxcAdPDloGpIZqg0tyCLwdIatEHHXpHR0RDkrjRDuatZ9o
Zu3CDKxWi7iestZbt20/1bpqQXIwZ3nKtDdieoK+BXA9idteNs+IngVAHKOyThaf5qb9VFgP5L5O
0l6fM0+A9+jPT8i8smSeAG9Bjv7CBH551jwB3oIcfnECv7htngBvQQ6/NIFf2DRPgLegjLPiYAId
UB9B+oLvNMJXWuapiI9RGA2jADMs+qLQQbi5AI3MXA63hdxGgHnhoFlB9LCkfYgxkDcg70kGhgGs
UvBm3FCsJoYML6JiyUrdjj4qAZNiTO/5kx+eP3lEju8+Pr778/G9e8d3f3KEglU7UKT+qmffff7X
g0/In4++fXb/y2a88vG//fjpr7980QzE9BmL8/Srh78/fvj068/++P5+A/yShJ4P77KcKnKNHpF9
kaNi1iqh5LQnX21FNwPmr7hUpAoKMFwa6G/pLEBfGwKvvBPIsU5DC96UWD6agJcHtwOBO5kcaNbA
+UqWB8BdIfi6kI1WuGJ4eWbuDoq0mbkc+Lh9gMMm3htQBP7dGpRYOuuwDBTfyGgg5h6HQkNKC6qJ
mRMHlDZod4uxwK67LJZCib4mtxhZB9Zoki7rBdE0XrTDcvTLsEln9Hdgm92bZF3wJq036WGIxKwA
3iB8l/LAjJdhoCFvItmFnPsGvwo6axKyM5Sxj9tSGj2dUi7IVkKValpzXaK+ntOvAFasRrfv8mEe
IqVmB000r4IQPnJTHGxkkJdN2A4rMh/7oTrAEAWyJ3QTfFeEGWLe0Q9QTHX3TUYDd7+8GtxgaSDS
OEDMzEAaX2KpDipwzooXlWPOsB67GDi7cowF8Ok3Dxoi620txJdwT2rKhJ0T5Xca7mTR3RAyYW9/
zd2EQbFHMcwnN553JfddyY3+8yV3Wj6fttCOayuWXdM3uKbYtsj51A65zzjv6CGnV5VtkhXuE8k2
Dpp19oBIRyemMsOvVV0PcKkEu4ZIoT9mOutkUGKD3bI9eKoq0qkipVB4sLPDjbQNU2zStTsWLpoj
mqsHCvSuSNzwvH8wHJGxu01qz581o3lD4LTM5j94M2YtJ9VUs4WqtaxottQFqo1URh9OqoaDI2ti
A0KwbUErL+ER3ciOBxM8YyfG7m7vrd1iWNffz8RFKoOEVj4yek/6qGWdVMeKvQzA2Gnw0bIV/YVW
87itGLJvwO00TvLZLUxhV3vvTbxUH8trz1jjnExHXvjJyQty1I5WFucWIxJD2Y76eKbFr3mJXlem
5wOe4t1QrKUL+5cmszX82JsrtWIYfV7GtWbr8QmFgzpQSqU3QWUuNOxUFQK8MJyc/HOLaNazUsBF
+mtIMb+MwfCvSYF2DF1L+30aa9/Z3oixnXutSqkYaCo7WXJEenwg9wHdb0IV9UmYwqsJWxHMC96j
GWvbqbA4V4XRv72yODcOvMygKrcmRetMdnAbqiMZ7JsnHurWKLtV7tVVsSl/Rqr4Yfw/U8XsJ3hT
MJ8YD8R4kyuBmHxtR0LqTGAVKjMWb0tsHGztwGjBu1icxqDC+2T7X9JD89/lnKNh0xoPfHqfpUQy
3I90Jindw7Jko+8lxFrV3uVI8oqQjShPXFU6sXv0kPKuqYFLZm+PSIahbqtJVQYs7mT8he9VBvVS
0+T4+RbUkNHe63Lgn+58XDKjUmEdtg1Nbf+RiNZaYefj1tvl9d7rK2Imxm3WQp0VyMzbClaqtH9N
EV5xq3UVa0LjucVaOPTipMY4OGqISrzvIeYP7n9MxtWvDWZD7Yp9rK0Ef2gwxDBsMKrPucaDmALp
BnvYOLlBF0yGlDNt1d0aq9Wb9Zm0UWMXjPieMLaR7DT+fkVjj5qzkF2Qi2dp7MrCga3d2FRTo2dP
pigO9euDjHWM/VXL/+FJ9G6jozfxfn/AtbLBhL8pScDWs2PzAJPfcbRL1/4GAAD//wMAUEsDBBQA
BgAIAAAAIQAN0ZCftgAAABsBAAAnAAAAdGhlbWUvdGhlbWUvX3JlbHMvdGhlbWVNYW5hZ2VyLnht
bC5yZWxzhI9NCsIwFIT3gncIb2/TuhCRJt2I0K3UA4TkNQ02PyRR7O0NriwILodhvplpu5edyRNj
Mt4xaKoaCDrplXGawW247I5AUhZOidk7ZLBggo5vN+0VZ5FLKE0mJFIoLjGYcg4nSpOc0IpU+YCu
OKOPVuQio6ZByLvQSPd1faDxmwF8xSS9YhB71QAZllCa/7P9OBqJZy8fFl3+UUFz2YUFKKLGzOAj
m6pMBMpburrE3wAAAP//AwBQSwECLQAUAAYACAAAACEAgoq8E/oAAAAcAgAAEwAAAAAAAAAAAAAA
AAAAAAAAW0NvbnRlbnRfVHlwZXNdLnhtbFBLAQItABQABgAIAAAAIQCl1qfnwAAAADYBAAALAAAA
AAAAAAAAAAAAACsBAABfcmVscy8ucmVsc1BLAQItABQABgAIAAAAIQBreZYWgwAAAIoAAAAcAAAA
AAAAAAAAAAAAABQCAAB0aGVtZS90aGVtZS90aGVtZU1hbmFnZXIueG1sUEsBAi0AFAAGAAgAAAAh
AKp9bKiIBgAAUxsAABYAAAAAAAAAAAAAAAAA0QIAAHRoZW1lL3RoZW1lL3RoZW1lMS54bWxQSwEC
LQAUAAYACAAAACEADdGQn7YAAAAbAQAAJwAAAAAAAAAAAAAAAACNCQAAdGhlbWUvdGhlbWUvX3Jl
bHMvdGhlbWVNYW5hZ2VyLnhtbC5yZWxzUEsFBgAAAAAFAAUAXQEAAIgKAAAAAA==

------=_NextPart_01CAF0E9.D7984FD0
Content-Location: file:///C:/486BB0C5/practice_files/colorschememapping.xml
Content-Transfer-Encoding: quoted-printable
Content-Type: text/xml

<?xml version=3D"1.0" encoding=3D"UTF-8" standalone=3D"yes"?>
<a:clrMap xmlns:a=3D"http://schemas.openxmlformats.org/drawingml/2006/main"=
 bg1=3D"lt1" tx1=3D"dk1" bg2=3D"lt2" tx2=3D"dk2" accent1=3D"accent1" accent=
2=3D"accent2" accent3=3D"accent3" accent4=3D"accent4" accent5=3D"accent5" a=
ccent6=3D"accent6" hlink=3D"hlink" folHlink=3D"folHlink"/>
------=_NextPart_01CAF0E9.D7984FD0
Content-Location: file:///C:/486BB0C5/practice_files/filelist.xml
Content-Transfer-Encoding: quoted-printable
Content-Type: text/xml; charset="utf-8"

<xml xmlns:o=3D"urn:schemas-microsoft-com:office:office">
 <o:MainFile HRef=3D"../practice.htm"/>
 <o:File HRef=3D"themedata.thmx"/>
 <o:File HRef=3D"colorschememapping.xml"/>
 <o:File HRef=3D"filelist.xml"/>
</xml>
------=_NextPart_01CAF0E9.D7984FD0--
