Search arXiv⌕ Search

arXiv subjects

Vahid Babaey

Publications and source records attributed to Vahid Babaey.

3 recordsLinked to original sources

GenWebSec: Adaptive Web Application Firewall Hardening with Co-Evolving LLM Attack and Defense Agents

Large language models (LLMs) enable attackers to rapidly generate and adapt exploit payloads in response to defensive updates, outpacing manual web application firewall (WAF) rule maintenance. Evaluating automated defenses solely against static attack corpora leaves open whether synthesized rules remain compact and effective when attackers adapt. We present GenWebSec, an execution-grounded framework that pairs LLM attack and defense agents in a closed WAF hardening loop. Generated exploits are validated through live application execution and WAF replay; the defender then synthesizes rules individually or in groups under coverage-checked admission and strict benign false-positive bounds before renewed attack search challenges the updated defense. Across six custom SQL injection (SQLi) and cross-site scripting (XSS) targets protected by ModSecurity WAF with OWASP Core Rule Set (CRS) 4.29.0, 78.0-99.6% of application-valid payloads bypassed CRS, and every confirmed bypass also evaded Coraza and BunkerWeb WAFs under the same ruleset. On matched fixed corpora, grouped synthesis reduced median rule counts from 93.5-297 (per-payload) to 1-3 per page while blocking 99.6-100% of bypasses. Under iterative adaptive hardening, renewed search found post-update bypasses in 19 of 60 runs, yet grouped hardening converged to a median of one rule per run (range 1-4), blocked 2,420 of 2,421 in-loop bypasses, and kept mean added false positives at or below 0.28%. Frozen rules generalized across attack models (blocking 96.3-100% of attacks from a different LLM) and transferred unchanged to unseen applications (bWAPP and OWASP Juice Shop), blocking 89.4-94.9% of SQLi and 97.6-97.7% of XSS bypasses (on bWAPP) with zero added false positives on external benign traffic.

cs.CR↗

Detecting Zero-Day Web Attacks with an Ensemble of LSTM, GRU, and Stacked Autoencoders

The rapid growth in web-based services has significantly increased security risks related to user information, as web-based attacks become increasingly sophisticated and prevalent. Traditional security methods frequently struggle to detect previously unknown (zero-day) web attacks, putting sensitive user data at significant risk. Additionally, reducing human intervention in web security tasks can minimize errors and enhance reliability. This paper introduces an intelligent system designed to detect zero-day web attacks using a novel one-class ensemble method consisting of three distinct autoencoder architectures: LSTM autoencoder, GRU autoencoder, and stacked autoencoder. Our approach employs a novel tokenization strategy to convert normal web requests into structured numeric sequences, enabling the ensemble model to effectively identify anomalous activities by uniquely concatenating and compressing the latent representations from each autoencoder. The proposed method efficiently detects unknown web attacks while effectively addressing common limitations of previous methods, such as high memory consumption and excessive false positive rates. Extensive experimental evaluations demonstrate the superiority of our proposed ensemble, achieving remarkable detection metrics: 97.58% accuracy, 97.52% recall, 99.76% specificity, and 99.99% precision, with an exceptionally low false positive rate of 0.2%. These results underscore our method's significant potential in enhancing real-world web security through accurate and reliable detection of web-based attacks.

cs.CR↗

GenXSS: an AI-Driven Framework for Automated Detection of XSS Attacks in WAFs

The increasing reliance on web services has led to a rise in cybersecurity threats, particularly Cross-Site Scripting (XSS) attacks, which target client-side layers of web applications by injecting malicious scripts. Traditional Web Application Firewalls (WAFs) struggle to detect highly obfuscated and complex attacks, as their rules require manual updates. This paper presents a novel generative AI framework that leverages Large Language Models (LLMs) to enhance XSS mitigation. The framework achieves two primary objectives: (1) generating sophisticated and syntactically validated XSS payloads using in-context learning, and (2) automating defense mechanisms by testing these attacks against a vulnerable application secured by a WAF, classifying bypassing attacks, and generating effective WAF security rules. Experimental results using GPT-4o demonstrate the framework's effectiveness generating 264 XSS payloads, 83% of which were validated, with 80% bypassing ModSecurity WAF equipped with an industry standard security rule set developed by the Open Web Application Security Project (OWASP) to protect against web vulnerabilities. Through rule generation, 86% of previously successful attacks were blocked using only 15 new rules. In comparison, Google Gemini Pro achieved a lower bypass rate of 63%, highlighting performance differences across LLMs.

cs.CR↗