Skip to content

fix(rules): one request and one finding per endpoint across unauthenticated-api and auth-endpoint-disclosure (#1886) - #2080

Merged
nc9 merged 4 commits into
mainfrom
boat/probe-dedupe-1886
Nov 16, 2026
Merged

nc9 merged 4 commits into
mainfrom
boat/probe-dedupe-1886

Conversation

@nc9

@nc9 nc9 commented Nov 16, 2026

Copy link
Copy Markdown
Contributor

Closes #1886. Depends on #1885 (this branch carries its two commits; after #1885 merges this PR's diff is the one commit d270dbc). Release blocker.

What changes

  • One request per endpoint per audit. security/unauthenticated-api and security/auth-endpoint-disclosure send the same anonymous GET (no cookie, no Authorization, no query, no redirect). probe-http.ts now has sendAnonymousGet, memoized on the audit's probe budget (a WeakMap, so two audits never share an answer): the first rule spends one quiet probe, the second reads the same answer at no cost. buildApiProbe / buildAuthProbe both return buildAnonymousGet (the auth rule's Accept is now application/json, */*;q=0.1, the unauthenticated-api value).
  • One finding per endpoint. When unauthenticated-api would flag an endpoint that auth-endpoint-disclosure also probes and the answer carries a password, hash, secret or the internal user record, it steps aside (counted as deferredToAuth in its pass details). Otherwise it reports as before. If auth-endpoint-disclosure is disabled (ctx.ruleEnabled), nothing is deferred. The decision is a pure function of the shared answer, so rule order does not matter (tested both orders).
  • Release gate (security/unauthenticated-api and json-sensitive-fields miss an open JSON endpoint called from an inline script #1920 pattern) for auth-endpoint-disclosure. A 429, a bot/WAF challenge or WAF 403, and a 5xx are not checked (probe-incomplete), a 429/challenge stops the run, and no probeable candidate is no-endpoints skipped instead of a pass. A budget refusal no longer ends the loop, so an endpoint another rule already fetched is still read.

Acceptance criteria

  • An endpoint matched by both rules produces exactly one finding: probe-dedupe-1886.test.ts (both orders) and the engine e2e auth-endpoint-dedupe-1886-e2e.test.ts (v1 and v2, real crawl from an inline fetch("/api/me")).
  • The endpoint is requested once per audit: both tests assert one GET /api/me.
  • A fixture serving /api/me that leaks a user record asserts one finding and one request: same tests.
  • Neither rule's other findings change: unauthenticated-api, auth-endpoint-disclosure, json-sensitive-fields, exposed-files, probe-budget suites (82/82), the security/unauthenticated-api and json-sensitive-fields miss an open JSON endpoint called from an inline script #1920 e2e and the canonical golden pass. One expectation changed on purpose: robots-blocked-everything is now no-endpoints skipped, not a pass (release gate).

Gates

rules + audit-engine typecheck clean; tests above; make validate in docs (62/62). Docs: both rule pages; CHANGELOG under Fixed. DCO signed.

Agent skill: no change needed.

nc9 added 4 commits November 17, 2026 07:47
…icated-api and auth-endpoint-disclosure; auth rule never passes on throttle, challenge, 5xx or no candidates (#1886)

Signed-off-by: Nik Cubrilovic <[email protected]>
…rule deferred to it after a 429 or challenge (#1886)

Signed-off-by: Nik Cubrilovic <[email protected]>
…ly for endpoints that rule did not leave unread, in either run order (#1886)

Signed-off-by: Nik Cubrilovic <[email protected]>
@nc9
nc9 force-pushed the boat/probe-dedupe-1886 branch from f1387e5 to 2d5928d Compare November 16, 2026 20:47
@nc9
nc9 merged commit 3ba3201 into main Nov 16, 2026
16 checks passed
@nc9
nc9 deleted the boat/probe-dedupe-1886 branch November 16, 2026 21:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Dedupe: one finding per endpoint across security/unauthenticated-api and security/user-endpoint-overexposure

1 participant