
XSS Theory 9 Chapter 3 85
the application that is developed. In general, the developer needs to ensure that meta-charac-
ters such as <, >, ~, ;, ", and ' are escaped and presented as XML entities. This is not a rule
that can be applied to all situations, though.
The not-vulnerable version of our fictitious application is displayed here. Notice that we
use the sanitization function
escapeHTML:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http-//www. w3. org/TR/xhtmll/DTD/xhtmll-transitional, dtd">
<html xmlns="http.//www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" ...