Repository navigation
feat(rules): flag auth and session endpoints that leak password hashes or the user record (repo#1968) - #1885
Conversation
d6495b3 to
fd62d09
Compare
|
Review requirement (added 2026-11-15 after a false all-clear found in true-positive testing): when this rule finds zero candidate endpoints, it must report not_checked with a reason, for example "no endpoints found in page code", never passed. Add a test: a site with no candidate call sites gives not_checked, not passed. Also include one end-to-end engine test (crawl a fixture, then endpoint surface, then this rule), not only a hand-built candidate list. |
|
Review requirement (2026-11-15, from #1920): a probe answered with 429, a 401/403 bot challenge, an HTML challenge page (cf-mitigated, Cloudflare or WAF challenge markers), 5xx or a timeout must make the target UNVERIFIED. The rule then reports not checked or incomplete, never passed. Only a genuine 404, or a non-challenge answer, counts as not exposed. Please add a stub test for a 429 and for a 403 HTML challenge. |
b613320 to
132286f
Compare
…s or the user record (repo#1968) New site-scoped probing rule security/auth-endpoint-disclosure. With probing active or aggressive it sends one GET, with no cookies, no Authorization header, no body and no redirect following, to each same-origin current-user or session endpoint: the ones the discovery pass found plus /api/me, /api/session, /api/auth/session and /api/user, at most six. Credentials are never submitted. A 2xx JSON answer that carries a password, a password hash (bcrypt, argon2, scrypt, sha-crypt, md5-crypt, Django, Werkzeug, by format under any key), a credential secret (reset, confirmation, remember and refresh tokens, OTP and MFA secrets, recovery codes) or two or more internal user-table columns fails at error severity, one check per endpoint, naming the JSON path of each field and never its value. The origin is re-checked rather than trusting probeEligible. State-changing and credential-flow paths (login, signup, password, token, callback, authorize) and call sites declaring a method other than GET or HEAD are never probed. robots.txt is respected below aggressive. A passive run, and so a cloud audit of an unverified website or a run with discovery probes off, sends nothing and records one skipped check. A budget-cut or all-error run is skipped, never a pass. Docs page, security index, docs.json, probing config table, README and docs/index.mdx category tables (Security 25 -> 26), the rule count comment, the canonical golden pins (330 rules, one passive skipped row) and the finding-message snapshot are updated. Signed-off-by: Nik Cubrilovic <[email protected]>
…ing paths (repo#1968) Signed-off-by: Nik Cubrilovic <[email protected]>
132286f to
c79b8dc
Compare
…#1885 Every fix-once unit (component groups, rollups, site-resource units) now carries pageShare { share, label, crawledPages }, set at grouping time from the report's totalPages. The JSON report serializes it (schema 1.31) and the text, markdown, LLM and HTML renderers print the label from the unit rather than recomputing it. Bumps REPORT_HTML_VERSION for the changed card text. Signed-off-by: longshore-nc9[bot] <360568931+longshore-nc9[bot]@users.noreply.github.com>
Summary
New site-scoped probing rule
security/auth-endpoint-disclosurefor squirrelscan/repo#1968 (part of the API and data exposure epic, repo#1952). Implements repo#1968 (private tracker; no auto-close across repos).What is probed: same-origin current-user and session endpoints. These are the ones the endpoint discovery pass found (last segment
me,session,user,whoami,userinfo,current-user,self,profile,account, under an API or auth segment unless a call site named it) plus/api/me,/api/session,/api/auth/sessionand/api/user. At most six.What is sent: one
GETper endpoint, with no query string, no body, no cookies (credentials: "omit"), noAuthorizationheader and no redirect following. At most 256 KB of the decoded body is read (sharedreadCappedinprobe-http.ts). Credentials are never submitted.Never probed: other origins (the origin is re-checked;
probeEligibleandsameOriginare not trusted), state-changing paths (graphql-probe's list), credential-flow paths (login, signup, register, password, token, verify, callback, authorize, ...), call sites that declare any method other than GET or HEAD, and robots-disallowed paths belowaggressive.Flagged (fail,
errorseverity, weight 8): a 2xx JSON answer that contains any of:There is one check per endpoint. Items name the JSON path and kind, never the value.
Gating (repo#1931): the rule runs only through
ctx.probe, quiet tier, soactiveor above. A passive run, a cloud audit of an unverified website, and--disable-discovery-probesall resolve to passive: nothing is sent and one skipped check is recorded. A run cut short by the budget, or one where every probe errored, is reported as skipped, never as a pass.Checks declared (feat(rules): a rule's passing and failing checks are linked, so a consumer can tell when a reported finding has been fixed #1741):
auth-endpoint-disclosure(problem);auth-endpoint-clean(clean, clears the problem check);auth-endpoint-not-checked(skipped).Rebased onto
security/unauthenticated-api(repo#1955). That rule already skipssessionandauthpaths, but a discovered/api/meor/api/usercan be probed by both rules, and each reports from its own angle.Acceptance criteria
/api/me,/api/session, etc.) for over-disclosure. Evidence:auth-endpoint-disclosure.test.ts:meta.severity: "error", statusfail. Tested by "a serialized Devise row is a fail..." (asserts severity, the kindspassword-hash,secretandinternal-record, and that no value leaks into the checks), and by "normal session answers pass" for the false-positive shapes.method: "GET", a null body, an empty query,credentials: "omit",redirect: "manual", and no cookie or authorization header. POST/PUT call sites and credential paths are not probed (selection test).Mutation check: flipping
credentialstoinclude, dropping the credential-path filter, the 2xx check, the method filter or the origin re-check, or lowering the internal-row threshold, each fails at least one test.Docs
docs/rules/security/auth-endpoint-disclosure.mdx, added todocs/docs.json.glossary.ts --write,rule-checks.ts --write).docs/configuration/security.mdx"Rules that probe" table.docs/index.mdx,docs/rules/index.mdxanddocs/rules/security/index.mdx; constants comment at 330 rules.### Added.ENDPOINT-DISCOVERY.mdlists the new consumer.Gates
bun test packages/rules/tests/auth-endpoint-disclosure.test.ts: 16 pass.unauthenticated-api,rule-check-declarations,graphql-probeandgraphql-introspection: 81 pass.docs-index-rule-counts,docs-rule-pages,docs-category-table,max-rules-limitandmeta-string-limits: 386 pass.rule-verdict-scope,template-verdict-inputs,template-verdict-page-independence,meta-string-limitsandmax-rules-limit: 793 pass (run before the rebase).streaming-rules-canonical-golden.test.ts: 1 pass. Pins moved to 330 rules and 109737 findings, with one passive skipped row; the score is unmoved.golden-finding-messages-229.test.ts: 3 pass (snapshot regenerated: one skipped line).packages/rulestypecheck (src and tests) andpackages/audit-enginetypecheck: clean.apps/cli:lint,typecheckandformat:checkall clean.docs/:make validateall checks passed, plus 62 script tests.Agent skill
No change needed. The squirrelscan skills do not list rules by name or count, and an agent acts on this finding like any other security fail.
Risk
This is a hold-list change (an active security probe), so it stays a draft for Opus review. On every
activeaudit it adds up to six quiet GETs, mostly 404s on sites without these routes.