EUVIMEDEUVIMED entdecken
Open Access · CC BY-NC-SA 4.0

Robust Detection of XSS and SQL Injection in JSON-API Traffic via JSON-Aware Canonicalization and Few-Shot Adversarial Fine-Tuning

ALI TAQI, Hassan Hassan, Ghaidaa Abdulsaheb

Journal of Applied Science and Technology Trends · 28.07.2026 · 7 (1)

DOI: 10.38094/jastt71796 ↗

Kurz gefasst

Fachartikel in der Zeitschrift Journal of Applied Science and Technology Trends, online erschienen am 28.07.2026. Verfasst von ALI TAQI und 2 weiteren Autor:innen. Der Volltext ist frei zugänglich (Open Access, CC BY-NC-SA 4.0).

AbstractBibliografische AngabenZitierenVerwandte Studien

Abstract (Originalsprache)

Deep-learning detectors for web attacks perform strongly on clean data yet remain brittle to semantics-preserving obfuscations, especially in JSON centric API traffic where identical malicious intent can appear under varied encodings, Unicode confusables, whitespace/comment patterns, or JSON carrier forms. We present a deployment-minded pipeline that integrates: (i) JSON-aware canonicalization that standardizes benign representational variance while preserving attack-relevant semantics; (ii) multi-seed training of BiLSTM-Attention and CharCNN detectors; (iii) black-box robustness evaluation using a bounded reinforcement-learning (RL) adversary and per-mutator Attack Evasion Rate (AER); (iv) few-shot adversarial fine-tuning (FSAT) on curated hard cases; and (v) temperature scaling with per-class thresholds, together with cloud-style latency profiling. On a three-class corpus stratified into Train/Validation/Test = 173,872 / 37,258 / 37,259 and augmented with JSON-native payloads, an RL set (6,821 train / 2,882 holdout), and a few-shot set (n = 1,499; 48.3% JSON), the BiLSTM-Attention model with canonicalization achieves clean-test macro-F1 = 0.9879 ± 0.0007, precision = 0.9889 ± 0.0007, recall = 0.9871 ± 0.0007, and accuracy = 0.9875 ± 0.0007 across three seeds. For the selected robust configuration, per-class threshold calibration (0.4 / 0.6 / 0.6) yields validation macro-F1 = 0.9881. Canonicalization reduces AER across common mutator families, with the largest reductions on JSON wrapping and on multi-step chains such as homoglyph ? URL-encode ? whitespace. After FSAT, the calibrated canon_on model attains clean-test precision = 0.9891, recall = 0.9870, macro-F1 = 0.9880, and accuracy = 0.9877, while reaching RL-holdout precision = 1.0000, recall = 1.0000, F1 = 1.0000, and accuracy = 1.0000 against the evaluated bounded black-box RL attacker. Median latency at 8 KB is 79.6 ms (P95 95.8 ms), indicating practical feasibility for API-gateway deployment.

Zitieren

APA

TAQI, A., Hassan, H., & Abdulsaheb, G. (2026). Robust Detection of XSS and SQL Injection in JSON-API Traffic via JSON-Aware Canonicalization and Few-Shot Adversarial Fine-Tuning. Journal of Applied Science and Technology Trends, 7(1). https://doi.org/10.38094/jastt71796

Vancouver

TAQI A, Hassan H, Abdulsaheb G. Robust Detection of XSS and SQL Injection in JSON-API Traffic via JSON-Aware Canonicalization and Few-Shot Adversarial Fine-Tuning. Journal of Applied Science and Technology Trends. 2026;7(1). doi:10.38094/jastt71796

BibTeX
@article{TAQI2026,
  author = {TAQI, ALI and Hassan, Hassan and Abdulsaheb, Ghaidaa},
  title = {Robust Detection of XSS and SQL Injection in JSON-API Traffic via JSON-Aware Canonicalization and Few-Shot Adversarial Fine-Tuning},
  journal = {Journal of Applied Science and Technology Trends},
  year = {2026},
  volume = {7},
  number = {1},
  doi = {10.38094/jastt71796}
}
Kostenlos starten →