Commit graph

441 commits

Author SHA1 Message Date
66f2e14770 supermodel: all 5 MOADs CLEAN (full coverage) 2026-03-31 19:25:03 -04:00
0ba09a4f4c rpcs3: 1 new defect (MOAD-0004 CWE-312 room password logged verbatim) 2026-03-31 19:24:59 -04:00
20b8a57f89 fuse: all 5 MOADs CLEAN
linapple: 1 CWE-312 defect (MOAD-0004), MOAD 0001/0002/0003/0005 CLEAN
2026-03-31 19:15:33 -04:00
4b180cd7ac bochs: all 5 MOADs CLEAN 2026-03-31 19:13:12 -04:00
28af16f96c caprice32: 2 CWE-407 defects, MOAD 0002-0005 CLEAN 2026-03-31 19:12:58 -04:00
9d46caa262 pcem: all 5 MOADs CLEAN 2026-03-31 19:07:46 -04:00
eeef9c0016 86box: all 5 MOADs CLEAN 2026-03-31 19:07:39 -04:00
cba1e8b030 vbam: all 5 MOADs CLEAN 2026-03-31 19:06:42 -04:00
8ec20778f5 openmsx: 1 CWE-407 defect, MOAD 0002-0005 CLEAN
openmsx-0001: MSXCPUInterface::checkBreakPoints() O(B) linear scan
over all breakpoints per Z80 instruction when any breakpoint is active.
Fix: unordered_map<uint16_t, vector<id>> index gives O(k) lookup where
k = breakpoints at current PC (typically 0). 500x improvement at B=500.
2026-03-31 19:06:37 -04:00
7e39ced759 ares: all 5 MOADs CLEAN 2026-03-31 18:56:59 -04:00
a1bfc140c4 cxbx-reloaded: 1 CWE-407 defect, MOAD 0002-0005 CLEAN 2026-03-31 18:56:55 -04:00
efb2eb8a25 desmume: 1 CWE-407 defect, MOAD 0002-0005 CLEAN
desmume-0001: armInnerLoop scans breakPoints std::vector<u32> linearly
O(B) on every ARM9 and ARM7 instruction (~66+33 MHz); replace with
std::unordered_set<u32> for O(1) lookup. 3.5x speedup at B=32. MOAD 0002-0005 CLEAN.
2026-03-31 18:56:46 -04:00
c51cac9fb1 melonds: 1 CWE-407 defect, MOAD 0002-0005 CLEAN
melonds-0001: GPU3D_Soft RenderScanline iterates all P polygons per
scanline O(P*S) per frame; active-list sweep gives O(P log P + A_total).
9x speedup at P=2048 with typical short-lived polygons. MOAD 0002-0005 CLEAN.
2026-03-31 18:56:40 -04:00
975eb12276 flycast: all 5 MOADs CLEAN 2026-03-31 18:47:05 -04:00
a663290e44 lime3ds: 1 CWE-407 defect, MOAD 0002-0005 CLEAN 2026-03-31 18:46:59 -04:00
cb3ee91292 undf: assign 1040-1056; stamp emulator wave patches (hatari/fceux/sameboy/duckstation/pcsx2/mupen64plus/mednafen/vice/fbneo/dolphin/genesis-plus-gx/ryujinx/cemu/fs-uae) 2026-03-31 18:18:58 -04:00
907aaec8c8 fs-uae: 1 CWE-407 defect, MOAD 0002-0005 CLEAN 2026-03-31 18:18:19 -04:00
ba31decc54 xemu: all 5 MOADs CLEAN 2026-03-31 18:17:09 -04:00
65578228e4 cemu: 2 CWE-407 defects, MOAD 0002-0005 CLEAN 2026-03-31 18:17:02 -04:00
7b1f81c260 blastem: all 5 MOADs CLEAN
CWE-407: key dispatch uses 2-level array O(1), no list scan in hot paths;
breakpoints patched into JIT code (not per-instruction scan); controller
info heuristics O(N) only on hotplug event (not emulation loop). MOAD 0002:
current_system is expected single-emulator global. MOAD 0003: C codebase,
no ThreadLocal. MOAD 0004: megawifi stub strings are placeholders, not real
credential logging. MOAD 0005: no unsynchronized cache patterns found.
2026-03-31 18:06:09 -04:00
8e1b8b1694 ryujinx: 1 CWE-407 defect, MOAD 0002-0005 CLEAN
ryujinx-0001: ManagedSocketPollManager Poll()/Select() List<Socket>.Contains()
inside loop after Socket.Select() trims lists to ready sockets. O(E*S) -> O(E+S)
with HashSet<Socket> conversion. 49.8x speedup at E=500. MOAD 0002-0005 CLEAN.
2026-03-31 18:06:01 -04:00
f3d6685811 genesis-plus-gx: 1 CWE-407 defect, MOAD 0002-0005 CLEAN
genesis-plus-gx-0001: retro_cheat_set duplicate cheat detection uses
O(N) linear scan over cheatlist[0..maxcheats-1] for every code added,
producing O(N^2) total cost when loading a full cheat file (MAX_CHEATS=150).
Fix: open-addressing hash table keyed by (address, data), O(1) per insert.
9x speedup measured at N=150.
2026-03-31 18:04:48 -04:00
8631453f5e dolphin: 1 CWE-407 defect, MOAD 0002-0005 CLEAN
dolphin-0001: BreakPoints::GetRegularBreakpoint O(N) std::ranges::find
over m_breakpoints vector, called per CPU instruction when breakpoints
are active. Fix: unordered_map<u32, size_t> index rebuilt on mutation,
O(1) lookup. 2.5x speedup at N=64, scales further with breakpoint count.
2026-03-31 18:04:42 -04:00
24524ac502 vice: 1 CWE-407 defect, MOAD 0002-0005 CLEAN
vice-0001: monitor breakpoint list O(N) scan per opcode — search_checkpoint_list
traverses sorted checkpoint linked list without early exit. Code comment promises
"we can drop out early" but never implements it. Fix: break when entry.start_addr
exceeds target address. 200x fewer comparisons for addresses below first breakpoint.
11/11 PASS.

