Treat every authentication shortcut, authorization shortcut, redirect, token
source, cookie, forwarded header, parser, cache, and cryptographic decision as a
security boundary until proven otherwise.
Skepticism is a verification mode, not a reason to dismiss a report. Translate
claims into falsifiable checks, then test or inspect the exact runtime behavior.
Core authorization question — answer it for every protected path:
What object is being authorized?
What object is later served, proxied, redirected to, or trusted?
Are those objects represented by the same normalized value?
Which checks execute before token validation, ACL evaluation, or signature
verification?
For external vulnerability reports, extract before judging:
Entry point and exact package/function names
Required configuration and deployment assumptions
Claimed payloads and their expected parsed forms
The check that should have run but did not
Downstream sink or side effect
Severity claim and whether it depends on a separate component
If a report is plausible but deployment-dependent, classify it that way and
still consider a library hardening fix when the package makes an unsafe
normalization, trust, or ordering assumption.
2. Map the Decision Path
Follow the call chain from input → decision → sink. Do not stop at a grep hit.
Identity store lookup, password/API-key verification, MFA checks, lockout
OAuth/SAML callback processing and external metadata/token/userinfo fetches
3. Run Targeted Search Passes
Use rg as the starting point. Inspect surrounding code and tests — do not
treat a grep hit as a confirmed finding.
Resolve dependency source paths with go env GOMODCACHE and go env GOROOT,
then inspect the exact package directory. Do not search a home directory or
sibling checkouts to locate cached tooling or dependencies.
Document any tool that requires network access, an updated vulnerability
database, or loopback listeners; record that condition in validation notes.
Treat govulncheck findings in the Go standard library as release/toolchain
notes unless this repository is the final binary being shipped. For this
library, do not report stdlib CVEs as library-code findings or recommend
raising the go directive solely to clear them. Document the scanning
toolchain, the downstream/final binary build toolchain, and whether consumers
need a patched Go release on their supported Go line.
Record the scanner version, source/binary mode, build metadata, stripping flags,
and output precision. Govulncheck JSON is a stream of JSON values, not necessarily
one compact object per line; decode the stream and distinguish OSV records from
actual findings. JSON-mode exit zero alone does not mean no findings. Separate
module matches, imported affected packages, and reported call/symbol evidence.
For stripped binaries, the scanner may fall back to module-level precision and
emit wildcard package/symbol entries from an advisory. Those placeholders do not
prove that the affected package or function is linked. Preserve the exact
shipping-artifact assessment and supplement it with source analysis and a
matching build retaining symbols when needed; do not remove findings or change
release stripping solely to produce a green scan. Govulncheck v1.8.0 documents
this fallback in its
official binary analyzer.
A retained module can still match an advisory for a package no longer imported.
State that boundary instead of claiming the module itself is advisory-free.
Use identity-public-keys to review user-owned
GPG/SSH import, authenticated profile input, and OpenPGP compatibility. Trace actual
operations before equating dependency maintenance debt with an exploit.
For the selected boundary, read boundary checklists:
path interpretation, redirects and host metadata, credential propagation,
parsers and resource limits, provider/key trust, or concurrency. These checklists
link the narrower contract references; unrelated surfaces may remain out of scope.
4. Validate Findings
For each suspected issue, reach one of these outcomes before reporting:
Outcome
Meaning
Confirmed
Reproduction or regression test exists
Deployment-dependent
Plausible; preconditions documented
Hardening
No direct exploit path; concrete risk reduction identified
Release/toolchain note
Standard-library or final-binary exposure driven by build toolchain
False positive
Source-backed reasoning provided
Unknown
Exact missing evidence listed
When govulncheck reports reachable standard-library vulnerabilities, classify
them as release/toolchain notes for go-authcrunch unless the finding is
caused by repository code that can be fixed independently of the final build
toolchain. Avoid treating the local scan's Go version as this module's minimum
supported Go version.
When source-address authorization uses forwarded client-IP headers, classify
header protection as an embedding-solution responsibility for library consumers.
For the in-repository authdb listener, verify its own stripping of forwarded
headers before making that classification. Treat the expected upstream protection as a
deployment assumption unless the reviewed code bypasses its own authorization
checks independently of X-Forwarded-* or X-Real-IP trust.
For every confirmed or deployment-dependent finding:
Add a focused regression test before or with the fix
Cover both a safe input that must still pass and an adversarial input that
must fail closed
For path and redirect issues, test encoded forms and absolute / scheme-relative
variants explicitly
A normalization fix with no accompanying test is incomplete.
5. Report Clearly
Lead with findings, not an audit narrative. For each issue:
## [SEVERITY] Title
**Status:** confirmed | deployment-dependent | hardening | release/toolchain note | false positive | unknown
**Files:** pkg/foo/bar.go:L42, pkg/foo/baz.go:L17
**Root cause:** <one sentence>
**Impact:** <what an attacker gains>
**Preconditions:** <config, role, or network position required>
**Reproduction:** <minimal payload or test case>
**Recommended fix:** <specific change, not "add validation">
**Validation performed:** <test run, manual trace, or static analysis result>
**Residual risk / follow-up:** <what remains unverified>
For release/toolchain notes, include the local scan toolchain, the module's
declared go version, known downstream build constraints, and the patched Go
toolchain line needed by final binary builders.
Save the full report to a repo-relative tmp/threat-hunt/ directory. Create
the directory when it does not exist. Prefix the report filename with the local
timestamp in YYYYMMDD_HHMM_ format, for example
tmp/threat-hunt/20260629_1530_authz-bypass-review.md. After saving the
report, run go tool versioned -toc -filepath <report-path> to add or refresh the
table of contents, for example
go tool versioned -toc -filepath tmp/threat-hunt/20260629_1530_authz-bypass-review.md.
Mention the saved report path in the final response.
End each report with a "Not deeply tested" section naming surfaces that were
not fully exercised, especially:
Path canonicalization edge cases
Redirect validation against all allowlist bypass variants
Maintain the standalone cmd/authdb server, pkg/httpserver listener and portal routing, HTTP configuration parser, TLS, shutdown, executable tests, and deployment guidance. Use authdbctl for the management client.
Maintain or embed pkg/authclient for portal login, password/TOTP and API-key authentication, native credential transport, configuration parsing, and credential files. Covers authdbctl login wiring; management commands and the admin API have separate owners.
Maintain optional cross-device portal login, its directive parser, QR and polling UI, approving-browser binding, single-use transfers, MFA and provider evidence, logout invalidation, and TLS/browser tests.