Skip to content

aygp-dr/http-axiom

Repository files navigation

hax — Property-Based HTTP Axiom Tester

images/output/01-pipeline-hero_banner.png

https://img.shields.io/badge/status-experimental-orange.svg https://img.shields.io/badge/go-1.23+-00ADD8.svg?logo=go https://img.shields.io/badge/property--based%20testing-RFC%20grounded-blueviolet.svg https://img.shields.io/badge/license-MIT-blue.svg

Overview

hax generates HTTP request variants, applies structured mutations, and checks RFC-grounded predicates to find compliance violations in web services.

Unlike scanners (nuclei), fuzzers (ffuf), or proxies (burp), hax treats HTTP compliance as a property-testing problem:

model-architecture.svg

Quick Start

# Build
make build

# Quick compliance audit
./hax audit https://example.com

# See what's available
./hax list groups
./hax list mutations

# Full property-based test run
./hax run -t https://example.com

# JSON output for pipelines
./hax --json audit https://example.com

Installation

# From source
git clone https://github.com/aygp-dr/http-axiom.git
cd http-axiom
make install    # installs to ~/.local/bin/hax

# Cross-compile
make build-all  # outputs to dist/

Architecture

Request Generator

Produces HTTP request variants from the cartesian product of axes:

AxisValues
MethodGET, POST, PUT, DELETE, PATCH, HEAD, OPTIONS
PathUser-supplied list
HeadersStandard + custom
Authnone, bearer, basic, cookie
Originomitted, same-site, cross-site
Repeatsingle, N×, concurrent

Mutation Vocabulary

OperatorEffect
method-rotateCycle through HTTP methods
header-omitRemove required headers
header-corruptMalform header values
header-forgeInject forged headers (XFF, X-Real)
origin-cross-siteSet cross-origin Origin header
origin-same-siteSet same-site Origin header
repeat-NReplay request N times
repeat-concurrentReplay request concurrently

Predicate Groups

Five RFC-grounded predicate groups:

GroupPredicates
headersCSP, HSTS, SameSite, CORP
methodsidempotency, safety, retries
cross-originCSRF, CORS, JSONP, redirect
cacheETag, no-store, Vary, 304
stateworkflow skip, TOCTOU, replay

Oracle

Reports pass/fail verdicts. Uses Hegel-based shrinking to find the smallest request that still triggers a failure.

Commands

CommandDescription
generate (gen)Generate HTTP request variants
mutate (mut)Apply mutation operators to requests
checkRun predicate checks against a target
runFull pipeline: generate → mutate → check
list (ls)List predicates, mutations, groups, methods
auditQuick compliance audit of an endpoint
shrinkMinimize a failing test case
doctorRun diagnostic health checks
quickstartOnboarding context for agents
versionPrint version info

Global Flags

FlagDescription
-t, --targetTarget URL
-V, --verboseVerbose output
--jsonJSON output
-v, --versionPrint version
-h, --helpShow help

Project Layout

main.go                      CLI entry point (hand-written arg routing)
go.mod                       Module (zero deps)
Makefile                     Build, test, lint, install
CLAUDE.md                    Agent coding context
AGENTS.md                    Agent development rules
internal/
  generator/generator.go     Request variant generation
  mutation/mutation.go       Mutation operators
  predicate/predicate.go     RFC-grounded predicate checks
  oracle/oracle.go           Verdict + shrinking

Design Decisions

  • Zero dependencies — Go stdlib only. No CLI frameworks.
  • Hand-written flag parsing — follows sb / cprr pattern.
  • Single binary — cross-compiles to linux/darwin (amd64/arm64).
  • JSON output--json flag on all commands for pipeline integration.
  • Property-based — not signature scanning, not random fuzzing.

Test Targets

Two deliberately vulnerable targets for development and demos:

# Built-in lightweight Go server (15 endpoints, all predicate groups)
make haxgoat          # starts on :9999
./hax audit http://localhost:9999
./hax audit http://localhost:9999/secure

# OWASP Juice Shop via Docker (real REST API + OpenAPI spec)
make juice-shop       # starts on :3000
./hax audit http://localhost:3000

# Auto-detect and audit whichever is running
make smoke

See cmd/haxgoat/main.go for the full endpoint manifest, or query /manifest at runtime.

Development

make build       # Build with version info
make test        # Run tests
make test-race   # With race detector
make lint        # Vet + gofmt + golangci-lint
make smoke       # Audit against haxgoat or Juice Shop
make help        # All targets

License

MIT