DOSBox-X: dosbox-x-0001/0002 previously committed (2026-03-31). MOAD 0002-0005 CLEAN.
2026-03-31 17:52:21 -04:00
4170c71414 fbneo-0001: remove compiled test binary 2026-03-31 17:51:07 -04:00
5aaaac1ee3 fbneo: 1 CWE-407 defect, MOAD 0002-0005 CLEAN; mame: update scan to all 5 MOADs CLEAN
fbneo-0001: BurnDrvGetIndex O(N) linear scan over 24493 drivers -> O(1) unordered_map,
91x speedup at N=5000. Fix: hash index built at BurnLibInit, cleared at BurnLibExit.
mame: confirmed CLEAN on all 5 MOADs (binary search for driver lookup, single-threaded).
2026-03-31 17:50:45 -04:00
52edb7a6ea roles: java-topology is sandbox, undefect.com is source of truth 2026-03-31 17:48:57 -04:00
670ef7b771 mednafen: 1 CWE-407 defect, MOAD 0002-0005 CLEAN 2026-03-31 17:38:19 -04:00
0031b1296d mupen64plus: 1 CWE-407 defect, MOAD 0002-0005 CLEAN 2026-03-31 17:38:14 -04:00
e781dbe9e9 pcsx2: 1 CWE-407 defect (pcsx2-0003), MOAD 0002-0005 CLEAN 2026-03-31 17:37:01 -04:00
6591438096 duckstation: 2 CWE-407 defects, MOAD 0002-0005 CLEAN 2026-03-31 17:36:57 -04:00
30abd28d6f mgba: all 5 MOADs CLEAN 2026-03-31 17:25:01 -04:00
b98583bd03 snes9x: all 5 MOADs CLEAN 2026-03-31 17:24:57 -04:00
bce0df4bb6 atari800: all 5 MOADs CLEAN 2026-03-31 17:24:33 -04:00
58271bc4a8 stella: all 5 MOADs CLEAN 2026-03-31 17:24:33 -04:00
2611f389b6 hatari: 1 CWE-407 defect, MOAD 0002-0005 CLEAN 2026-03-31 17:24:29 -04:00
64dee0eb9c nestopia: all 5 MOADs CLEAN
MOAD-0001 (CWE-407): Nestopia uses std::lower_bound (binary search, sorted
array) for cheat code lookup in NstCheats.cpp -- already O(log N). Input
mapping in fltkui/inputmanager.cpp uses hash maps (jbmap/jhmap/jamap keyed
by port*100+inum) -- O(1). No linear scan inside any hot loop found.

MOAD-0002: Subsystems communicate through typed API layers (Cpu::Link,
Cpu::Unlink, NES_PEEK_A/NES_POKE_AD macros). No shared god-object mutable
global state coupling found.

MOAD-0003: No ThreadLocal or thread-scoped identity carriers found.
Single-threaded emulation core.

MOAD-0004: No netplay or credential handling in core or fltkui. No logging
of secrets found.

