Skip to content

fix(security): prevent provider timeout pipe hangs#41

Merged
JSONbored merged 1 commit into
mainfrom
codex/fix-provider-timeout-inherited-pipes
May 5, 2026
Merged

fix(security): prevent provider timeout pipe hangs#41
JSONbored merged 1 commit into
mainfrom
codex/fix-provider-timeout-inherited-pipes

Conversation

@JSONbored
Copy link
Copy Markdown
Owner

Summary

  • prevent selected provider timeout handling from blocking on inherited stdout/stderr pipes
  • keep concurrent provider output draining and fail-closed cap behavior
  • add a Unix regression test for a provider descendant that holds output pipes open

What changed

  • provider stream readers now report through channels instead of unbounded join handles
  • timeout handling kills and waits for the direct provider process, then returns the timeout error immediately
  • normal process exits collect stdout/stderr with a bounded grace period and fail closed if pipes remain open

Why

  • a compromised or PATH-shadowed selected provider could spawn a descendant that inherits stdout/stderr and defeat NIGHTWARD_PROVIDER_TIMEOUT_MS

Validation

  • cargo test -p nightward-core provider_timeout
  • cargo test -p nightward-core provider_large_stdout_is_drained_until_cap_error
  • cargo test -p nightward-core
  • cargo test -p nightward-cli
  • make test-security
  • make verify
  • trunk check --show-existing --fix --all
  • trunk check --show-existing --all
  • Codex Security diff scan: no new reportable findings
  • real CLI reproduction with PATH-shadowed gitleaks returned under the configured provider timeout

Notes

  • patch release v0.1.8 should be tagged after merge because v0.1.7 contains this provider timeout regression

Signed-off-by: JSONbored <49853598+JSONbored@users.noreply.github.com>
@JSONbored JSONbored force-pushed the codex/fix-provider-timeout-inherited-pipes branch from 0fcc4e1 to c23657d Compare May 5, 2026 21:36
@JSONbored JSONbored enabled auto-merge May 5, 2026 21:40
@JSONbored JSONbored merged commit 69f82cc into main May 5, 2026
15 checks passed
@JSONbored JSONbored deleted the codex/fix-provider-timeout-inherited-pipes branch May 5, 2026 21:41
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