Wave icon indicating copy to clipboard operation
Wave copied to clipboard

Reject out-of-range timeout values before constructing overflowing deadlines

Open LunaStev opened this issue 3 weeks ago • 0 comments

Problem

Timeout options parse as u64 without a representability bound; Console builds deadlines with unchecked Instant addition and can panic for a syntactically valid integer.

Reproduction and evidence

Audited canonical master 69a67c6e0fb700f37ee6114f5a66d37ee13771a5 (0.0.1-alpha-dev). Matching checkout-built compiler/std were used for compiler probes on Linux amd64 with Rust 1.89.0 and LLVM 21.1.8. Artifact inspection, mocked/projection checks and foreign-target object emission are identified below and are not native execution on those operating systems.

Executed Console::new with a fake Read+Write stream and Duration::from_secs(u64::MAX) under catch_unwind. It panics at Instant addition with overflow when adding duration to instant. The FreeBSD CLI timeout parser accepts this same u64 domain. This is missing input/deadline validation in Wave, not a Rust std vulnerability.

Scope

Validate deadline representability or use checked deadline construction at the shared boundary. Treat excessive timeouts as ordinary input errors.

Starting points: tools/src/freebsd.rs:36, tools/src/freebsd.rs:321.

Completion criteria

  • [ ] Zero, supported boundary and excessive timeout values have defined results.
  • [ ] CLI/library invalid input does not panic.
  • [ ] Keep normal timeout behavior and avoid one issue per timeout flag.

This is a bounded newcomer task with the starting point and focused negative/positive checks above.

LunaStev avatar Nov 12 '26 12:11 LunaStev