Skip to content

feat(rules): security/info-disclosure for stack traces, paths, debug pages and database errors - #2389

Merged
nc9 merged 2 commits into
mainfrom
feat/info-disclosure-2334
Nov 27, 2026
Merged

nc9 merged 2 commits into
mainfrom
feat/info-disclosure-2334

Conversation

@longshore-nc9

@longshore-nc9 longshore-nc9 Bot commented Nov 25, 2026 •

Copy link
Copy Markdown
Contributor

Part of #2334. Error-page coverage moves to #2393.

Adds a shared classifier (packages/rules/src/shared/info-disclosure.ts) and the page rule security/info-disclosure. It reads the visible text of each crawled 2xx page (script, style, template and noscript are skipped) and reports the first match with a snippet capped at 160 characters. The crawler stores no body for a 4xx/5xx response, so error pages never reach the rule yet; giving rules a capped error body is #2393, which is blocked on this PR. The status-aware path logic stays in the shared classifier (scansPathsFor, unit-tested): a bare filesystem path counts only on a 4xx/5xx response, so on today's 2xx-only input bare paths are not reported. It does not read headers, so version numbers stay with security/version-disclosure.

A framework or driver identifier on its own (Illuminate\, Symfony\Component\, ActiveRecord::, ActionController::RoutingError, System.Web.*Exception, mysqli::, mysqli_*(), PG::, ORA-NNNNN:) does not fail a page: it needs a trace or error shape right after it (file and line, #0 , Stack trace:, an at pkg.Class( frame, Rails.root:), or a known error form such as PG::X: ERROR: or Warning: mysqli_x(): . Rails, Symfony and Laravel docs prose and a php.net mysqli page pass. Text in separate block elements (cells, paragraphs, list items) is joined with a line break, so a trace split across <td>s is found.

Rule count reaches 360, so the rounded floor moves to 360+ (constant plus every copy). The private repo's website copy states the same floor and needs the same bump.

Golden pins: healthScore.overall 58 to 59 (500 passes, same shape as token-storage), one new line in canonical-rule-totals.json, finding-messages snapshot updated.

Commands run: scripts/test-suites.ts --run rules (13012 pass, 0 fail), --run rest (3968 pass, 0 fail), canonical golden, golden-finding-messages, registry-wide tests, bun run docs:check, typecheck in packages/rules, oxfmt and oxlint on the changed files, changelog check. ReDoS scaling of the new trace-window patterns checked at 50k and 200k characters (linear).

Not done: the real-page smoke test of about 25 sites (step 9); residual false positives are pages that quote real errors or traces.

Docs: security/info-disclosure page, security hub, counts. Skill: none.

@nc9
nc9 marked this pull request as ready for review November 26, 2026 05:42
@nc9
nc9 self-requested a review as a code owner November 26, 2026 05:42
@longshore-nc9
longshore-nc9 Bot force-pushed the feat/info-disclosure-2334 branch 3 times, most recently from f603749 to dc8aede Compare November 26, 2026 17:25
…g pages and database errors #2334

Signed-off-by: longshore-nc9[bot] <360568931+longshore-nc9[bot]@users.noreply.github.com>
…lits cells, 2xx scope #2334

Signed-off-by: longshore-nc9[bot] <360568931+longshore-nc9[bot]@users.noreply.github.com>
@longshore-nc9
longshore-nc9 Bot force-pushed the feat/info-disclosure-2334 branch from dc8aede to cb12c73 Compare November 27, 2026 18:47
@nc9
nc9 merged commit bb5f235 into main Nov 27, 2026
14 checks passed
@nc9
nc9 deleted the feat/info-disclosure-2334 branch November 27, 2026 19:32
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.

1 participant