Skip to content

fix: bound doctor output and redact secrets in diagnostics - #263

Merged
dDevAhmed merged 1 commit into
DigiNodes:mainfrom
philipeh:security/issue-133-sw-030-add-bounded-doctor-output-regression
Oct 18, 2026
Merged

dDevAhmed merged 1 commit into
DigiNodes:mainfrom
philipeh:security/issue-133-sw-030-add-bounded-doctor-output-regression

Conversation

@philipeh

Copy link
Copy Markdown
Contributor

Overview

This PR hardens the doctor diagnostics pipeline so that oversized or hostile stdout/stderr from external tools cannot flood the terminal or error messages, ordering stays deterministic, and secret-like content is not reflected back to the user. It also adds bounded-output regression coverage via secret fixtures.

Related Issue

Changes

🩺 Bounded Doctor Output

  • [MODIFY] src/diagnostics/run.ts

    • Cap captured stdout/stderr per diagnostic check before it reaches any output path.
    • Preserve deterministic ordering of diagnostic results and their captured output.
  • [MODIFY] src/commands/doctor.ts

    • Emit bounded, ordered diagnostic output so oversized tool output cannot flood the terminal or error messages.
  • [MODIFY] src/commands/test.ts

    • Route diagnostic test output through the same bounded path for consistent behavior.
  • [MODIFY] src/output/redaction.ts

    • Redact secret-like content from captured diagnostic output before it is reflected.
  • [ADD] tests/helpers/secret-fixtures.ts

    • Fixtures for secret-like content and oversized output used by the regression tests.

Verification Results

npm test
✅ repository checks pass
Acceptance Criteria Status
Oversized diagnostic output cannot flood terminal/error messages ✅ Output is bounded in run.ts and surfaced bounded in doctor.ts / test.ts
Ordering remains deterministic ✅ Diagnostic results and captured output keep a stable order
Secret-like content is not reflected ✅ Redaction applied in output/redaction.ts with fixtures in tests/helpers/secret-fixtures.ts
Repository checks pass ✅ npm test passes

Closes #133

@philipeh
philipeh requested a review from dDevAhmed as a code owner October 18, 2026 11:17
@coderabbitai

coderabbitai Bot commented Oct 18, 2026

Copy link
Copy Markdown

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

⚙️ Run configuration
  • Configuration used: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: f8303f6e-5cf1-48f2-8d10-c2dea2dd3040
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@dDevAhmed
dDevAhmed merged commit 92b8f2e into DigiNodes:main Oct 18, 2026
3 of 5 checks passed
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.

SW-030 — Add bounded doctor output regression tests

2 participants