Vaibhav More Logo
VAIBHAVMORE
COMPLETED / SECURITY MODEL•
2024

WAF Detection (Transformer-Based)

Deep Learning Web Application Firewall for Attack Payload Detection

Transformer-based machine learning firewall detecting SQLi, XSS, and path traversal attack payloads with ~4.2ms latency and ~95%+ accuracy.

GitHub Repository
Category

AI & Machine Learning, Backend Systems

Timeline

2024 Development

Primary Core

FastAPI • PyTorch

Platforms

Cross-Platform

PROJECT OVERVIEW & STRATEGY

Problem, Solution & Engineering Scope

The Industry Friction

Operational Challenges & Cloud Fragility

Traditional regex-based web application firewalls frequently miss zero-day payload mutations or generate high false positive rates that block legitimate users.

The Architectural Solution

Offline-First Zero Latency Local Engine

Trained a character-level transformer neural network that learns semantic syntax patterns of injection payloads regardless of encoding obfuscations.

Core Project Objectives
  • 1Ultra-low latency inference: ~4.2ms per request suitable for reverse proxy inline checks
  • 2~95%+ detection accuracy across 5 payload classes (SQLi, XSS, Path Traversal, Command Injection, Benign)
  • 3Compact 1.2M parameter Transformer architecture optimized for edge CPU execution
  • 4FastAPI middleware wrapper allowing plug-and-play gateway deployment
Target End-Users
  • Automotive Service Centers & Independent Garages
  • Spare Parts Retailers & Inventory Managers
  • Offline POS Operators needing Zero-Cloud Dependability
Architecture & Modules

Key System Capabilities

Engineered features and deep architectural implementations.

3 Modular Features

Multi-Class Threat Classification

Differentiates between SQL Injection, XSS, Directory Traversal, Command Injection, and Benign traffic.

Low-Latency FastAPI Gateway

Asynchronous endpoint design ensuring inline HTTP request inspection under 5ms.

Obfuscation Resilience

Handles URL encoding, hex escapes, and nested string concatenations without rule breakage.

Topology & Pipeline

System Architecture & Engineering Design

The system receives incoming raw URI query parameters and request bodies, tokenizes character and byte sequences, and executes forward inference on a lightweight PyTorch transformer classifier to emit malicious probability scores.

High-Level Distributed System
Interactive Architecture Map
Frontend / UI

Presentation Layer

User interface, client-side state handling, input sanitization, and responsive views.

Main / API

Application Core

Core domain logic, transaction coordinator, validation pipeline, and IPC/API endpoints.

Database

Persistence Layer

Normalized persistence layer with indexing, foreign key constraints, and transactional ACID safety.

Integrations

External Services

Third-party APIs, asynchronous cloud synchronization, document generators, and external webhooks.

Frontend Layer

User interface, client-side state handling, input sanitization, and responsive views.

Backend / Logic

Core domain logic, transaction coordinator, validation pipeline, and IPC/API endpoints.

Database Layer

Normalized persistence layer with indexing, foreign key constraints, and transactional ACID safety.

Integration Layer

Third-party APIs, asynchronous cloud synchronization, document generators, and external webhooks.

Under The Hood

Technology Stack & Core Tooling

Selected languages, frameworks, runtime environments, and engines.

7 Technologies Identified
FastAPI logo
Backend

FastAPI

Modern, high-performance Python ASGI web framework with automatic OpenAPI documentation and Pydantic validation.

Integratedfastapi
PY
Tools

PyTorch

Engineered architecture using PyTorch

Integratedpytorch
TR
Tools

Transformers

Engineered architecture using Transformers

Integratedtransformers
Python logo
Backend

Python

Dynamic programming language utilized for data modeling, statistical ARIMA forecasting, and machine learning pipelines.

Integratedpython
TO
Tools

Tokenizers

Engineered architecture using Tokenizers

Integratedtokenizers
Docker logo
DevOps

Docker

OS-level containerization ensuring parity across local desktop development and production cloud deployment.

Integrateddocker
NU
Tools

NumPy

Engineered architecture using NumPy

Integratednumpy
Problem Solving

Engineering Challenges & Technical Solutions

Complex bottlenecks, concurrency hurdles, and architectural decisions resolved during development.

1 Critical Engineering Trade-offs
Technical Resolution

Pruned model layers to a compact 1.2M parameter architecture and quantized weights for rapid CPU inference.

Authorship & Ownership

Individual Contributions & Architectural Ownership

Core development, system architecture, database schema, and delivery milestones.

Prepared and sanitized synthetic and public attack payload datasets

Designed and trained the PyTorch transformer classification architecture

Built the production-ready FastAPI inferencing server with Docker containerization

Results & Metrics

Project Outcomes & Benchmarks

Created an intelligent, proactive firewall layer capable of blocking obfuscated injection payloads at web-scale speeds.

Next Case Studies

Explore Other Architectures

All Projects & Case Studies →
Automation & Utilities

AutoBillDrive

Offline-first desktop billing application for Windows with SQLite persistence, automated PDF generation, Google Drive sync, and WhatsApp delivery.

Explore Architecture
Full-Stack Web

EventApp

Production-ready event registration platform with Spring Boot 3.2, React 18, JWT RBAC, QR-code ticket generation, and async email confirmations.

Explore Architecture