Contributing and architecture¶
The short version is in CONTRIBUTING.md; this page adds the architecture and the rules a change has to follow. Security issues in fuzzowl itself go through private vulnerability reporting, not public issues (SECURITY.md).
Development setup¶
git clone https://github.com/dragonday3/fuzzowl.git
cd fuzzowl
python -m venv .venv
source .venv/bin/activate # Windows: .venv\Scripts\activate
pip install -e ".[dev]"
pytest tests/ -q # unit tests + end-to-end scans against a mocked API (tests/e2e)
ruff check . # lint
mypy src # type-check
pytest --cov=fuzzowl --cov-report=term-missing tests/
pytest tests/checks/test_injection.py -v
CI runs ruff, mypy and the tests on Python 3.10, 3.11 and 3.12 on every push and pull request.
Documentation¶
The site is built with MkDocs Material from docs-site/ (mkdocs.yml at the repository root):
pip install -e ".[docs]"
mkdocs serve # http://127.0.0.1:8000
mkdocs build --strict # what CI runs: any warning fails
The CLI reference is generated from the Typer app. After changing an option or its help text, regenerate it and commit the result; the docs workflow regenerates it and fails if the committed file differs:
python -m typer fuzzowl.cli utils docs --name fuzzowl --output docs-site/reference/cli.md
The changelog page includes CHANGELOG.md directly, so edit only that file.
Architecture¶
src/fuzzowl/
cli.py Typer CLI: options, --fail-on, ignore file, exit codes, console output
scanner.py Scanner.run: parse, scope, generate, the five executor passes, analyze, scrub credentials
parsers/ OpenAPI 3 / Swagger 2, HAR, Postman v2 -> list[Endpoint]
payloads/ example request bodies from JSON schemas
checks/ one module per check: generate(endpoint, auth) -> list[TestCase]
executor.py TestCase / TestResult, httpx client, scope lock, rate limiter, budget, retries
analyzer.py every detection rule, baselines, follow-ups, resource linking, dedup
jwt_forge.py stdlib-only JWT forging and offline HS256 cracking (+ jwt_secrets.txt)
redact.py masking of credentials in reports
ignore.py .fuzzowl-ignore.yaml
reporters/ json, sarif, html (template in templates/)
models/ Endpoint, Parameter, AuthConfig, Finding
The pipeline is described in How it works. The rules that keep it correct:
- Checks only generate requests; they never decide findings. Detection lives entirely in
analyzer.py, dispatched onTestCase.check_id. A check passes context to the analyzer inTestCase.extra(strategy,payload,injection_type,pair_id/polarity, ...); the two sides are coupled by those keys. - Checks send
endpoint.body_example, neverbody_schema. Build URLs withself._build_url(): it fills every path parameter (override, then example, then"1") and percent-encodes values, so a payload containing/stays in one segment. - Auth modes.
TestCase.auth_modeisdefault(the executor adds the configured credentials),none(strips them, including a custom API-key header) oroverride(sendstc.headersuntouched). Probes that set their own credentials (auth, BOLA, BFLA) must usenoneoroverride; v0.1.0's false positives came from the configured token overwriting them. Useexecutor.auth_headers()to build a second user's header in the same scheme. - Compare with the baseline.
Analyzer._baseline(result)/_baseline_body(result)return the endpoint's normal response; content the endpoint always returns is never a finding. - Decide the confidence. Every new detector emits
firm(confirmed by a comparison) ortentative. - Use the redaction helpers. Findings use
_request_text(result)and_response_text(result), never the raw label or body, so credentials are masked and truncation is stated. - Extra executors share the scan's options. Create them with
Executor(auth, n, **self._executor_opts)so the scope lock, request budget, TLS, proxy and retries apply.
Adding a check¶
A new check touches these places:
src/fuzzowl/checks/<your_check>.py: subclassBaseCheck, setcheck_idandname, implementgenerate(endpoint, auth) -> list[TestCase](orgenerate_global(endpoints, auth)for probes sent once per scan, likeinventory).- Register it in
_ALL_CHECKSinsrc/fuzzowl/scanner.py. If its detector compares with the baseline, add the check id to_BASELINE_CHECKS. - Add a
_check_<id>handler toAnalyzer._dispatch(or an aggregate pass for pairs and groups), with an OWASP API Top 10 (2023) category and a stablerule_id.rule_idis what SARIF and the ignore file key on. - Add the rule prefix to
RULE_CHECKinbenchmarks/run.py, so benchmark scoring knows which check it belongs to. - Tests: generation in
tests/checks/test_<your_check>.py, detection intests/test_analyzer.py, and an end-to-end case intests/e2e/against the mock API (one secure response with no finding, one vulnerable response with the finding). Themock_apifixture intests/e2e/conftest.pyserves a configurable petstore-shaped API. - Documentation: a page in
docs-site/checks/(what it sends, how it decides, false-positive guards, remediation, limitations), a row in the checks overview and the README checks table.
Every bug fix needs a regression test that fails before the fix and passes after it.
Benchmark honesty¶
Numbers in the README and on this site come only from benchmarks/run.py output committed under
benchmarks/results/. Any rule change motivated by benchmark output must be disclosed in benchmarks/README.md
under "Rules changed after seeing benchmark output"; never tune to a benchmark target silently. The held-out crAPI
number stays published next to any after-tuning number (Benchmarks).
Releases¶
The version lives only in src/fuzzowl/__init__.py. Pushing a tag vX.Y.Z runs the release workflow, which is
publishes to PyPI as fuzzowl, pushes an image to GHCR and creates a GitHub release from the changelog
section. First release: v0.2.0. Details:
DEPLOY.md.