MOAD-0005: No cache get+null+compute+put race patterns found. CLEAN.
2026-03-31 17:17:48 -04:00
4d3cfc9435 fceux: 1 CWE-407 defect, MOAD 0002-0004 noted, MOAD 0005 CLEAN
MOAD-0001 (CWE-407): SubCheatsRead in src/cheat.cpp scans all C active
cheats linearly on every NES memory read at any cheat address. O(C) per
read, C up to 256. Fix: cheat_idx[0x10000] direct address lookup, O(1).
Unit test: 74.7x speedup at C=256. 1/1 PASS.

MOAD-0002: Global mutable state (SubCheats[], ARead[], CheatRPtrs[])
couples cheat, PPU, CPU subsystems -- expected single-threaded NES
architecture, not an actionable intertangle defect.

MOAD-0003: thread_local in profiler.cpp (per-thread profiling data) and
QtScriptManager.cpp (per-JS-engine context pointer) -- legitimate
thread-local scoping, not a leaked request context carrier.

MOAD-0004: NetPlay.cpp line 788 logs netplay session password verbatim
via printf("Authorize: Player: %i   Passwd: %s\n", msg->playerId,
msg->pswd). Debug printf, no patch created per scan protocol (0001 only).

MOAD-0005: No cache get+null+compute+put races found. CLEAN.
2026-03-31 17:17:36 -04:00
7f89c7a14c gambatte: SKIP, repo taken private
https://github.com/sinamas/gambatte returns a placeholder README only:
"This project has been taken private." No source available to scan.
All 5 MOADs: UNSCANNED, source unavailable.
2026-03-31 14:38:24 -04:00
f46f7c9588 sameboy: 2 CWE-407 defects, MOAD 0002-0005 CLEAN
sameboy-0001: test_watchpoint() O(W) linear scan per GB memory read/write.
Every call to GB_read_memory / GB_write_memory scans all watchpoints when
n_watchpoints > 0. Fix: watchpoint_address_flags[0x10000] lookup table gives
O(1) early exit; 128x speedup at W=128.

sameboy-0002: should_break() O(B) linear scan per CPU instruction fetch.
GB_debugger_run() calls should_break() every instruction when debug_active.
Fix: breakpoint_address_set[0x10000] boolean table gives O(1) early exit;
128x speedup at B=128.

MOAD-0002: CLEAN, gb struct passed explicitly, no shared global state.
MOAD-0003: CLEAN, __thread only used for local string formatting buffers.
MOAD-0004: CLEAN, no network credentials logged.
MOAD-0005: CLEAN, no unsynchronized cache patterns found.
2026-03-31 14:37:53 -04:00
7d118a7086 mesen2: all 5 MOADs CLEAN
MOAD-0001 CWE-407: CLEAN. No hot-path linear scans found.
- BreakpointManager uses pre-bucketed vector indexed by MemoryOperationType, O(1) dispatch
- CheatManager uses unordered_map keyed by address, O(1) lookup per read
- LabelManager uses unordered_map keyed by address+type, O(1) lookup
- FrozenAddressManager uses unordered_set, O(1) lookup
- ProfilerManager uses unordered_map keyed by function address, O(1) lookup
- ExpressionEvaluator RPN cache uses mutex-protected unordered_map, O(1) lookup
- All std::find occurrences are on cold paths (ROM load, controller enumeration, startup)
- KeyCombination.IsSubsetOf uses std::find on a max-3-element vector, trivially bounded

MOAD-0002 Intertangle: CLEAN. Clean subsystem interfaces.
- KeyManager, CheatManager, LabelManager, BreakpointManager all hold explicit
  Debugger/Emulator pointers rather than accessing shared global state directly.
- No god objects detected.

MOAD-0003 Leaked Context: CLEAN.
- thread_local _currentThreadId in Emulator is used only to detect if caller is
  the emulation thread. It carries no request-scoped identity and does not leak
  across call contexts.

MOAD-0004 CWE-312: CLEAN.
- Netplay password is SHA1-hashed with a 50-char random nonce before transmission.
- No password or credential value reaches any Log or DisplayMessage call.

MOAD-0005 Thundering Herd: CLEAN.
- ExpressionEvaluator cache is guarded by _cacheLock (SimpleLock) on both read and write.
- No unprotected get+null+compute+put patterns found.
2026-03-31 14:36:23 -04:00
2a0a635c74 undf: assign 1013-1039; stamp patches (samba/juicefs/ipfs-cluster/nfs/rclone/lotus/speed-dreams/seaweedfs wave) 2026-03-31 13:27:38 -04:00
0e3cf0440b samba: 2 CWE-407 defects, MOAD 0002-0005 CLEAN
samba-0001: security_token_has_sid O(A*S) in se_access_check
  - security_token_has_sid() does O(S) linear scan over token SIDs
  - called inside O(A) ACE loop in se_access_check_implicit_owner()
  - O(A*S) per file access; S=200 groups, A=20 ACEs = 4000 comparisons
  - fix: sort token->sids[2..] at finalization, use bsearch for O(log S)
  - 9.5x measured speedup (S=200, A=20); up to 26x at S=200, A=50
  - hot path: called on every smbd file open / access check

