Problem
Both the Windows walk_regions() (lines 61-127 in src/os/windows.rs) and the general region-walking logic have unbounded loops that can hang indefinitely on processes with unusual or malicious virtual address space layouts.
- A process with millions of VMAs can force mvis to iterate indefinitely.
- No iteration counter or timeout protection.
- Affects both interactive TUI and CLI, causing hangs.
- On Linux, similar issue with /proc//maps parsing with no line limit.
Proposed Solution
- Add configurable iteration limits:
const MAX_REGIONS_PER_PROCESS: usize = 100_000;
let mut region_count = 0;
loop {
region_count += 1;
if region_count > MAX_REGIONS_PER_PROCESS {
return Err("Process has too many regions".into());
}
// ... existing logic ...
}
-
Add progress reporting for large scans:
- Log periodically when processing large address spaces.
- Allow user to interrupt via Ctrl+C.
Alternative Approaches
- Use OS profiling APIs to get VMA count before iterating
Examples
- Attacker uses mmap() in loop to create 1 million VMAs, causing mvis CLI to hang.
- TUI becomes unresponsive when user scans process with 50K+ regions.
Problem
Both the Windows walk_regions() (lines 61-127 in src/os/windows.rs) and the general region-walking logic have unbounded loops that can hang indefinitely on processes with unusual or malicious virtual address space layouts.
Proposed Solution
Add progress reporting for large scans:
Alternative Approaches
Examples