{{alert(’CSTI’)}}: Large-Scale Detection of Client-Side Template Injection

Pisu, Lorenzo
First
;
Maiorca, Davide;Giacinto, Giorgio
2025-01-01

Abstract

Template engines are software components that enable the creation of reusable HTML elements containing special keywords that can dynamically alter the page’s rendering based on the presented data. This technology is widely used in server-side applications and frameworks, and in recent years, it has also gained adoption on the client side through JavaScript frameworks and libraries. Client-Side Template Injection (CSTI) is a vulnerability that occurs when user input is reflected inside a template and rendered as part of it, allowing attackers to inject malicious instructions. This can trick the template engine into executing arbitrary JavaScript code, potentially leading to Cross-Site Scripting (XSS). Despite the widespread adoption of template engines in production websites, a comprehensive study of their characteristics remains absent. In our study, we begin by providing an overview of the main features of template engines, highlighting attributes that play a crucial role in escalating CSTI to XSS. We then use these extracted characteristics to develop a systematic methodology for detecting CSTI vulnerabilities. Based on this methodology, we create an automatic CSTI detection tool, CSTI-Alert. By running CSTI-Alert on the Tranco top 1 million domains, we identify 532 CSTI-vulnerable domains, with 72% directly leading to XSS through GET parameters or CSRF. Finally, we discuss potential approaches to defend against CSTI based on the result of semi-automatic exploitability analysis.
2025
Inglese
28th International Symposium on Research in Attacks, Intrusions and Defenses (RAID)
979-8-3315-6603-6
363
377
15
28th International Symposium on Research in Attacks, Intrusions and Defenses (RAID)
Esperti anonimi
2025
Gold Coast, Australia
scientifica
Systematics; Codes; Cross-site scripting; Production; Rendering (computer graphics); Feature extraction; Software; Libraries ;Security; Engines
4 Contributo in Atti di Convegno (Proceeding)::4.1 Contributo in Atti di convegno
Pisu, Lorenzo; Balzarotti, Davide; Maiorca, Davide; Giacinto, Giorgio
273
4
4.1 Contributo in Atti di convegno
open
info:eu-repo/semantics/conferencePaper
Files in This Item:
File Size Format  
csti_paper_with_cover.pdf

open access

Type: Author’s Accepted Manuscript AAM, Post-print, (version accepted by the publisher)
Size 707.22 kB
Format Adobe PDF
707.22 kB Adobe PDF View/Open

Items in DSpace are protected by copyright, with all rights reserved, unless otherwise indicated.

Questionnaire and social

Share on:
Impostazioni cookie