# HandBrake — CWE-407 Scan Result: CLEAN

**Date:** 2026-03-30
**Target:** HandBrake (C, libhb + macOS/Windows GUI)
**Source:** https://github.com/HandBrake/HandBrake (depth=1)

## Scan Summary

Scanned `libhb/` (82 C files), `macosx/` (Objective-C GUI), `win/CS/` (C# WPF GUI).

### Areas Examined

- **`hb_list_t` operations**: Array-backed list used for audio tracks (1-8), subtitles (1-10), chapters (5-50), presets (<100). `hb_list_rem()` does linear search + memmove but on inherently small, bounded collections.
- **`preset.c` language lookups**: `find_audio_track()` / `find_subtitle_track()` O(L×T) where L = user language count (1-3) and T = tracks (<50). Not exploitable.
- **`preset.c` `fix_name_collisions()`**: O(N×J) restart loop for name collision, but N = preset count and J = collision count, both small.
- **`stream.c` transport stream dedup**: Compares against single previous packet summary. O(1).
- **`common.c` encoder fallback resolution**: O(encoders²) but encoder count is fixed (~20-30). Not user-controlled.
- **macOS GUI**: `NSMutableSet` already used for destination dedup. `indexOfObject` calls on queue items operate on user selection (small).
- **C# WPF GUI**: `PortService.usedPorts` is `List<int>` but bounded by concurrent encode count (typically 1-4).

### Conclusion

HandBrake's list operations are consistently bounded by media metadata sizes (tracks, subtitles, chapters, presets) which are inherently small. No user-controlled input can cause quadratic growth. No CWE-407 defect found.
