How rfypych/wvfe works
Project type and purpose
• WVFE is a full-stack, monorepo web application combining a React.js frontend with a Flask/Python backend and a MySQL database.
• Its purpose is to automate discovery and demonstration of common web vulnerabilities (sensitive files, SQLi, XSS) via a user-driven scan dashboard.
File structure
• Top-level “frontend” directory holds a React SPA:
• public/index.html
• src/App.js, pages/{Login,Register,Dashboard,ScanDetail}
• Top-level “backend” directory holds a Flask API:
• app.py (entry point)
• scanners/ (modular vulnerability scanners: crawler, sensitive_file_scanner, sqli_scanner, xss_scanner)
• templates/index.html (optional server-side page)
• .env.example, requirements.txt, tests/
• No separate microservices—everything lives in one Flask process.
• Tests cover each scanner module and auth/scan endpoints.
README for additional insights
• Backend → Flask on port 5001; database auto-created on first run.
• Frontend → React dev server on port 3000.
• MySQL backend managed via environment variables.
• Emphasis on user authentication, web crawling, modular vulnerability detection.
Main components and relationships
a. User Interface (React SPA)
– Components: LoginPage, RegisterPage, DashboardPage, ScanDetailPage
– Connects to Flask API over HTTP(S).
b. API Layer (Flask app.py)
– Endpoints: /auth/register, /auth/login, /scans/start, /scans/{id}/report, etc.
– Orchestrates scan tasks by invoking scanner modules.
c. Scanner Modules (in-memory workers)
– Web Crawler: discovers links/forms on target.
– Sensitive File Scanner: probes for .env, .git/config, etc.
– SQLi & XSS Scanners: test parameters for vulnerabilities.
d. Database (MySQL)
– Tables: users, scans, findings.
– Accessed via an ORM or raw queries inside Flask.
e. External Service
– Target Web Application: arbitrary external site under test.
Architectural patterns and design principles
• Monolithic backend with modular scanner plugins (Plugin Pattern).
• Clear separation of concerns: UI ↔ API ↔ Scanning logic ↔ Persistence.
• Stateless API end points; database-backed state; scanner modules process per request.
• MVC-like division in Flask (views in app.py, scanner “models” in scanners directory).
• Environment configuration by an ancillary note: “Flask reads .env → DB_HOST, SECRET_KEY.”