Skip to content

v2.21.0

Latest

Choose a tag to compare

@kabiri-labs kabiri-labs released this 12 Oct 07:40
c0858a8

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.json

The 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. Host validation 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 ordinary Host header turned out to be that baseline rather than a technique.
  • Web cache deception needs a page. The bar is a 2xx and nothing else. A front-end answering every URL with the same 403 is 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 Location beside a non-redirect status, and a marker in userinfo are reported as suspected, 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 Host validation, and the duplicate Host pair 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 assessed status 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.py

Five 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.md

Full changelog: v2.13.1...v2.21.0