11.07.2015 Views

Improving Web Application Security: Threats and - CGISecurity

Improving Web Application Security: Threats and - CGISecurity

Improving Web Application Security: Threats and - CGISecurity

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

610 Part V: Assessing Your <strong>Security</strong>The following table shows some common situations where Response.Write is usedwith input fields.Table 21.1 Possible Sources of InputInput SourceExamplesForm FieldsResponse.Write(name.Text);Response.Write(Request.Form["name"]);Query StringsCookiesSession <strong>and</strong> <strong>Application</strong>variablesDatabases <strong>and</strong> datastoresResponse.Write(Request.QueryString["name"]);Response.Write(Request.Cookies["name"].Values["name"]);Response.Write(Session["name"]);Response.Write(<strong>Application</strong>["name"]);SqlDataReader reader = cmd.ExecuteReader();Response.Write(reader.GetString(1));Identify Potentially Dangerous HTML Tags <strong>and</strong> AttributesWhile not exhaustive, the following commonly used HTML tags could allow amalicious user to inject script code:●●●●●●●●●●●●●●HTML attributes such as src, lowsrc, style, <strong>and</strong> href can be used in conjunction withthe tags above to cause XSS.For example, the src attribute of the tag can be a source of injection as shownin the following examples.The tag also can be a source of injection by changing the MIME type asshown below.alert('hello');

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!