Rust Axum (Rust / Tokio) · CWE-601
Rust Axum: Open Redirect & OAuth Code Leak (Source & Boundary Audit)
Trace entrypoints to sinks and map coverage-ledger units. Prevent login or OAuth returnTo parameters from redirecting users or tokens off-origin. Tailored for Rust Axum: Use typed extractors for session validation and forbid unsafe blocks in request parsers.
Coverage ledger tracking key
surface:rust-axum::boundary:open-redirect-oauth::angle:audit
ZAP 20019 External Redirect probe
Risk boundary
// Unverified Rust Axum path (CWE-601 · Source & Boundary Audit)
// Handler accepts input without validating Extension<AuthUser>.Hardened guard
// Hardened Rust Axum (CWE-601 · Source & Boundary Audit)
// 1. Use typed extractors for session validation and forbid unsafe blocks in request parsers
// 2. Validate redirect targets against strict relative paths or exact allowlisted redirect URIs.Verification steps
- 01Seed coverage-ledger.json for every Rust Axum handler touching Open Redirect & OAuth Code Leak.
- 02Trace request parameters through Extension<AuthUser> validation down to the sink.
- 03Verify with paired positive/negative evidence via zap-automation-auth.