Semi-Autonomous CSRF Vulnerability Assessment & Validation Agent
Endpoint Discovery · Token & Origin Analysis · Browser-Mediated Cross-Origin Validation
CrossForge is a semi-autonomous CSRF (Cross-Site Request Forgery) security assessment agent designed to discover state-changing application endpoints, analyze their anti-CSRF controls, and validate suspected weaknesses using a real browser session.
It executes a seven-stage assessment workflow. The workflow combines endpoint discovery, baseline analysis, CSRF-token and Origin enforcement checks, an isolated attacker-origin simulator, and Playwright-driven validation through an authorized victim session. Findings are classified from observed evidence rather than treating every weak control signal as a confirmed vulnerability.
CrossForge is designed for authorized application-security assessments, controlled staging environments, and security research.
- Seven-Stage Assessment Pipeline — Scope validation → reconnaissance → victim authentication → CSRF detection → cross-origin simulation → browser-mediated validation → evidence correlation and reporting.
- External Endpoint Discovery — Uses
hellhound-spideras the primary discovery front end, with supplementary SPA discovery, JavaScript endpoint mining, and OpenAPI/Swagger parsing. - CSRF Detection Engine — Runs an eight-detector analysis pipeline against endpoint baselines and response behavior.
- Token Analysis — Identifies common and framework-specific CSRF token fields, including word-boundary matching for token names.
- Server-Side Enforcement Checks — Evaluates token rejection, Origin validation, and SameSite-related protection signals.
- Victim Engine — Establishes an authorized test-account session and can provide that session to an isolated Playwright browser context.
- Attacker-Origin Simulation — Generates and serves cross-origin proof-of-concept pages from a separate local attacker-origin server.
- Browser-Mediated Validation — Observes whether a forged cross-origin request reaches the target and whether the application's state changes.
- Human Approval Gate — Requires operator approval before Stage 05/06 active validation by default.
- Evidence-Driven Verdicts — Distinguishes
CONFIRMED,PROTECTED,INCONCLUSIVE, and unvalidatedPOTENTIALresults. - Professional Reporting — Generates a client-facing HTML report, structured JSON handoff, and browser screenshots when available.
- Scope Controls — Enforces configured origin, path, exclusion, and HTTP-method boundaries.
Run the following commands from the CrossForge repository root.
# Create and activate an isolated Python environment
python3 -m venv .venv
source .venv/bin/activate
# Install CrossForge and its runtime dependencies
python -m pip install --upgrade pip
pip install -e .
# Install the Chromium browser used for browser-mediated validation
playwright install chromium
# Verify the installation
crossforge --version
crossforge --helpCrossForge requires Python 3.10 or later. Installing the package also installs the declared hellhound-spider dependency, which provides the spider executable used by Stage 02 reconnaissance.
For development and test dependencies:
pip install -e ".[dev]"If the spider executable is not available after installation, install or repair the dependency directly:
pip install -U hellhound-spider# Discover and assess endpoints on an authorized staging target
crossforge --target https://staging.example.testUse a dedicated, authorized test account. CrossForge can establish an HTTP session and seed its isolated browser context with the resulting session cookies.
crossforge \
--target https://staging.example.test \
--username test-user \
--password "$CROSSFORGE_TEST_PASSWORD"Set the shell variable before running the command, or replace it with a test-account password. Avoid placing real credentials directly in shell history.
crossforge \
--target https://staging.example.test \
--auth-url https://staging.example.test/login \
--username test-user \
--password "$CROSSFORGE_TEST_PASSWORD" \
--login-mode browsercrossforge \
--target https://staging.example.test \
--username test-user \
--password "$CROSSFORGE_TEST_PASSWORD" \
--headedcrossforge \
--target https://staging.example.test \
--no-browser-validationThis skips Playwright-based Stage 05/06 confirmation. Findings that are not browser-validated remain POTENTIAL; they are not promoted to confirmed vulnerabilities.
crossforge \
--target https://staging.example.test \
--username test-user \
--password "$CROSSFORGE_TEST_PASSWORD" \
--max-confirmations 5 \
--request-budget 150 \
--rps 2 \
--output-dir ./reportspip install -U hellhound-spiderCrossForge also exposes --update-spider as a convenience after spider is installed and available on PATH:
crossforge --update-spiderCrossForge executes seven ordered stages. Stages 05 and 06 share one active-validation workflow and one operator-approval gate.
| Stage | Name | What It Does |
|---|---|---|
01 |
Target Initialization & Scope Validation | Normalizes the target, checks the configured authorization boundary, and performs the environment safety check. |
02 |
Reconnaissance & Application Discovery | Runs hellhound-spider, supplements discovery with SPA/JavaScript/OpenAPI analysis, normalizes endpoints, and filters results to scope. |
03 |
Victim Engine — Authentication & Session Establishment | Establishes the test account's HTTP session and, when browser validation is enabled, initializes an isolated Playwright browser context. |
04 |
Endpoint Analysis & CSRF Attack-Surface Mapping | Collects endpoint baselines, analyzes CSRF controls, scores candidates, and checks token, Origin, and SameSite enforcement signals. |
05 |
Attacker Engine — Cross-Origin Attack Simulation | Serves a generated cross-origin proof-of-concept page from the isolated attacker-origin server. |
06 |
Controlled Validation & Impact Assessment | Uses the victim browser to execute the simulation, checks whether the target received the request, and compares application state before and after. |
07 |
Evidence Correlation & Professional Reporting | Correlates findings across endpoints and produces the HTML report and structured JSON handoff. |
| Verdict | Meaning |
|---|---|
| CONFIRMED | A browser-mediated cross-origin request caused an observable application-state change. |
| PROTECTED | The browser's request reached the target, but no unauthorized state change was observed. |
| INCONCLUSIVE | Cross-origin execution or the resulting state could not be established reliably. |
| POTENTIAL | Detection raised a candidate, but browser-mediated validation was unavailable, skipped, declined, or capped by the confirmation budget. |
A POTENTIAL result is an unconfirmed candidate, not proof of exploitability. CrossForge preserves that distinction in its reporting.
| Component | Location | Responsibility |
|---|---|---|
| Central Orchestrator | crossforge/core/orchestrator.py |
Owns the assessment lifecycle and executes the seven stages in order. |
| Scope & Configuration | crossforge/core/config.py, crossforge/config/ |
Loads runtime settings, scope boundaries, and execution policies. |
| HTTP & Budget Management | crossforge/core/http_client.py |
Provides HTTP request handling and adaptive request-budget controls. |
| Victim Engine | crossforge/engines/victim/ |
Manages the authorized test-account session and isolated browser context. |
| Attacker Engine | crossforge/engines/attacker/ |
Hosts the attacker origin and generates cross-origin test scenarios. |
| Analysis Engines | crossforge/engines/analysis/ |
Analyzes CSRF tokens, cookie policy, Origin behavior, confidence, and vulnerability classification. |
| Reconnaissance Modules | crossforge/modules/reconnaissance/ |
Integrates hellhound-spider and supplementary SPA, JavaScript, framework, and OpenAPI discovery. |
| Endpoint Discovery | crossforge/modules/endpoint_discovery/ |
Loads, normalizes, and ranks discovered endpoint candidates. |
| CSRF Detection | crossforge/modules/csrf_detection/ |
Runs the CSRF detection pipeline and supporting cause/bypass analysis. |
| Validation Modules | crossforge/modules/validation/ |
Performs cross-origin validation, token-enforcement checks, workflow analysis, and verdict classification. |
| Reporting Modules | crossforge/modules/reporting/ |
Builds client reports, correlates findings, and serializes handoff data. |
Stage 02 uses the external hellhound-spider package as its primary endpoint-discovery front end. CrossForge then merges supplementary results from its own discovery modules and deduplicates endpoints before applying its scope filter.
| Discovery Source | Purpose |
|---|---|
hellhound-spider adapter |
Primary web-application crawl and endpoint extraction. |
| SPA discovery | Helps identify API-backed applications that expose few or no server-rendered forms. |
| JavaScript miner | Extracts endpoint candidates from JavaScript resources. |
| OpenAPI parser | Discovers endpoints from accessible OpenAPI/Swagger specifications. |
| External endpoint loader | Loads endpoint candidates supplied by an operator. |
| Endpoint normalizer | Normalizes, labels, ranks, and deduplicates endpoint candidates. |
The external spider executable must be installed and available on PATH, unless a different executable is supplied with --spider-binary.
CrossForge evaluates multiple parts of the application's CSRF defense model rather than relying on a single missing-token check.
| Analysis Area | Assessment Focus |
|---|---|
| Baseline Collection | Records normal endpoint responses so later observations can be compared against expected behavior. |
| Token Identification | Detects common and framework-specific anti-CSRF field names and token-like values. |
| Token Enforcement | Checks whether malformed, missing, or otherwise invalid token conditions are rejected. |
| Origin / Referer Validation | Evaluates server response behavior when origin-related protections are absent or altered. |
| Cookie Policy | Examines cookie attributes and SameSite-related protection signals. |
| Response & State Analysis | Uses response classification and semantic state comparison to reduce false conclusions from superficial response changes. |
| Cross-Endpoint Correlation | Identifies shared patterns in findings across multiple application endpoints. |
| Browser-Mediated Confirmation | Uses a real browser context to observe cross-origin request behavior and resulting application state. |
The active validation stage is intentionally separate from passive detection. A weak or missing control signal alone does not produce a CONFIRMED verdict.
CrossForge does not expose GateForge-style exploitation modes. Its principal run-time distinction is whether browser-mediated active validation is performed.
| Behavior | Option | Effect |
|---|---|---|
| Full assessment (default) | — | Runs discovery and detection; attempts browser-mediated validation when a victim session and operator approval are available. |
| Detection-focused | --no-browser-validation |
Skips Playwright-based confirmation; unvalidated candidates remain POTENTIAL. |
| Visible browser | --headed |
Runs the victim browser in headed mode for observation and debugging. |
| Bounded validation | --max-confirmations N |
Caps the number of Stage 04 candidates sent to browser-mediated confirmation. |
By default, crossforge/config/scope.yaml sets require_human_approval: true. Before active Stage 05/06 validation, an interactive run asks the operator to type yes. The --yes / -y option bypasses that prompt and must only be used for a pre-authorized engagement or an explicitly approved non-interactive run.
crossforge --target <target_url> [OPTIONS]| Option | Description |
|---|---|
--target URL |
Target URL or domain. Required for an assessment. |
--spider-binary PATH |
Path to the spider executable. Default: spider on PATH. |
--spider-no-playwright |
Disable hellhound-spider headless-browser SPA scanning. This does not disable CrossForge's own browser validation. |
--spider-max-runtime SECONDS |
Set a wall-clock limit for the external reconnaissance crawl. Default: derived from timeout settings. |
--spider-arg ARG |
Pass an additional argument to spider. Repeatable. |
--update-spider |
Upgrade hellhound-spider and exit. Requires spider to be installed and discoverable. |
| Option | Description |
|---|---|
--username USER |
Username or email for the authorized test account. |
--password PASS |
Password for the authorized test account. |
--auth-url URL |
Login URL used by the browser login path when --login-mode browser is selected. |
--login-mode MODE |
Session setup path: http or browser. Default: http. |
| Option | Description |
|---|---|
--no-browser-validation |
Skip Playwright confirmation; unvalidated candidates remain POTENTIAL. |
--headed |
Show the browser instead of running it headlessly. |
--max-confirmations N |
Maximum number of candidates to submit to browser-mediated confirmation. |
--yes, -y |
Skip the active-validation approval prompt. Use only for pre-authorized or approved non-interactive runs. |
| Option | Description |
|---|---|
--output-dir DIR |
Directory for reports and evidence. Default: current directory. |
--crawl-limit N |
Accepted by the CLI, but the current Stage 02 hellhound-spider adapter does not consume this setting. |
--request-budget N |
Set the request budget. Default: 300. |
--rps N |
Maximum configured request rate. Default: 3.0. |
--verbose, -v |
Enable verbose output. |
--quiet, -q |
Suppress the banner and routine status output. |
--version |
Print the CrossForge version and exit. |
--help, -h |
Show command help and exit. |
The current command parser also accepts --cred-file and --mfa-secret, but the active orchestrator's Stage 03 path does not currently connect those options to the live VictimContext authentication flow. Use --username and --password for the currently wired test-account login path. The --crawl-limit option is likewise accepted but is not passed to the active external crawler adapter. --auth-url is used by browser-mode login; the HTTP login path currently performs its own common-path login discovery. Do not rely on the unwired options as active controls until that integration is completed.
CrossForge writes report artifacts to the directory selected by --output-dir (the current directory by default).
| File / Directory | Format | Description |
|---|---|---|
csrf_findings_<scan_id>.html |
HTML | Client-facing report with executive summary, findings, token-enforcement results, and remediation guidance. |
csrf_findings_<scan_id>.json |
JSON | Structured handoff containing scan metadata, findings, and correlation data. |
screenshots/ |
PNG | Browser screenshots captured during Stage 05/06 validation, when available. |
The scan identifier is generated for each assessment and is included in the report filenames.
Install the development dependencies and browser runtime first:
pip install -e ".[dev]"
playwright install chromiumRun the focused unit tests for the approval gate, token matching, and workflow-token filtering:
pytest -q \
tests/unit/test_human_approval_gate.py \
tests/unit/test_token_analyzer_matching.py \
tests/unit/test_workflow_mapper_token_exclusion.pyRun the complete test suite, including integration tests:
pytest -q
---
## Requirements
```text
Python >= 3.10
requests >= 2.31
beautifulsoup4 >= 4.12
PyYAML >= 6.0
playwright >= 1.40
hellhound-spider >= 14.5
pytest >= 7.4 # development / testingCrossForge must only be used against systems for which you have explicit authorization. Active validation sends real cross-origin requests through an authorized test-account session and may exercise state-changing application behavior.
Before testing:
- Obtain written permission and confirm the approved target scope.
- Use dedicated test accounts and non-production environments whenever possible.
- Review
scope.yaml,settings.yaml, andpolicies.yamlfor the engagement. - Keep the human-approval gate enabled unless an explicitly authorized automation workflow requires otherwise.
- Review findings and evidence manually before reporting a vulnerability.
Unauthorized use may violate computer-misuse, privacy, and data-protection laws applicable to your jurisdiction.
CrossForge is intended solely for authorized security assessments, controlled red-team engagements, and security research.
Developed by Project Hellhound
Part of the Project Hellhound ecosystem.
