Marius Steffens, C. Rossow, Martin Johns, Ben Stock
{"title":"Don't Trust The Locals: Investigating the Prevalence of Persistent Client-Side Cross-Site Scripting in the Wild","authors":"Marius Steffens, C. Rossow, Martin Johns, Ben Stock","doi":"10.14722/ndss.2019.23009","DOIUrl":null,"url":null,"abstract":"The Web has become highly interactive and an \nimportant driver for modern life, enabling information retrieval, \nsocial exchange, and online shopping. From the security perspective, Cross-Site Scripting (XSS) is one of the most nefarious \nattacks against Web clients. Research has long since focused \non three categories of XSS: Reflected, Persistent, and DOMbased XSS. In this paper, we argue that our community must \nconsider at least four important classes of XSS, and present \nthe first systematic study of the threat of Persistent Client-Side \nXSS, caused by the insecure use of client-side storage. While \nthe existence of this class has been acknowledged, especially by \nthe non-academic community like OWASP, prior works have \neither only found such flaws as side effects of other analyses or \nfocused on a limited set of applications to analyze. Therefore, the \ncommunity lacks in-depth knowledge about the actual prevalence \nof Persistent Client-Side XSS in the wild. \nTo close this research gap, we leverage taint tracking to \nidentify suspicious flows from client-side persistent storage (Web \nStorage, cookies) to dangerous sinks (HTML, JavaScript, and \nscript.src). We discuss two attacker models capable of \ninjecting malicious payloads into storage, i.e., a Network Attacker \ncapable of temporarily hijacking HTTP communication (e.g., in \na public WiFi), and a Web Attacker who can leverage flows into \nstorage or an existing reflected XSS flaw to persist their payload. \nWith our taint-aware browser and these models in mind, we \nstudy the prevalence of Persistent Client-Side XSS in the Alexa \nTop 5,000 domains. We find that more than 8% of them have \nunfiltered data flows from persistent storage to a dangerous sink, \nwhich showcases the developers’ inherent trust in the integrity \nof storage content. Even worse, if we only consider sites that \nmake use of data originating from storage, 21% of the sites are \nvulnerable. For those sites with vulnerable flows from storage \nto sink, we find that at least 70% are directly exploitable by \nour attacker models. Finally, investigating the vulnerable flows \noriginating from storage allows us to categorize them into four \ndisjoint categories and propose appropriate mitigations.","PeriodicalId":20444,"journal":{"name":"Proceedings 2019 Network and Distributed System Security Symposium","volume":"87 1","pages":""},"PeriodicalIF":0.0000,"publicationDate":"2019-02-01","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":"56","resultStr":null,"platform":"Semanticscholar","paperid":null,"PeriodicalName":"Proceedings 2019 Network and Distributed System Security Symposium","FirstCategoryId":"1085","ListUrlMain":"https://doi.org/10.14722/ndss.2019.23009","RegionNum":0,"RegionCategory":null,"ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":null,"EPubDate":"","PubModel":"","JCR":"","JCRName":"","Score":null,"Total":0}
引用次数: 56
Abstract
The Web has become highly interactive and an
important driver for modern life, enabling information retrieval,
social exchange, and online shopping. From the security perspective, Cross-Site Scripting (XSS) is one of the most nefarious
attacks against Web clients. Research has long since focused
on three categories of XSS: Reflected, Persistent, and DOMbased XSS. In this paper, we argue that our community must
consider at least four important classes of XSS, and present
the first systematic study of the threat of Persistent Client-Side
XSS, caused by the insecure use of client-side storage. While
the existence of this class has been acknowledged, especially by
the non-academic community like OWASP, prior works have
either only found such flaws as side effects of other analyses or
focused on a limited set of applications to analyze. Therefore, the
community lacks in-depth knowledge about the actual prevalence
of Persistent Client-Side XSS in the wild.
To close this research gap, we leverage taint tracking to
identify suspicious flows from client-side persistent storage (Web
Storage, cookies) to dangerous sinks (HTML, JavaScript, and
script.src). We discuss two attacker models capable of
injecting malicious payloads into storage, i.e., a Network Attacker
capable of temporarily hijacking HTTP communication (e.g., in
a public WiFi), and a Web Attacker who can leverage flows into
storage or an existing reflected XSS flaw to persist their payload.
With our taint-aware browser and these models in mind, we
study the prevalence of Persistent Client-Side XSS in the Alexa
Top 5,000 domains. We find that more than 8% of them have
unfiltered data flows from persistent storage to a dangerous sink,
which showcases the developers’ inherent trust in the integrity
of storage content. Even worse, if we only consider sites that
make use of data originating from storage, 21% of the sites are
vulnerable. For those sites with vulnerable flows from storage
to sink, we find that at least 70% are directly exploitable by
our attacker models. Finally, investigating the vulnerable flows
originating from storage allows us to categorize them into four
disjoint categories and propose appropriate mitigations.