Context-sensitive auto-sanitization in web templating languages using type qualifiers

Mike Samuel, Prateek Saxena, Dawn Song
2011 Proceedings of the 18th ACM conference on Computer and communications security - CCS '11  
Scripting vulnerabilities, such as cross-site scripting (XSS), plague web applications today. Most research on defense techniques has focused on securing existing legacy applications written in general-purpose languages, such as Java and PHP. However, recent and emerging applications have widely adopted web templating frameworks that have received little attention in research. Web templating frameworks offer an ideal opportunity to ensure safety against scripting attacks by secure construction,
more » ... but most of today's frameworks fall short of achieving this goal. We propose a novel and principled type-qualifier based mechanism that can be bolted onto existing web templating frameworks. Our solution permits rich expressiveness in the templating language while achieving backwards compatibility, performance and formal security through a context-sensitive autosanitization (CSAS) engine. To demonstrate its practicality, we implement our mechanism in Google Closure Templates, a commercially used open-source templating framework that is used in GMail, Google Docs and other applications. Our approach is fast, precise and retrofits to existing commercially deployed template code without requiring any changes or annotations.
doi:10.1145/2046707.2046775 dblp:conf/ccs/SamuelSS11 fatcat:z7pxkyberzboroqtvuvdrc4nrm