Programming-Language-Aware Models for Effective Web Attack Detection
Web applications remain prime targets for SQL injection, cross-site scripting (XSS), command injection and other sophisticated exploits that are often hidden inside HTTP requests. Conventional signature-based Web Application Firewalls (WAFs) struggle with zero-day variants and obfuscated payloads. We present WABert, a Transformer-based detector that is programming-language-aware: it is first pre-trained on nearly one hundred million source-code files spanning thirty-two languages, and is then fine-tuned on twenty categories of real-world web-attack payloads. Experiments on five public datasets—CSIC-2010, FWAF-2017, HttpParams-2020, CICIDS-2018 and WADE-2022—plus one proprietary carrier-grade dataset demonstrate that WABert achieves up to 98% accuracy and outperforms baselines including standard BERT, CodeBERT, CNNs, SVMs and Random Forests. Ablation reveals that language-aware pre-training contributes $2 \sim 5 \mathrm{pp}$ accuracy over purely text-based models, while hierarchical token masking offers a further 1.7 pp. The model has been deployed in a live electric-utility SOC, maintaining a ${\lt}0.3 \%$ false-positive rate over three months of traffic.
Authors
- Yuan Pan
- Guocong Feng
- Chunmei Zhang (ORCID: https://orcid.org/0000-0002-4124-2386)
- Kaitian Huang
Institutions
- China Southern Power Grid (China) (CN)
Publication Details
- Published
- 2025-06-20
- DOI
- https://doi.org/10.1109/isaeece66033.2025.11160288
- Primary Topic
- Network Security and Intrusion Detection
- Type
- article
- Field-Weighted Citation Impact
- 0.00