All projects with patches now have outreach docs. 276 new docs covering CWE-407, CWE-312, CWE-362 across C, C++, Java, Python, Go, Rust, C#, PHP, Ruby, JavaScript, Dart, Erlang, R, and more. Outreach gap: 276 -> 0.
1.8 KiB
PCSX2 — CWE-407 Disclosure Brief (pcsx2-0002)
2026-04-13 · Patch available — awaiting upstream merge
Finding
O(N²) codec deduplication in GSCapture where std::find_if scans the codec result list for every codec returned by av_codec_iterate(), checking for duplicate names.
The Defect
pcsx2-0002 (PATCHED — LOW): pcsx2/GS/GSCapture.cpp:1498
// Inside av_codec_iterate loop:
if (std::find_if(ret.begin(), ret.end(),
[codec](const auto& it) { return it.first == codec->name; }) != ret.end())
continue;
Each new codec checks the entire result list for name duplicates. With C codecs, total cost is O(C²).
Complexity Proof
At C=200 codecs:
- Defective: ~20,000 string comparisons
- Fixed: 200 hash insertions
- ~100× op reduction.
Impact
PCSX2 enumerates available codecs when opening the capture/recording settings dialog. While the codec count is typically bounded, the quadratic pattern fires on every dialog open and scales with ffmpeg/libavcodec version (newer versions expose more codecs).
The Fix
Add an unordered_set<string> seen_codecs for O(1) dedup:
std::unordered_set<std::string> seen_codecs;
// ...
if (!seen_codecs.insert(codec->name).second)
continue;
Patch
Fix available: defects/pcsx2-0002/patch/pcsx2-0002-gscapture-codec-dedup-set.patch
Single-file patch in GSCapture.cpp.
What We Ask
A patch is ready for review.
- Confirm receipt and assign a GitHub issue reference (PCSX2/pcsx2).
- Assess severity — low (bounded codec count), but straightforward fix.
- Coordinate a disclosure date — we target 90 days from first contact.
- We will credit the PCSX2 team in the public disclosure. Preferred acknowledgment format welcome.
Contact: see cover email. This brief is confidential until coordinated disclosure.