Skip to content
Critiq Docs

Search docs

Search documentation pages and rules

security.availability

Avoid blocking I/O and infallible unwraps in async Warp handlers

Warp filters and handlers run on the async runtime; avoid `std::fs`, `thread::sleep`, and `unwrap` on request paths without `spawn_blocking` or proper errors.

#Metadata

Rule ID
rust.security.warp-blocking-or-panic-in-async-handler
Severity
medium
Confidence
0.72
Languages
rust
Presets
security, strict
Stability
experimental
Applies to
block
Tags
rules-catalog, rust, security, warp

#Why it matters

Blocking the runtime reduces availability and unwraps turn parse errors into panics; both are amplified under load and hostile traffic.

#Remediation

Use `tokio::fs`, offload blocking work with `spawn_blocking`, and propagate errors with `Rejection` instead of `unwrap`.

#Repository path

The generated metadata points to critiq-rules/libs/rules/catalog/rules/rust/rust.security.warp-blocking-or-panic-in-async-handler.rule.yaml.