Our coding guidelines impose certain constraints on application code (though they typically require only limited
changes to existing code). In contrast,many existing approaches to the prevention and detection of XSS aim to be applicable to existing, unmodified code. This requirement makes the problem much more difficult, and generally requires the use of complex whole-program static and/or dynamic data-flow analysis techniques. For an overview of existing work in this area, see Mike Samuel et al.6 Relaxing this requirement negates the need for special-purpose tools and technologies (such as runtime taint tracking or whole-program static analysis), allowing us to rely solely on the combination of software design, coding guidelines enforceable by very simple static checks, existing language-native type
systems, and a small enhancement to existing contextually auto-escaping template systems. Thus, our approach
can be used in applications written in a variety of programming languages, without placing special requirements
on tool chains, build systems, or runtime environments.