• Title/Summary/Keyword: HTML sanitization

Search Result 1, Processing Time 0.016 seconds

Taint Inference for Cross-Site Scripting in Context of URL Rewriting and HTML Sanitization

  • Pan, Jinkun;Mao, Xiaoguang;Li, Weishi
    • ETRI Journal
    • /
    • v.38 no.2
    • /
    • pp.376-386
    • /
    • 2016
  • Currently, web applications are gaining in prevalence. In a web application, an input may not be appropriately validated, making the web application susceptible to cross-site scripting (XSS), which poses serious security problems for Internet users and websites to whom such trusted web pages belong. A taint inference is a type of information flow analysis technique that is useful in detecting XSS on the client side. However, in existing techniques, two current practical issues have yet to be handled properly. One is URL rewriting, which transforms a standard URL into a clearer and more manageable form. Another is HTML sanitization, which filters an input against blacklists or whitelists of HTML tags or attributes. In this paper, we make an analogy between the taint inference problem and the molecule sequence alignment problem in bioinformatics, and transfer two techniques related to the latter over to the former to solve the aforementioned yet-to-be-handled-properly practical issues. In particular, in our method, URL rewriting is addressed using local sequence alignment and HTML sanitization is modeled by introducing a removal gap penalty. Empirical results demonstrate the effectiveness and efficiency of our method.