samba-0002: security_token_create O(N^2) SID dedup (source4 AD DC path)
  - nested for-loop in security_token_create deduplicates SIDs O(N^2)
  - Kerberos PAC with 500 group SIDs: ~125,000 dom_sid_equal() calls/login
  - at MS-KILE 1015-SID limit: ~515,000 calls per DC login
  - fix: binary insertion sort scratch array for O(N log N) dedup
  - 5.7x speedup at N=500, 9.3x at N=1000 (near PAC limit)
  - also applies security_token_sort_sids() after token build

MOAD-0002: smbd is single-threaded event loop, global state is by design
MOAD-0003: no thread-local credential storage found
MOAD-0004: all sensitive dumps guarded by #ifdef DEBUG_PASSWORD compile flag
MOAD-0005: all caches TDB-synchronized or single-threaded event loop
2026-03-31 13:27:08 -04:00
731cf178b8 ipfs-cluster-0001: filterMetrics containsPeer O(M*(B+C+P)) -> O(M+B+C+P)
MOAD-0001 (CWE-407): filterMetrics() in allocate.go calls containsPeer()
(linear scan) three times per metric in our inner loop — once for blacklist,
once for currentAllocs, once for priorityList. With M metrics and B+C+P
total peer-list entries, each allocation decision costs O(M*(B+C+P)).

Fix: Build map[peer.ID]struct{} sets before our loop. Each lookup becomes O(1).
At scale (200 peers, 100-entry lists): ~60x fewer comparisons.

MOAD-0002 (intertangle): allocation state passed as function args, no globals. CLEAN.
MOAD-0003 (leaked context): no ThreadLocal or goroutine-scoped carriers. CLEAN.
MOAD-0004 (logged secret): peer IDs logged, no auth tokens or private keys. CLEAN.
MOAD-0005 (thundering herd): allocation runs under consensus lock. CLEAN.
2026-03-31 13:26:23 -04:00
8847ded382 juicefs-0001: Rule.CanAccess named-group scan O(G*N) -> O(G+N), patch + unit test 2026-03-31 13:22:56 -04:00
82053d3c44 lotus: 1 CWE-407 defect, MOAD 0002-0005 CLEAN
lotus-0001: eventFilter.matchAddress() slices.Contains O(A) per event,
replace with map[address.Address]struct{} for O(1) lookup; 28.6x at A=100,
225x at A=1000; no limit enforced on Addresses in EthFilterSpec
2026-03-31 13:20:58 -04:00
3b44a7a8de style: avoid "the", use "our" — writing style rule + sweep 2026-03-31 13:19:39 -04:00
3a755ecf01 rclone: 3 new defects (rclone-0003 CWE-407, rclone-0004/0005 CWE-312), rclone-0001/0002 PASS 2026-03-31 13:19:29 -04:00
294ab0a792 nfs-utils: 2 CWE-407 defects, MOAD 0002-0005 CLEAN
nfs-utils-0001: client_lookup() non-FQDN branch O(N) linked list
  scan per call in support/export/client.c:289. With N unique
  wildcard/netgroup/subnet clients, export_read totals O(N^2).
  Fix: hash table for hostname lookup. 119x at N=4000.

nfs-utils-0002: get_exportlist() in utils/mountd/mountd.c,
  lookup_or_create_elist_entry O(E) path scan + insert_group
  O(G) dedup scan, both per export = O(E^2) total. Fix: hash
  tables for path lookup and group dedup. 73x at N=4000.

MOAD-0002 (intertangle): clientlist/exportlist globals are standard
  single-threaded daemon design, single execution context. CLEAN.
MOAD-0003 (leaked context): no __thread or pthread_getspecific. CLEAN.
MOAD-0004 (logged secret): gssd logs keytab paths and principal
  names (not credentials). No key material logged. CLEAN.
MOAD-0005 (thundering herd): caches protected by ple_lock mutex
  in gssd, single-threaded event loop in mountd. CLEAN.
2026-03-31 13:19:01 -04:00
3001d5fcf9 go-libp2p: CWE-407 matchMuxers O(I*R) slice scan in Noise handshake, MOAD-0002 through 0005 CLEAN 2026-03-31 13:18:16 -04:00