CISPA
Browse
cispa_all_3505.pdf (643.97 kB)

Where We Stand (or Fall): An Analysis of CSRF Defenses in Web Frameworks

Download (643.97 kB)
conference contribution
posted on 2023-11-29, 18:17 authored by Xhelal Likaj, Soheil KhodayariSoheil Khodayari, Giancarlo PellegrinoGiancarlo Pellegrino
Cross-Site Request Forgery (CSRF) is among the oldest web vulnerabilities that, despite its popularity and severity, it is still an understudied security problem. In this paper, we undertake one of the first security evaluations of CSRF defense as implemented by popular web frameworks, with the overarching goal to identify additional explanations to the occurrences of such an old vulnerability. Starting from a review of existing literature, we identify 16 CSRF defenses and 18 potential threats agains them. Then, we evaluate the source code of the 44 most popular web frameworks across five languages (i.e., JavaScript, Python, Java, PHP, and C#) covering about 5.5 million LoCs, intending to determine the implemented defenses and their exposure to the identified threats. We also quantify the quality of web frameworks' documentation, looking for incomplete, misleading, or insufficient information required by developers to use the implemented CSRF defenses correctly. Our study uncovers a rather complex landscape, suggesting that while implementations of CSRF defenses exist, their correct and secure use depends on developers' awareness and expertise about CSRF attacks. More than a third of the frameworks require developers to write code to use the defense, modify the configuration to enable CSRF defenses, or look for an external library as CSRF defenses are not built-in. Even when using defenses, developers need to be aware and address a diversity of additional security risks. In total, we identified 157 security risks in 37 frameworks, of which 17 are directly exploitable to mount a CSRF attack, leveraging implementation mistakes, cryptography-related flaws, cookie integrity, and leakage of CSRF tokens---including three critical vulnerabilities in CakePHP, Vert.x-Web, and Play. The developers' feedback indicate that, for a significant fraction of risks, frameworks have divergent expectations about who is responsible for addressing them. Finally, the documentation analysis reveals several inadequacies, including not mentioning the implemented defense, and not showing code examples for correct use.

History

Preferred Citation

Xhelal Likaj, Soheil Khodayari and Giancarlo Pellegrino. Where We Stand (or Fall): An Analysis of CSRF Defenses in Web Frameworks. In: The International Symposium on Research in Attacks, Intrusions and Defenses (RAID). 2021.

Primary Research Area

  • Empirical and Behavioral Security

Name of Conference

The International Symposium on Research in Attacks, Intrusions and Defenses (RAID)

Legacy Posted Date

2021-10-13

Open Access Type

  • Green

BibTeX

@inproceedings{cispa_all_3505, title = "Where We Stand (or Fall): An Analysis of CSRF Defenses in Web Frameworks", author = "Likaj, Xhelal and Khodayari, Soheil and Pellegrino, Giancarlo", booktitle="{The International Symposium on Research in Attacks, Intrusions and Defenses (RAID)}", year="2021", }

Usage metrics

    Categories

    No categories selected

    Exports

    RefWorks
    BibTeX
    Ref. manager
    Endnote
    DataCite
    NLM
    DC