Repository navigation
Releases
v2.21.0
Eight minor releases of work since v2.13.1: 13 pull requests, 43 commits, and one change to what the compliance report is allowed to claim.
⚠️ Upgrading from v2.13.1 or earlier — take your baseline again
2.15.1 re-keyed the identity every finding is matched by. Markers minted before it carried no prefix, so a --baseline file written by an older version no longer matches: a comparison against one reports everything as new and everything in the file as fixed.
python headerhawk.py https://app.example.com -o baseline.jsonThe run detects an older baseline and says so rather than leaving it to be worked out. Nothing else in this range breaks a command line, an output schema a consumer reads by key, or an exit code.
The headline: a control nobody fully looked at no longer reads as a pass
The evidence report answers one question — for each requirement, did this product meet it, and how do you know? — and this range is mostly about making that answer honest.
A fourth status, Partly assessed. Several checks can cover one requirement. Where some judged it and another recorded that it could not look, the control now reports as partly assessed and names the blind check under partly_assessed_because, instead of passing on the strength of the checks that happened to run. The console prints a Could not assess block rather than a bare No vulnerabilities were found.:
Could not assess (1):
- Unkeyed Input: a cache answered a URL this scan had just invented
('X-Cache: HIT'), so the query string is not part of its key: ...
No vulnerabilities were found - but see what could not be assessed above;
this is not a clean bill of health for those requirements.
The four statuses, worst first: Fail, Not assessed, Partly assessed, Pass.
Assessment became per control, not per check. A JSON reply has no document for a framing or CSP requirement to act on, so those controls are reported as not assessed naming the media type returned — while one HTML page in the same scan is enough to have assessed them. An SVG counts as a document; text/plain and XML do not.
Every finding now says how well it is evidenced. confirmed when the scanner reproduced it, suspected when one observation supports it and nothing re-tested it, informational for context never worth failing a build over. It appears on the console, in every report format and beside the severity in the evidence report. informational never gates the exit code.
Detection: fewer things reported that were never there
Each of these removed a class of false positive, and each has a test and a lab scenario.
- A bypass is a refusal that was got past.
Hostvalidation bypass now establishes that a refusal existed before naming one — one well-formed request with the target's own host, one with a host minted for the scan. An ordinaryHostheader turned out to be that baseline rather than a technique. - Web cache deception needs a page. The bar is a
2xxand nothing else. A front-end answering every URL with the same403is ignoring the suffix, but an identical refusal served to everyone is not a victim's page; below the bar the route is reported as not assessed rather than as a pass. - A reflected routing header is not proof on its own. A marker counts when it comes back as the host of a URL the response points a browser at, and does so again on a repeat. A URL printed as text, a
Locationbeside a non-redirect status, and a marker in userinfo are reported assuspected, which is what an echoed header is. - Open redirect needs a host minted for the scan. A fixed hostname cannot tell "the destination follows the header" from "this is where the site always redirects". Every host a redirect accepts is now one finding naming all of them, and only the ones that held on their own second probe.
- Two more wire shapes for
Hostvalidation, and the duplicateHostpair sent both ways round — which of the two wins is a choice each implementation makes for itself.
The unkeyed-input search learns what moves
The search compares a canonical artefact — the body with the page's own noise masked, its status, and the response headers a cache or browser acts on. This range taught it where the noise actually is.
- Masking is learned per place, not per shape: a timestamp in a footer no longer teaches the scanner that every number on the page is noise, and an asset hash a header changes stays a finding.
- A candidate header is offered a value of its real type — a scheme header gets the scheme the target does not already have, a port header a port it is not on, an address header an address from the documentation range. 46 of the 91 fields mean nothing as a hostname, and a hostname is what they all used to be sent.
- A cache hit counter is read from every tier that reports one.
- And it refuses to guess behind a cache that ignores the query string, with a reason naming the cache header that showed it — the gap that produced the
Partly assessedstatus above.
New: an integration lab
lab/ is a Docker lab that answers the question the offline suite cannot. A mock replies with whatever a test told it to, so an assumption about a real server that is wrong is wrong in the test too, and the test passes.
python lab/lab.pyFive containers — the application with a vulnerable route and a secure twin for each weakness, an nginx front-end that refuses an unknown host, Varnish with its shipped cache key, the same Varnish with the header added to the key, and a cache whose key leaves the query string out. Seventeen scenarios, each with what it must report and what it must not, declared in lab/scenarios.json before anything runs. A scenario is exhaustive by default, so an undeclared finding is a false positive rather than noise. Absence is read from the per-control evidence report, not guessed from an empty findings file.
The current run:
| Declared findings produced as declared | 36 |
| Declared absences that held | 39 |
| Declared and not produced | 0 |
| Reported to a user and declared by nothing | 0 |
It found three defects on its first runs — two over-claims and the silent evidence gap above — and the lab was never edited to make the scanner pass. lab/README.md records what it found and how each closed.
Robustness
- One check that fails no longer ends the run. It is recorded as a check that could not assess its controls, the requirements it covers say so with the reason, the remaining checks still run, and both report files are still written.
- Retries no longer inflate the request count, and every retry counter is named.
- The request-file test fixtures are written without newline translation, so the suite passes on Windows and POSIX alike.
Documentation
The README now leads with what the tool detects rather than with the argument for why it exists, carries eight graded worked examples from a first scan to a captured authenticated request driving a whole estate, and compares HeaderHawk against Burp + Param Miner, Nuclei, ZAP and securityheaders.com capability by capability — with the losses in the same table as the wins.
At a glance
- 14 check modules, 36 finding types, 26 catalogued requirements (25 OWASP ASVS 5.0 + PCI DSS 4.0.1 requirement 11.6.1)
- 787 tests, fully offline:
python -m unittest discover -s tests - Python 3.8+, four pinned dependencies, no services and no database
git clone https://github.com/kabiri-labs/HeaderHawk.git
cd HeaderHawk
pip install -r requirements.txt
python headerhawk.py https://example.com --evidence compliance.mdFull changelog: v2.13.1...v2.21.0
HeaderHawk v2.13.1 — Compliance Evidence
The first release since v2.0.0, and the one where HeaderHawk stopped being a
header scanner and became a source of compliance evidence.
| v2.0.0 | v2.13.1 | |
|---|---|---|
| Check modules | 9 | 14 |
| Finding types | 9 | 35 |
| Catalogued requirements | — | 26 |
| Response-side assessment | — | HSTS, CSP, cookies, framing, banners |
| Tests | 137 | 549 |
Compliance evidence
--evidence report.md (or .json) writes a report keyed by requirement
rather than by finding — the question an assessor actually asks. Every control
appears with its framework, the requirement text transcribed from the standard,
a link to the source chapter, and its evidence.
The rule that makes the document worth submitting: a control only passes when
a check that covers it actually completed. Anything the scan could not judge
is reported as not assessed, with the reason, rather than counted as
compliant. A scan of an unreachable host produces no findings — reporting that
as full compliance would be worse than producing no report at all.
Every finding also carries the requirements it is evidence against, in all three
output formats. OWASP ASVS 5.0 (25 requirements) and PCI DSS 4.0.1 11.6.1
are catalogued; ids are transcribed from the published standard, and a finding
type with no genuinely matching requirement is reported as unmapped rather than
attached to an approximate one.
The response side, which did not exist before
- Header posture — HSTS (including
max-ageandincludeSubDomains),
frame protection,X-Content-Type-Options,Referrer-Policy, COOP,
Permissions-Policyand version banners. - CSP read the way a browser reads it —
'unsafe-inline'is not reported
when a nonce or hash is present,'strict-dynamic'suppresses allowlist
findings,object-srcaccepts adefault-srcfallback whilebase-uri
must be explicit, and*.example.comis an allowlist rather than an open door. - Per-cookie assessment —
Secure,SameSite,__Secure-/__Host-
prefixes and the 4096-byte limit, parsed perSet-Cookiefield without
tearing apart the comma inside anExpiresdate.HttpOnlyis reported only
for names that suggest a session value, since analytics cookies legitimately
need script access.
Posture findings are counted as a separate class, and --fail-on decides which
classes gate the exit code — so this can be switched on without turning an
existing pipeline red.
New attack classes
- Unkeyed input discovery — 91 intermediary-set header fields searched by
bisection. Ruling out the whole list costs one request; isolating one header
among ninety costs about a dozen. Every probe carries its own cache-buster,
without which a cache in front of the target answers the entire search with
the first response it stored. - Web cache deception — static-looking suffixes a router ignores but a CDN
keys on, confirmed by re-requesting the same URL with no credentials at all.
A response that already saysno-storeorprivateis not reported. - CORS origin validation — reflection,
nullorigin, prefix/suffix/
trailing-dot/subdomain bypasses and plaintext-origin trust, each confirmed by
the server echoing back a per-scan origin that cannot exist. - CRLF injection / response splitting — percent-encoded, double-encoded and
overlong-UTF-8CR/LF, confirmed by a response header field named after a
unique marker. - HTTP request smuggling — CL.TE and TE.CL by timing, reported only after
two consecutive probes agree and a well-formed request in between still
returns normally. Confirmation is opt-in via--enable-desyncbecause it is
intrusive, and every finding says out loud that timing is evidence rather than
proof.
Scanning what you actually ship
--request FILE— drive the scan from a raw HTTP request saved from a
browser or an intercepting proxy. Cookies, tokens, content type and body stay
intact; each check replaces the header it is testing or adds it when absent,
down to the raw-socket probes. Credentials from the file never reach a report.- Authenticated scanning —
--auth-cookieor a form login, with the session
verified before and after the run. If you said what a logged-in page
contains and it is not there, the scan stops rather than assess the logged-out
pages and present them as the product's. - Endpoint discovery —
--discoverreads the target's own OpenAPI, sitemap,
robots.txt and links. URLs that are the same endpoint collapse, and host-level
checks run once rather than once per route.
Workflow
- Baseline diffing —
--baselinereportsN new, N fixed, N unchanged, and
--fail-on-newnarrows the gate to regressions so the pipeline stops failing
forever. Running it on a schedule is what satisfies PCI DSS 4.0.1 11.6.1. - SARIF 2.1.0 with
security-severityscores and stable fingerprints, so
code-scanning alerts deduplicate instead of reopening. - Exit codes —
0clean,1findings,2the scan could not run. An
unreachable host never exits0. - Rate limiting —
--ratecaps the whole scan, raw client included. - Proxy support end to end, with raw bypass traffic tunnelled via
CONNECT.
Fixes
--insecurewas silently broken when the environment set
REQUESTS_CA_BUNDLEorCURL_CA_BUNDLE— those overridesession.verify, so
scans of self-signed hosts failed every request while reporting the target as
unreachable. Verification is now named explicitly and the CA bundle cannot win.- False positives cut in SSRF and virtual-host discovery: header anomalies
are measured only against headers proven stable across baseline samples, so
request ids, tracing andCF-RAYno longer register as signal, and a vhost
candidate must survive a second probe. - Stated minimum Python was 3.6 but the pinned
requestsandurllib3
require 3.8. Corrected to 3.8+.
Breaking changes
host_header_scanner.pyhas been removed. The compatibility shim kept
from the rename in v2.0.0 is gone; usepython headerhawk.pyand
import headerhawk.- The scanner is now a package rather than a single file.
import headerhawk
andpython headerhawk.py <target>are unchanged, but code reaching into
internals will need the new module paths — see the layout in the README.
Nothing else changes existing behaviour: posture findings do not gate the exit
code unless you ask for them, and --fail-on defaults to vuln.
Upgrading
git pull && pip install -r requirements.txt
python headerhawk.py https://app.example.com/ --discover \
--evidence compliance.md --output findings.sarif --fail-on anyFull changelog: v2.0.0...v2.13.1
HeaderHawk v2.0.0
HeaderHawk is an evidence-driven scanner for HTTP request-header vulnerabilities.
This is the first tagged release. The project was previously named
HostHeaderScanner; it now covers the whole family of routing, identity and
caching headers (not justHost), so it was renamed to HeaderHawk.
The oldpython host_header_scanner.pyentry point still works via a thin
compatibility shim.
Detection coverage
- Host header injection — unique per-request marker reflected in the body,
Location, or any response header, acrossHostand 15+ routing headers. - Host validation bypass — duplicate
Host, absolute-URI request lines and
line-folded headers sent with a purpose-built raw HTTP/1.1 client. - Confirmed web cache poisoning — cache-buster planted through an unkeyed
header, then a clean re-request proves the poisoned response is served. - Access-control bypass — internal
Host/X-Forwarded-For/X-Real-IP/
True-Client-IPvalues plusX-Original-URL/X-Rewrite-URLagainst 401/403. - SSRF via routing headers and blind (out-of-band) SSRF — weighted scoring
plus per-scan correlation ids confirmed by polling your listener. - Open redirect, URL-parameter SSRF, and confirmed virtual-host discovery.
Reporting & CI
- Severity-rated findings (High / Medium / Low).
- Reports in JSON, Markdown or SARIF 2.1.0 (chosen by output extension).
- CI-friendly exit codes:
0clean,1findings,2scan could not run. - Batch scanning with
--list, WAF-friendly--rate, and proxy-aware traffic.
Install
git clone https://github.com/kabiri-labs/HeaderHawk.git
cd HeaderHawk
pip install -r requirements.txt
python headerhawk.py http://example.com