This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
This is a web application designed to evaluate and benchmark the effectiveness of blind XSS (Cross-Site Scripting) polyglot payloads against various real-world scenarios. It serves as both a security testing platform and XSS training environment.
Important Security Note: This application intentionally contains XSS vulnerabilities for testing purposes and should never be exposed publicly without proper security measures.
# Start the full application stack
docker compose up --build
# Add hostname to /etc/hosts (required)
sudo echo 'xsslab_app 127.0.0.1' >> /etc/hostsThe application will be available at http://xsslab_app:9090
# Extract scenarios from master YAML to individual files
bash scripts/extract_scenarios.sh
# Install Python dependencies (if running locally)
pip install -r app/requirements.txt
# Run the Flask app directly (requires PostgreSQL setup)
cd app && python app.py- Flask Application (
app/app.py): Main web server with database connection retry logic - Database Models (
app/models.py): SQLAlchemy models for Scenario, Payload, and Result entities - Scenario Management: YAML-based scenario definitions with database synchronization
- Controllers: Blueprint-based routing for different functionality areas
- Headless Testing: Playwright integration for automated XSS payload testing
- Scenarios: XSS test scenarios with HTML/JS snippets and metadata
- Payloads: User-submitted XSS payloads for testing
- Results: Test outcomes linking payloads to scenarios with success metrics
Scenarios are defined in YAML files (app/scenarios/definitions/) and automatically synchronized to the database on startup. Each scenario contains:
- HTML snippet with
{{ payload }}template placeholder - Optional JavaScript snippet
- Category and position metadata
- Template block identifier
app/controllers/: Flask blueprints for different routesapp/scenarios/definitions/: Individual YAML scenario filesapp/scenarios/TBD/: Master scenarios YAML fileapp/templates/: Jinja2 HTML templatesapp/static/: CSS and JavaScript assetsmigrations/: Database migration scripts
- Navigate to
/scenariospage - Select a scenario to test
- Add
?payload=<your-payload>to the URL - Execute and observe results
Use the headless testing endpoint (/auto_headless) for systematic payload evaluation across multiple scenarios.
- Add scenario definition to
app/scenarios/TBD/scenarios.yaml - Run
bash scripts/extract_scenarios.shto generate individual files - Restart application to sync new scenarios to database
- New scenarios automatically appear in the web interface
- Database: PostgreSQL 15 with persistent volume
- Application: Python 3.12 with Playwright for browser automation
- Networking: Bridge network for container communication
- Environment: Production Flask mode with debug enabled