Repository navigation
fix(rules): one finding per leaked field across json-sensitive-fields and auth-endpoint-disclosure, deduped by the runner #2083 - #2154
Merged
Conversation
nc9
marked this pull request as ready for review
November 20, 2026 20:43
… and auth-endpoint-disclosure, deduped by the runner #2083 json-sensitive-fields reports every field on its own and reads an endpoint auth-endpoint-disclosure also probes from the shared anonymous GET (one request per audit). The runner's cross-rule dedupe gains a second pair in CROSS_RULE_PAIRS (endpoint-dedupe.ts): a field the auth rule reported on the same endpoint (anonymousGetUrl key) leaves json-sensitive-fields' check, which is rebuilt from the fields left. runner.ts applies every pair generically. Signed-off-by: Nik Cubrilovic <[email protected]>
nc9
force-pushed
the
boat/dedupe-sensitive-fields-2083
branch
from
November 20, 2026 21:34
658eea6 to
2bdc3dd
Compare
…n-sensitive-fields keeps its finding #2083 Signed-off-by: Nik Cubrilovic <[email protected]>
nc9
added a commit
that referenced
this pull request
Nov 21, 2026
* origin/main: test(audit-engine): carriedCheckAsFailure keeps the continuation mark #2098 (#2166) fix(rules): correct zoom-disabled 1.4.4 wording, related criteria for wcagNone rules #2115 (#2174) refactor(cli): list bash completion flags one per line #2116 (#2175) feat(rules): waive a public Supabase table by bare name in security/supabase-rls #2103 (#2177) test(rules): every site rule emits a check on a clean site, with a shrinking baseline #1741 (#2179) feat(rules): report each 5xx page as its own crawl/server-errors finding #2130 (#2181) fix(rules): one finding per leaked field across json-sensitive-fields and auth-endpoint-disclosure, deduped by the runner #2083 (#2154) fix(cli): report --input keeps meta.partialAudit and publishes with it #2102 (#2153) fix(cli): local incremental re-audit counts carried findings in the full audit's check units (#2159) fix(crawler): cap stored entity refs and edges, skip corrupt refs rows #2135 (#2158) fix(crawler): a quick crawl fetches the start URL when a sitemap lists it past maxPages #2127 (#2157) fix(rules): security/exposed-actuator reads a 5xx through isUnverifiedReply, never part of a pass #2101 (#2151) fix(rules): hold large text to 3:1 in a11y/color-contrast #2105 (#2155) fix(cli): size the report list date column from rendered dates #2095 (#2152) Signed-off-by: Nik Cubrilovic <[email protected]>
nc9
added a commit
that referenced
this pull request
Nov 21, 2026
* origin/main: test(audit-engine): carriedCheckAsFailure keeps the continuation mark #2098 (#2166) fix(rules): correct zoom-disabled 1.4.4 wording, related criteria for wcagNone rules #2115 (#2174) refactor(cli): list bash completion flags one per line #2116 (#2175) feat(rules): waive a public Supabase table by bare name in security/supabase-rls #2103 (#2177) test(rules): every site rule emits a check on a clean site, with a shrinking baseline #1741 (#2179) feat(rules): report each 5xx page as its own crawl/server-errors finding #2130 (#2181) fix(rules): one finding per leaked field across json-sensitive-fields and auth-endpoint-disclosure, deduped by the runner #2083 (#2154) fix(cli): report --input keeps meta.partialAudit and publishes with it #2102 (#2153) fix(cli): local incremental re-audit counts carried findings in the full audit's check units (#2159) fix(crawler): cap stored entity refs and edges, skip corrupt refs rows #2135 (#2158) fix(crawler): a quick crawl fetches the start URL when a sitemap lists it past maxPages #2127 (#2157) fix(rules): security/exposed-actuator reads a 5xx through isUnverifiedReply, never part of a pass #2101 (#2151) fix(rules): hold large text to 3:1 in a11y/color-contrast #2105 (#2155) fix(cli): size the report list date column from rendered dates #2095 (#2152) Signed-off-by: Nik Cubrilovic <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #2083
The approach moved to the runner dedupe (#2164, #2082). The earlier version used a hand-off: json-sensitive-fields skipped the fields auth-endpoint-disclosure reported. That is gone. Now json-sensitive-fields reports every field on its own, and the cross-rule dedupe that runs after the site pass drops the one overlapping finding.
What changed
packages/rules/src/security/endpoint-dedupe.ts: there is now oneCROSS_RULE_PAIRSlist. It holds the existing pair (auth-endpoint-disclosure over unauthenticated-api, matched per endpoint) and the new one (auth-endpoint-disclosure over json-sensitive-fields, matched per field). Both key endpoints withanonymousGetUrl.dedupeCrossRuleFindingsapplies every pair.dedupeEndpointFindingsis kept as a thin wrapper for unauthenticated-api, so the fix(rules): one finding per leaking endpoint, deduped after the site pass (#2082) #2164 and Dedupe: one finding per endpoint across security/unauthenticated-api and security/user-endpoint-overexposure #1886 tests did not need any changes.packages/rules/src/runner.ts: applies whatever the dedupe returns, for any rule. TheUNAUTHENTICATED_API_RULE_IDspecial case is removed and no new one is added.packages/rules/src/security/field-key.ts(new): turns the auth path (users[0].password, masked*) and the json path ($.users[].password, quoted keys) into one key. A path cut at the length cap matches nothing, so its finding is kept.json-sensitive-fields.ts: an endpoint the auth rule also probes (same path, no query string) is read from the shared anonymous GET, so the audit requests it once. An answer over 256 KB is requested again with the rule's 1 MB cap.dropFieldsReportedElsewhereremoves only the overlapping items, then rebuilds the check's kinds, message andfieldscount. If nothing is left the check is removed. A run left with no finding reads clean (reportedBy,reportedElsewhere) unless it was incomplete.json-bulk-piiis never touched.Acceptance criteria
packages/rules/tests/json-auth-dedupe-2083.test.ts: "a plaintext password on /api/account is one finding (auth-endpoint-disclosure) and one request (json rule first / auth rule first)", which runs the realRuleRunner.runSiteRules.accountRequests === 1. So does the e2e testpackages/audit-engine/tests/json-auth-dedupe-2083-e2e.test.ts(real crawler, store, discovery and runner, v1 and v2)./api/accountfixture: one finding and one request, in either rule order. Covered by the tests above, both orders.$.encrypted_password, withfieldsreduced by 1. Also "bulk personal data on the endpoint stands" and "a field on another endpoint, or another field, is untouched"./api/account(Expected length: 1, Received length: 2), both engines. With the json pair removed fromCROSS_RULE_PAIRS, 10 of the 24 rule tests fail.Gates (at 2bdc3dd)
bun run format:check,bun run lint,bun run typecheck: exit 0bun run scripts/test-suites.ts --check: "test suites cover every test file"bun run scripts/test-suites.ts --run rules: 12542 pass, 24 todo, 0 failbun run scripts/test-suites.ts --run audit-engine: 2368 pass, 3 skip, 0 failbun scripts/changelog.ts checkandscripts/check-changelog-entries.sh: OKdocs/ make validate: exit 0Residual risk
MAX_FIELDS_PER_ENDPOINTitems. A field beyond that cap is not matched, so it stays a duplicate. Nothing is ever orphaned by this.Agent skill: no change needed (rule output shape unchanged except the clean row's
reportedBy/reportedElsewheredetails, as on unauthenticated-api).Hold-list (security rules): planning-gated, stays draft.