{ "documentType": "codex-security.findings", "findings": [ { "attackPath": { "controls": [ "64-peer and 64-author count caps", "4 MiB per-author encoded cap", "TLS responder pinning" ], "dataflow": { "evidenceRefs": [ "sybil-author-cap", "sybil-full-projection", "sybil-unbounded-ui", "sybil-wire-bounds" ], "outcome": "CPU/memory exhaustion and exclusion of legitimate new peers.", "sink": "Desktop process heap and peer-to-Tauri event queue.", "source": "Attacker-operated mDNS/QUIC responders with valid keys.", "summary": "Self-issued identities -> pinned snapshots -> retained per-peer/author maps -> cloned aggregate projections -> unbounded Tauri event queue." }, "impact": { "level": "high", "rationale": "The application may freeze, swap heavily, or terminate and legitimate peers may be excluded." }, "likelihood": { "level": "medium", "rationale": "The attack is practical but requires many identities and substantial traffic." }, "preconditions": [ "Sharing/discovery enabled", "Dozens of distinct PeerIds and endpoints", "Sustained valid snapshot traffic" ], "reachability": { "attacker": "Malicious same-LAN host.", "entrypoint": "mDNS candidate negotiation and Hello snapshot commit.", "evidenceRefs": [ "sybil-author-cap", "sybil-full-projection", "sybil-unbounded-ui", "sybil-wire-bounds" ], "preconditions": [ "Sharing/discovery enabled", "Dozens of distinct PeerIds and endpoints", "Sustained valid snapshot traffic" ], "summary": "Reachable from the same LAN while sharing/discovery is enabled; no victim key compromise is required." }, "summary": "Attacker-created identities authenticate as themselves, fill retained slots, publish maximal valid state, and trigger full queued projections." }, "codeEvidence": [ { "code": "if self.remote.len() >= MAX_CALL_TO_PLAY_AUTHORS - 1 {\n return ObserveRemoteAuthorOutcome::AtCapacity;\n}\nself.remote.insert(author_id, RemoteAuthorSlice { ... });", "endLine": 565, "explanation": "The cap counts identities, not aggregate encoded bytes or physical origins.", "id": "sybil-author-cap", "label": "Per-author state is retained until a global author-count cap", "language": "rust", "path": "crates/lanspread-peer/src/call_to_play.rs", "role": "root_control", "startLine": 555 }, { "code": "for (author_id, slice) in &self.remote {\n Self::extend_visible_author_events(*author_id, &slice.snapshot, now, &windows, &mut events);\n}\nevents.sort_by_key(|event| (event.at, event.call_id, event.author_id, event.id));", "endLine": 855, "explanation": "Repeated commits rebuild complete owned views.", "id": "sybil-full-projection", "label": "Every publication clones visible events across all authors", "language": "rust", "path": "crates/lanspread-peer/src/call_to_play.rs", "role": "evidence", "startLine": 835 }, { "code": "pub fn send(tx_notify_ui: &UnboundedSender, event: PeerEvent) {\n if let Err(err) = tx_notify_ui.send(event) { ... }\n}", "endLine": 25, "explanation": "There is no capacity, backpressure, or replace-latest coalescing at this boundary.", "id": "sybil-unbounded-ui", "label": "Complete views enter an unbounded channel", "language": "rust", "path": "crates/lanspread-peer/src/events.rs", "role": "sink", "startLine": 21 }, { "code": "pub const MAX_LIBRARY_GAMES: usize = 4_096;\npub const MAX_CALL_TO_PLAY_EVENTS_PER_AUTHOR: usize = 4_096;\npub const MAX_CALL_TO_PLAY_AUTHOR_SNAPSHOT_BYTES: usize = 4 * 1024 * 1024;", "endLine": 20, "explanation": "Sixty-three remote authors can retain about 252 MiB encoded before allocation overhead.", "id": "sybil-wire-bounds", "label": "Large limits are per author/peer", "language": "rust", "path": "crates/lanspread-proto/src/lib.rs", "role": "source", "startLine": 15 } ], "confidence": { "level": "high", "rationale": "The identity generation, first-come caps, per-author byte allowance, full projection cloning, and unbounded sender are explicit in source." }, "extensions": {}, "findingId": "csf_7f1f254725189aac18ef1e44", "fingerprints": { "algorithm": "codex-security/v1", "primary": "codex-security/v1:sha256:98060f19cf12dd314a2039a9dc1eb93158ac43200f525155125360ac5f7b7a9c" }, "identity": { "anchor": "sybil-aggregate-state-and-ui-publication" }, "locations": [ { "endLine": 565, "path": "crates/lanspread-peer/src/call_to_play.rs", "role": "root_control", "startLine": 555 }, { "endLine": 25, "path": "crates/lanspread-peer/src/events.rs", "role": "sink", "startLine": 21 }, { "endLine": 360, "path": "crates/lanspread-peer/src/peer_db.rs", "role": "root_control", "startLine": 356 }, { "endLine": 20, "path": "crates/lanspread-proto/src/lib.rs", "role": "source", "startLine": 15 } ], "occurrenceId": "occ_b1ba111f96d0b687d00e5778", "provenance": { "candidateId": "cand-sybil-aggregate-state", "originalCandidates": [ { "confidence": "high", "cwe": "CWE-400", "locations": "identity.rs; discovery.rs; proto/lib.rs; peer_db.rs; call_to_play.rs; remote_state.rs; events.rs", "severity": "high", "source_to_sink": "Aggregate 64-peer/author state and cloned full views enter an unbounded UI queue.", "title": "Sybil peer snapshots can exhaust memory through aggregate state retention and unbounded full-view publication" } ], "previousFindings": [], "source": "focused_investigator" }, "remediation": "Enforce aggregate byte/event budgets across remote peers, coalesce complete UI state through bounded latest-value channels, avoid full cloning per commit, and add fair/per-origin admission for identities.", "rootCause": { "evidenceRefs": [ "sybil-author-cap", "sybil-full-projection", "sybil-unbounded-ui", "sybil-wire-bounds" ], "summary": "Identity-count limits are first-come and per-author bounds are not paired with aggregate retained-byte or queued-view budgets." }, "ruleId": "resource-exhaustion.sybil-aggregate-state", "severity": { "changeConditions": "Severity increases if fewer identities can cross the host memory limit or if the UI consumer is routinely slow.", "level": "medium", "rationale": "The impact can terminate the desktop process, but exploitation requires sustained LAN access, dozens of identities/endpoints, and substantial state transfer." }, "summary": "One LAN host can generate enough valid peer identities to fill peer/author slots, retain hundreds of MiB of bounded-per-author state, and repeatedly enqueue cloned full views without an aggregate byte budget.", "taxonomy": { "category": "resource-exhaustion", "cwe": [ "CWE-400" ] }, "title": "Sybil peers can exhaust aggregate state and unbounded UI publication", "validation": { "assertions": [ "One host can create many valid self-issued identities.", "Per-author 4 MiB limits aggregate across 63 remote authors.", "Full replacement views are owned clones sent through an unbounded channel." ], "counterEvidence": [ "Peer and author counts are finite.", "TLS prevents impersonation of an existing PeerId.", "Invalid snapshots and wrong content bytes are rejected." ], "disposition": "reportable", "evidenceRefs": [ "sybil-author-cap", "sybil-full-projection", "sybil-unbounded-ui", "sybil-wire-bounds" ], "method": "Independent static source trace against the registered revision and strongest counterevidence.", "status": "validated", "summary": "Validated and merged with the duplicate peer/author-slot candidate; exact content verification limits integrity impact but does not bound retained/queued state." } }, { "attackPath": { "controls": [ "Finite global caps", "10-second control deadlines", "10-minute inactivity deadlines", "Separate control and bulk pools" ], "dataflow": { "evidenceRefs": [ "pool-no-client-auth", "pool-global-limits", "pool-bulk-admission", "pool-unrar-listing" ], "outcome": "Denial of legitimate sync/download/install service.", "sink": "Global peer admission, bulk transfer capacity, native subprocess/CPU resources.", "source": "Same-LAN client requests.", "summary": "Anonymous QUIC connection -> global stream/bulk permit -> request handler -> file handles or unrar subprocesses." }, "impact": { "level": "medium", "rationale": "Availability is lost and host resources are pressured; file integrity remains catalog-protected." }, "likelihood": { "level": "high", "rationale": "Only ordinary LAN reachability and sustained requests are required." }, "preconditions": [ "Sharing enabled", "Victim advertises or attacker learns endpoint", "For StreamInstall, a locally available stream-capable game" ], "reachability": { "attacker": "Any host on the reachable LAN.", "entrypoint": "QUIC listener and StreamInstall/GetGameFileChunk requests.", "evidenceRefs": [ "pool-no-client-auth", "pool-global-limits", "pool-bulk-admission", "pool-unrar-listing" ], "preconditions": [ "Sharing enabled", "Victim advertises or attacker learns endpoint", "For StreamInstall, a locally available stream-capable game" ], "summary": "Directly reachable whenever Local network sharing is enabled." }, "summary": "One LAN origin repeatedly opens connections/streams and valid bulk requests until every global slot is occupied." }, "codeEvidence": [ { "code": "let mut config = ServerConfig::builder_with_provider(provider)\n .with_protocol_versions(&[&rustls::version::TLS13])?\n .with_no_client_auth()\n .with_single_cert(...)?;", "endLine": 133, "explanation": "Requester identity cannot support fair per-peer quotas.", "id": "pool-no-client-auth", "label": "Server accepts anonymous requesters", "language": "rust", "path": "crates/lanspread-peer/src/tls.rs", "role": "root_control", "startLine": 126 }, { "code": "const MAX_ESTABLISHED_CONNECTIONS: usize = 64;\nconst MAX_CONTROL_STREAM_TASKS: usize = 32;\nconst MAX_GLOBAL_CONTROL_STREAM_TASKS: usize = 64;\nconst MAX_GLOBAL_BULK_TRANSFER_TASKS: usize = 48;", "endLine": 44, "explanation": "One origin can consume every shared slot.", "id": "pool-global-limits", "label": "Admission budgets are global", "language": "rust", "path": "crates/lanspread-peer/src/services/server.rs", "role": "root_control", "startLine": 31 }, { "code": "let bulk_permit = Arc::clone(&bulk_transfer_permits).try_acquire_owned();\ndrop(control_permit.take());\nif let Ok(permit) = bulk_permit {\n _bulk_permit = Some(permit);\n ...\n}", "endLine": 89, "explanation": "There is no source-address, requester, game, or expensive-provider quota.", "id": "pool-bulk-admission", "label": "Each bulk request independently takes the shared pool", "language": "rust", "path": "crates/lanspread-peer/src/services/stream.rs", "role": "entrypoint", "startLine": 70 }, { "code": "let process = ScopedProcess::spawn(\n program,\n [\"vt\", \"-c-\", \"-p-\", ...],\n cancel_token,\n LISTING_CAPTURE_LIMIT,\n)?;", "endLine": 414, "explanation": "Each admitted operation can start native listing and later decompression.", "id": "pool-unrar-listing", "label": "Stream Install starts native archive processing", "language": "rust", "path": "crates/lanspread-peer/src/stream_install.rs", "role": "sink", "startLine": 387 } ], "confidence": { "level": "high", "rationale": "No-client-auth, global-only semaphores, request dispatch, and per-request provider execution are explicit." }, "extensions": {}, "findingId": "csf_984da905a9b4074194d1814b", "fingerprints": { "algorithm": "codex-security/v1", "primary": "codex-security/v1:sha256:1d70a00f495ad3463b91c2fcf08d4d7fcd7d3ff00cf1fc63b4a96b46ba0008b7" }, "identity": { "anchor": "anonymous-global-pools-and-stream-install-workers" }, "locations": [ { "endLine": 133, "path": "crates/lanspread-peer/src/tls.rs", "role": "root_control", "startLine": 126 }, { "endLine": 44, "path": "crates/lanspread-peer/src/services/server.rs", "role": "root_control", "startLine": 31 }, { "endLine": 89, "path": "crates/lanspread-peer/src/services/stream.rs", "role": "entrypoint", "startLine": 70 }, { "endLine": 414, "path": "crates/lanspread-peer/src/stream_install.rs", "role": "sink", "startLine": 387 } ], "occurrenceId": "occ_4b80e3b7dfe1e6768d05ba94", "provenance": { "candidateId": "cand-anonymous-global-pool-dos", "originalCandidates": [ { "title": "Anonymous global pools" } ], "previousFindings": [], "source": "focused_investigator" }, "remediation": "Add per-source connection/stream/rate quotas, close origins after repeated timeouts, reserve capacity across origins, place unrar behind a small global and per-origin semaphore, and enforce absolute transfer deadlines.", "rootCause": { "evidenceRefs": [ "pool-no-client-auth", "pool-global-limits", "pool-bulk-admission", "pool-unrar-listing" ], "summary": "Anonymous requester admission is protected only by finite global pools; expensive StreamInstall provider work has no smaller global or per-origin quota." }, "ruleId": "resource-exhaustion.anonymous-network-pools", "severity": { "changeConditions": "Severity increases on memory-constrained hosts or archives with expensive decompression.", "level": "medium", "rationale": "A same-LAN attacker can reliably deny synchronization and transfers and impose expensive native work, but all pools are finite and the attack must be sustained." }, "summary": "The responder authenticates no client and applies only global connection, control, and bulk limits, so one origin can occupy every admission slot and drive up to 48 concurrent StreamInstall operations with native unrar work.", "taxonomy": { "category": "resource-exhaustion", "cwe": [ "CWE-400" ] }, "title": "Anonymous LAN requesters can monopolize global pools and native extractors", "validation": { "assertions": [ "No client identity exists.", "All resource permits are shared globally.", "StreamInstall performs native work after acquiring only the general bulk permit." ], "counterEvidence": [ "Handshake, connection, control, and bulk counts are finite.", "Control and bulk pools are separated.", "Stalled work has application timeouts and cancellation." ], "disposition": "reportable", "evidenceRefs": [ "pool-no-client-auth", "pool-global-limits", "pool-bulk-admission", "pool-unrar-listing" ], "method": "Independent static source trace against the registered revision and strongest counterevidence.", "status": "validated", "summary": "Validated; the separate StreamInstall-subprocess candidate is merged here because it shares anonymous global bulk admission and the same quota remediation." } }, { "attackPath": { "controls": [ "128 MiB individual manifest limit", "Finite immutable catalog", "Serialized operation admission" ], "dataflow": { "evidenceRefs": [ "cache-load-before-check", "cache-stream-before-check", "cache-unbounded-insert" ], "outcome": "Memory growth and denial/delay of legitimate operations.", "sink": "Process heap, manifest parser, and serialized operation-admission lock.", "source": "Unauthenticated bulk request fields.", "summary": "Network game_id -> CatalogBundle::manifest -> bounded disk read/parse -> persistent cache -> later rejection." }, "impact": { "level": "medium", "rationale": "Potential process memory exhaustion and operational blocking; exact magnitude depends on external corpus." }, "likelihood": { "level": "high", "rationale": "Wrong ContentIds are sufficient and no local availability is required." }, "preconditions": [ "Sharing enabled", "Knowledge or enumeration of bundled game IDs" ], "reachability": { "attacker": "Same-LAN anonymous requester.", "entrypoint": "GetGameFileChunk and StreamInstall.", "evidenceRefs": [ "cache-load-before-check", "cache-stream-before-check", "cache-unbounded-insert" ], "preconditions": [ "Sharing enabled", "Knowledge or enumeration of bundled game IDs" ], "summary": "Reachable for any known bundled game ID while sharing is enabled." }, "summary": "An anonymous requester enumerates known catalog IDs with wrong ContentIds, forcing rejected requests to load/cache bodies." }, "codeEvidence": [ { "code": "let manifest = load_expected_catalog_manifest(ctx, game_id)?;\nif manifest.content_id() != content_id { return None; }\nif !can_serve_game(ctx, &game_dir, game_id).await { return None; }", "endLine": 284, "explanation": "A wrong ContentId or nonlocal known game still causes a body load.", "id": "cache-load-before-check", "label": "Full body loads precede rejection", "language": "rust", "path": "crates/lanspread-peer/src/services/transfer.rs", "role": "root_control", "startLine": 270 }, { "code": "let manifest = load_expected_catalog_manifest(ctx, game_id)?;\nif manifest.content_id() != content_id { return None; }\nif !can_serve_game(ctx, &game_dir, game_id).await || !manifest.supports_streamed_install() { return None; }", "endLine": 319, "explanation": "Both independent network operations are affected.", "id": "cache-stream-before-check", "label": "Stream Install repeats the ordering", "language": "rust", "path": "crates/lanspread-peer/src/services/transfer.rs", "role": "evidence", "startLine": 308 }, { "code": "let manifest = Arc::new(self.load_uncached(game_id, expected_version)?);\nlet mut cache = self.cache.write()?;\nOk(cache.entry(game_id.to_owned()).or_insert_with(|| Arc::clone(&manifest)).clone())", "endLine": 186, "explanation": "No entry/byte eviction applies to cumulative remote-triggered loads.", "id": "cache-unbounded-insert", "label": "Every miss is retained", "language": "rust", "path": "crates/lanspread-db/src/content_manifest/store.rs", "role": "sink", "startLine": 162 } ], "confidence": { "level": "high", "rationale": "Call order and unbounded cache insertion are direct; the missing production bodies only limit measurement." }, "extensions": {}, "findingId": "csf_28dcda78d4a8e1d179a20e6f", "fingerprints": { "algorithm": "codex-security/v1", "primary": "codex-security/v1:sha256:c71b31921c2ee1ae38de77962c2bfd27469df63611c19a80e083c349ee24daca" }, "identity": { "anchor": "full-manifest-load-before-compact-admission" }, "locations": [ { "endLine": 321, "path": "crates/lanspread-peer/src/services/transfer.rs", "role": "root_control", "startLine": 258 }, { "endLine": 186, "path": "crates/lanspread-db/src/content_manifest/store.rs", "role": "sink", "startLine": 162 } ], "occurrenceId": "occ_4c4e343d108a709a37ed2015", "provenance": { "candidateId": "cand-manifest-cache-before-admission", "originalCandidates": [ { "title": "Manifest cache admission ordering" } ], "previousFindings": [], "source": "focused_investigator" }, "remediation": "Check `content_identity` and local readiness first, then require `cached_manifest`; add tests proving rejected requests perform no load, plus an aggregate cache budget.", "rootCause": { "evidenceRefs": [ "cache-load-before-check", "cache-stream-before-check", "cache-unbounded-insert" ], "summary": "Bulk admission uses the disk-capable on-demand manifest API before the compact index and preloaded local-library cache can reject the request." }, "ruleId": "resource-exhaustion.manifest-cache-admission-order", "severity": { "changeConditions": "Severity depends on the aggregate encoded/parsed size of the external production manifest corpus.", "level": "medium", "rationale": "An anonymous LAN client can force persistent corpus-wide parse/retention and serialized admission work; actual production size is unavailable, limiting impact certainty." }, "summary": "Both bulk request variants load and retain a full catalog manifest before checking compact ContentId equality or whether the game is locally serveable.", "taxonomy": { "category": "resource-exhaustion", "cwe": [ "CWE-400" ] }, "title": "Rejected bulk requests can populate the persistent manifest cache", "validation": { "assertions": [ "The compact identity is available without filesystem I/O.", "Both bulk variants call full load before identity/local checks.", "Loaded bodies persist in a HashMap without eviction." ], "counterEvidence": [ "Only immutable catalog IDs can load.", "Each manifest and catalog are finite.", "Operation admission serializes loads.", "Production bodies are absent, so actual aggregate size was not measured." ], "disposition": "reportable", "evidenceRefs": [ "cache-load-before-check", "cache-stream-before-check", "cache-unbounded-insert" ], "method": "Independent static source trace against the registered revision and strongest counterevidence.", "status": "validated", "summary": "Validated. Known IDs and per-body limits bound the universe, but do not enforce the documented no-I/O rejection or an aggregate retained-byte limit." } }, { "attackPath": { "controls": [ "64-decoder/candidate caps", "10-second application deadlines", "QUIC transport limits" ], "dataflow": { "evidenceRefs": [ "prefix-frame-max", "prefix-decoder-count", "prefix-decoder-config", "prefix-lock" ], "outcome": "Abrupt memory pressure, swapping, or process termination.", "sink": "Desktop heap and every global control/discovery slot.", "source": "Unauthenticated inbound clients or attacker-operated discovery responders.", "summary": "Length prefix -> LengthDelimitedCodec header decode -> eager BytesMut reserve -> incomplete frame wait." }, "impact": { "level": "high", "rationale": "A half-gigabyte allocation spike can terminate constrained desktops." }, "likelihood": { "level": "medium", "rationale": "Inbound requires only two connections; discovery requires more setup. Waves are finite but repeatable." }, "preconditions": [ "Sharing/discovery enabled", "Concurrent streams or candidates" ], "reachability": { "attacker": "Same-LAN participant.", "entrypoint": "Server bidirectional streams and discovery Hello responses.", "evidenceRefs": [ "prefix-frame-max", "prefix-decoder-count", "prefix-decoder-config", "prefix-lock" ], "preconditions": [ "Sharing/discovery enabled", "Concurrent streams or candidates" ], "summary": "Inbound requires listener access; discovery requires 64 advertised identities/endpoints with matching keys." }, "summary": "Concurrent requesters or attacker-owned responders send maximal length prefixes and stall before payload." }, "codeEvidence": [ { "code": "pub const MAX_CONTROL_FRAME_BYTES: usize = 8 * 1024 * 1024;\npub const MAX_STREAM_INSTALL_FRAME_BYTES: usize = 8 * 1024 * 1024;", "endLine": 14, "explanation": "Inbound requests are much smaller, but share the response-sized maximum.", "id": "prefix-frame-max", "label": "Every control codec permits 8 MiB", "language": "rust", "path": "crates/lanspread-proto/src/lib.rs", "role": "root_control", "startLine": 13 }, { "code": "const MAX_CONTROL_STREAM_TASKS: usize = 32;\nconst MAX_GLOBAL_CONTROL_STREAM_TASKS: usize = 64;", "endLine": 41, "explanation": "Two connections can populate all 64 stream tasks.", "id": "prefix-decoder-count", "label": "Server admits 64 global decoders", "language": "rust", "path": "crates/lanspread-peer/src/services/server.rs", "role": "evidence", "startLine": 31 }, { "code": "LengthDelimitedCodec::builder()\n .max_frame_length(MAX_CONTROL_FRAME_BYTES)\n .new_codec()\n...\nlet first_frame = read_expected_frame(...).await;", "endLine": 67, "explanation": "The whole declared body is awaited before Request::decode.", "id": "prefix-decoder-config", "label": "Decoder uses the shared maximum before parsing", "language": "rust", "path": "crates/lanspread-peer/src/services/stream.rs", "role": "entrypoint", "startLine": 37 }, { "code": "[[package]]\nname = \"tokio-util\"\nversion = \"0.7.19\"\nchecksum = \"494815d09bf52b5548659851081238f0ca39ff638363907596da739561c62c52\"", "endLine": 4659, "explanation": "Offline inspection of this locked source confirmed `src.reserve(n.saturating_sub(src.len()))` after decoding the header.", "id": "prefix-lock", "label": "Locked decoder version", "language": "text", "path": "Cargo.lock", "role": "evidence", "startLine": 4655 } ], "confidence": { "level": "high", "rationale": "Repository concurrency/frame limits and the locked dependency's reserve behavior were inspected offline." }, "extensions": {}, "findingId": "csf_d40a863e76a3bf4cb0bd412a", "fingerprints": { "algorithm": "codex-security/v1", "primary": "codex-security/v1:sha256:fffdefc91a869c1291f679a54297d18c889dc2e049b391e4534d0a53e61769cf" }, "identity": { "anchor": "max-frame-prefix-reserves-aggregate-memory" }, "locations": [ { "endLine": 20, "path": "crates/lanspread-proto/src/lib.rs", "role": "root_control", "startLine": 13 }, { "endLine": 41, "path": "crates/lanspread-peer/src/services/server.rs", "role": "root_control", "startLine": 31 }, { "endLine": 67, "path": "crates/lanspread-peer/src/services/stream.rs", "role": "entrypoint", "startLine": 37 }, { "endLine": 32, "path": "crates/lanspread-peer/src/services/discovery.rs", "role": "entrypoint", "startLine": 30 }, { "endLine": 4659, "path": "Cargo.lock", "role": "evidence", "startLine": 4655 } ], "occurrenceId": "occ_86bfac07819428f756982d0e", "provenance": { "candidateId": "cand-inbound-prefix-allocation", "originalCandidates": [ { "title": "Inbound prefix allocation" } ], "previousFindings": [], "source": "focused_investigator" }, "remediation": "Use a much smaller inbound Request-frame maximum; gate declared response bytes through a global memory semaphore or incremental buffering; reduce discovery fan-out as defense in depth.", "rootCause": { "evidenceRefs": [ "prefix-frame-max", "prefix-decoder-count", "prefix-decoder-config", "prefix-lock" ], "summary": "A response-sized per-frame maximum is applied independently to many untrusted decoders without an aggregate receive-memory budget or incremental allocation." }, "ruleId": "resource-exhaustion.length-prefix-eager-reserve", "severity": { "changeConditions": "Severity increases on memory-constrained desktops or if concurrency/frame limits grow.", "level": "medium", "rationale": "A LAN attacker can induce abrupt half-gigabyte allocation pressure with negligible payload, but global caps and 10-second deadlines bound each wave." }, "summary": "The same 8 MiB control-frame allowance is multiplied across 64 concurrent inbound request decoders and 64 discovery Hello decoders; locked tokio-util eagerly reserves the declared body after only the length prefix.", "taxonomy": { "category": "resource-exhaustion", "cwe": [ "CWE-400" ] }, "title": "Control-frame prefixes can reserve about 512 MiB across concurrent decoders", "validation": { "assertions": [ "64 multiplied by 8 MiB is 512 MiB before overhead.", "Only four prefix bytes are needed before tokio-util reserves.", "Inbound and discovery response paths both use the shared maximum." ], "counterEvidence": [ "Global task/candidate caps bound a single wave.", "Ten-second deadlines release stalled decoders.", "Discovery identities must authenticate as themselves, though inbound clients are anonymous." ], "disposition": "reportable", "evidenceRefs": [ "prefix-frame-max", "prefix-decoder-count", "prefix-decoder-config", "prefix-lock" ], "method": "Independent static source trace against the registered revision and strongest counterevidence.", "status": "validated", "summary": "Validated and merged with the discovery-prefix instance because both use the same locked decoder behavior and aggregate-budget failure." } }, { "attackPath": { "controls": [ "Single-component game IDs", "Catalog integrity for peer downloads", "UAC prompt", "Installed/local presence checks" ], "dataflow": { "evidenceRefs": [ "runas-game-path", "runas-server-path", "runas-verb" ], "outcome": "Administrator execution of attacker-controlled batch content.", "sink": "Elevated Windows command processor.", "source": "Locally/shared-tree controlled game scripts.", "summary": "Selected directory + game ID -> joined mutable script path -> string cmd.exe parameters -> ShellExecute runas." }, "impact": { "level": "high", "rationale": "Successful exploitation executes attacker code with the elevated token." }, "likelihood": { "level": "medium", "rationale": "Multiple local/user-interaction prerequisites materially constrain exploitation." }, "preconditions": [ "Windows", "Writable or crafted selected game root", "Victim launch action", "UAC approval" ], "reachability": { "attacker": "Lower-privileged local or shared-directory supplier.", "entrypoint": "run_game or start_server Tauri command.", "evidenceRefs": [ "runas-game-path", "runas-server-path", "runas-verb" ], "preconditions": [ "Windows", "Writable or crafted selected game root", "Victim launch action", "UAC approval" ], "summary": "Conditional on Windows, selected-root write influence, local launch, and UAC approval." }, "summary": "A writable selected game tree supplies or replaces expected script names; a victim launch crosses runas." }, "codeEvidence": [ { "code": "let game_path = games_folder.join(id.clone());\nlet game_setup_bin = game_path.join(GAME_SETUP_SCRIPT);\nlet game_start_bin = game_path.join(GAME_START_SCRIPT);\n...\nrun_as_admin_and_wait(\"cmd.exe\", &setup_params, &game_dir, ...)?;\n...\nrun_as_admin_detached(\"cmd.exe\", &script_params(&game_start_bin, ...), ...);", "endLine": 1951, "explanation": "No manifest, digest, retained handle, or reparse check binds the launched script.", "id": "runas-game-path", "label": "Game scripts are path-checked then elevated", "language": "rust", "path": "crates/lanspread-tauri-deno-ts/src-tauri/src/lib.rs", "role": "sink", "startLine": 1891 }, { "code": "let game_path = games_folder.join(id.clone());\nlet server_start_bin = game_path.join(SERVER_START_SCRIPT);\nif !server_start_bin.is_file() { return Ok(false); }\n...\nrun_as_admin_detached(\"cmd.exe\", &server_script_params(&server_start_bin, ...), ...);", "endLine": 2057, "explanation": "Path-based `is_file` follows redirections and does not prove catalog authority.", "id": "runas-server-path", "label": "Server script has the same gap", "language": "rust", "path": "crates/lanspread-tauri-deno-ts/src-tauri/src/lib.rs", "role": "evidence", "startLine": 2026 }, { "code": "let runas_wide = OsStr::new(\"runas\").encode_wide().chain(Some(0)).collect();\nShellExecuteW(None, PCWSTR::from_raw(runas_wide.as_ptr()), ...);", "endLine": 1577, "explanation": "The explicit UAC boundary makes mutable-script provenance security-sensitive.", "id": "runas-verb", "label": "Detached launcher requests elevation", "language": "rust", "path": "crates/lanspread-tauri-deno-ts/src-tauri/src/lib.rs", "role": "root_control", "startLine": 1563 } ], "confidence": { "level": "high", "rationale": "The path checks, missing catalog/digest checks, and runas calls are explicit." }, "extensions": {}, "findingId": "csf_440f1250535a69bcbbeb8d14", "fingerprints": { "algorithm": "codex-security/v1", "primary": "codex-security/v1:sha256:2d051e05bbf21a3a948ad8f9028519a29bd04980ea7c981575c9c956de7a0e20" }, "identity": { "anchor": "mutable-game-script-runas-without-integrity-binding" }, "locations": [ { "endLine": 1958, "path": "crates/lanspread-tauri-deno-ts/src-tauri/src/lib.rs", "role": "sink", "startLine": 1866 }, { "endLine": 2064, "path": "crates/lanspread-tauri-deno-ts/src-tauri/src/lib.rs", "role": "sink", "startLine": 2007 }, { "endLine": 1582, "path": "crates/lanspread-tauri-deno-ts/src-tauri/src/lib.rs", "role": "root_control", "startLine": 1554 } ], "occurrenceId": "occ_e3fcb8021db0f8fa3a50cdad", "provenance": { "candidateId": "cand-elevated-mutable-game-scripts", "originalCandidates": [ { "title": "Elevated mutable game scripts" } ], "previousFindings": [], "source": "focused_investigator" }, "remediation": "Run ordinary game/server scripts as the current user. For setup requiring elevation, require a catalog game and authoritative installed state, verify the exact script digest immediately before launch through no-follow handles, reject reparse points, and preserve the verified object identity into process creation.", "rootCause": { "evidenceRefs": [ "runas-game-path", "runas-server-path", "runas-verb" ], "summary": "The Windows launch path is separate from the catalog-bound no-follow install/download capabilities and treats filename/existence plus user action as sufficient authority for elevation." }, "ruleId": "privilege-escalation.mutable-game-scripts", "severity": { "changeConditions": "Severity increases where selected game directories are shared across trust boundaries or UAC prompts are routinely approved.", "level": "medium", "rationale": "The consequence is administrator code execution, but exploitation requires local/shared-tree write influence, a victim launch action, Windows, and UAC approval." }, "summary": "Windows play/server commands follow mutable paths under any selected game root and pass setup/start scripts to `cmd.exe` with `runas` without rechecking catalog membership, digest, installed ownership, or reparse-free containment.", "taxonomy": { "category": "privilege-escalation", "cwe": [ "CWE-250", "CWE-73" ] }, "title": "Mutable game scripts are launched elevated without launch-time trust binding", "validation": { "assertions": [ "Any existing selected directory can become the games root.", "Sink functions accept single-component IDs without a catalog lookup.", "Scripts are elevated by path after only existence/local checks." ], "counterEvidence": [ "IDs are one component and user settings are sanitized.", "Downloaded/streamed bytes are catalog verified.", "The victim must invoke play/server and approve UAC." ], "disposition": "reportable", "evidenceRefs": [ "runas-game-path", "runas-server-path", "runas-verb" ], "method": "Independent static source trace against the registered revision and strongest counterevidence.", "status": "validated", "summary": "Validated with severity reduced from high for Windows/UAC/local-write prerequisites. Remote peers alone cannot substitute bytes because downloads remain catalog-verified." } }, { "attackPath": { "controls": [ "Per-author duplicate rejection", "Creator-only action checks", "Authenticated author attribution" ], "dataflow": { "evidenceRefs": [ "ctp-per-author-id", "ctp-author-preserved", "ctp-global-map" ], "outcome": "Legitimate calls or updates disappear or are substituted.", "sink": "Call-to-Play reducer and rendered nominations/messages.", "source": "Attacker-controlled CallToPlayAuthorEvent.id.", "summary": "Pinned remote snapshot -> authenticated Rust view with author_id -> frontend Map keyed only by event.id -> overwritten legitimate event." }, "impact": { "level": "low", "rationale": "Only ephemeral collaboration UI integrity is affected." }, "likelihood": { "level": "high", "rationale": "The nonce is visible to connected peers and can be copied exactly." }, "preconditions": [ "Attacker observes target nonce", "Attacker publishes a colliding valid event" ], "reachability": { "attacker": "Authenticated hostile LAN peer.", "entrypoint": "HelloSnapshot Call-to-Play author slice.", "evidenceRefs": [ "ctp-per-author-id", "ctp-author-preserved", "ctp-global-map" ], "preconditions": [ "Attacker observes target nonce", "Attacker publishes a colliding valid event" ], "summary": "Requires a connected hostile peer that observes the shared snapshot and publishes a later valid author slice." }, "summary": "A hostile author republishes a valid participant event using a victim event's nonce so frontend deduplication keeps the hostile later event." }, "codeEvidence": [ { "code": "let mut event_ids = HashSet::with_capacity(snapshot.events.len());\n...\nif !event_ids.insert(event.id) {\n return Err(CallToPlayValidationError::DuplicateEventId(event.id));\n}", "endLine": 979, "explanation": "Equal nonces across authenticated authors remain valid.", "id": "ctp-per-author-id", "label": "Nonce uniqueness is per author snapshot", "language": "rust", "path": "crates/lanspread-peer/src/call_to_play.rs", "role": "evidence", "startLine": 961 }, { "code": "output.push(CallToPlayViewEvent {\n id: event.id,\n call_id: event.call_id,\n author_id,\n author_name: snapshot.display_name.clone(),\n ...\n});", "endLine": 884, "explanation": "The correct composite identity is available to consumers.", "id": "ctp-author-preserved", "label": "Rust projection preserves the namespace", "language": "rust", "path": "crates/lanspread-peer/src/call_to_play.rs", "role": "evidence", "startLine": 877 }, { "code": "const unique = new Map(input.map(event => [event.id, event]));\nconst byCall = new Map();\nfor (const event of unique.values()) { ... }", "endLine": 145, "explanation": "A later event with the same nonce replaces another author's event before grouping.", "id": "ctp-global-map", "label": "Frontend drops the author namespace", "language": "typescript", "path": "crates/lanspread-tauri-deno-ts/src/lib/callToPlay.ts", "role": "sink", "startLine": 135 } ], "confidence": { "level": "high", "rationale": "Producer preserves author_id while the reducer's global Map key omits it." }, "extensions": {}, "findingId": "csf_40c94234ad7f1c26e592c9b8", "fingerprints": { "algorithm": "codex-security/v1", "primary": "codex-security/v1:sha256:453e4b66813024523868694a6ea51b2d7948c85ceda20110a895465e3d26f7ae" }, "identity": { "anchor": "frontend-deduplicates-author-scoped-event-id-globally" }, "locations": [ { "endLine": 979, "path": "crates/lanspread-peer/src/call_to_play.rs", "role": "root_control", "startLine": 961 }, { "endLine": 145, "path": "crates/lanspread-tauri-deno-ts/src/lib/callToPlay.ts", "role": "sink", "startLine": 135 } ], "occurrenceId": "occ_e884be7f0807f9071e8f54ec", "provenance": { "candidateId": "cand-cross-author-event-collision", "originalCandidates": [ { "title": "Cross-author event collision" } ], "previousFindings": [], "source": "focused_investigator" }, "remediation": "Use `(author_id, event.id)` as the key for deduplication, messages, React keys, and ordering; add cross-author collision tests including collision with a creator's Create event.", "rootCause": { "evidenceRefs": [ "ctp-per-author-id", "ctp-author-preserved", "ctp-global-map" ], "summary": "The frontend treats an author-scoped random nonce as a globally unique identifier." }, "ruleId": "state-integrity.call-to-play-event-id-collision", "severity": { "changeConditions": "Impact grows if Call-to-Play state later triggers privileged actions automatically.", "level": "low", "rationale": "The attack can hide or substitute UI collaboration state but cannot forge authenticated author authority, modify files, or execute code." }, "summary": "Rust validates EventNonce uniqueness only within each authenticated author's slice, but the frontend globally deduplicates events by nonce alone, letting a hostile author overwrite another author's event in the rendered view.", "taxonomy": { "category": "state-integrity", "cwe": [ "CWE-694" ] }, "title": "Cross-author event-ID collisions can suppress Call-to-Play entries", "validation": { "assertions": [ "Hostile authors can observe shared event nonces.", "Cross-author duplicates survive Rust validation.", "Frontend Map overwrite occurs before call grouping." ], "counterEvidence": [ "Author identity is TLS-derived and preserved.", "Creator-only actions cannot be forged.", "Impact is confined to UI state." ], "disposition": "reportable", "evidenceRefs": [ "ctp-per-author-id", "ctp-author-preserved", "ctp-global-map" ], "method": "Independent static source trace against the registered revision and strongest counterevidence.", "status": "validated", "summary": "Validated. Creator-only Rust authorization remains effective, so severity is low and limited to rendered-state integrity/availability." } }, { "attackPath": { "controls": [ "64-slot hint queue", "8 concurrent pulls", "5-second per-peer coalescing", "Pinned TLS follow-up" ], "dataflow": { "evidenceRefs": [ "hint-unbound-dispatch", "hint-third-party-select", "hint-full-pull" ], "outcome": "Bandwidth and CPU amplification/availability degradation.", "sink": "Victim connector and unrelated peer's Hello responder.", "source": "Unauthenticated ChangeHint fields.", "summary": "Inbound hint -> claimed PeerId -> state-sync slot -> cached pinned endpoint -> full Hello exchange." }, "impact": { "level": "medium", "rationale": "Can consume significant bandwidth/serialization work but cannot inject authoritative state." }, "likelihood": { "level": "high", "rationale": "No credentials or target private keys are required." }, "preconditions": [ "Sharing enabled", "Victim has known peers", "Repeated forged session/revision values" ], "reachability": { "attacker": "Any reachable LAN host.", "entrypoint": "LibraryChanged or CallToPlayChanged.", "evidenceRefs": [ "hint-unbound-dispatch", "hint-third-party-select", "hint-full-pull" ], "preconditions": [ "Sharing enabled", "Victim has known peers", "Repeated forged session/revision values" ], "summary": "Direct while sharing is enabled and at least one peer is known." }, "summary": "An anonymous requester repeatedly claims stale sessions for known peers, turning the victim into a bounded proxy." }, "codeEvidence": [ { "code": "Request::LibraryChanged(hint) => {\n ctx.state_sync.schedule_hint(StateDomain::Library, hint);\n DispatchResult::close(framed_tx)\n}", "endLine": 271, "explanation": "The payload claim is accepted from any requester.", "id": "hint-unbound-dispatch", "label": "Inbound connection identity is not checked", "language": "rust", "path": "crates/lanspread-peer/src/services/stream.rs", "role": "entrypoint", "startLine": 265 }, { "code": "let snapshot = ctx.peer_liveness_for(peer_id).await;\n...\nperform_peer_refresh(ctx, snapshot).await\n...\nif snapshot.runtime_session_id != trigger.hint.runtime_session_id { return true; }", "endLine": 388, "explanation": "A random session forces a pull of the named known peer.", "id": "hint-third-party-select", "label": "Claimed ID selects cached peer", "language": "rust", "path": "crates/lanspread-peer/src/services/state_sync.rs", "role": "root_control", "startLine": 351 }, { "code": "let snapshot = exchange_hello(&ctx.quic, &endpoint, &ctx.cancellation).await?;\nlet prepared = PreparedSnapshot::prepare(endpoint.peer_id, generation, snapshot);\ncommit_prepared(ctx, endpoint, ticket, prepared).await", "endLine": 159, "explanation": "Authoritative state remains pinned, but resource work is delegated.", "id": "hint-full-pull", "label": "Reconciliation performs Hello", "language": "rust", "path": "crates/lanspread-peer/src/services/remote_state.rs", "role": "sink", "startLine": 147 } ], "confidence": { "level": "high", "rationale": "The unbound payload identity, scheduler key, mismatch decision, and full-pull sink are explicit." }, "extensions": {}, "findingId": "csf_f3f28e25fca367bd97e7cdac", "fingerprints": { "algorithm": "codex-security/v1", "primary": "codex-security/v1:sha256:c463c38e3d5499ce06d5279a12064947fd41f36deea0e7c6514b71d8077724a2" }, "identity": { "anchor": "unbound-hint-selects-third-party-pull" }, "locations": [ { "endLine": 271, "path": "crates/lanspread-peer/src/services/stream.rs", "role": "entrypoint", "startLine": 265 }, { "endLine": 388, "path": "crates/lanspread-peer/src/services/state_sync.rs", "role": "root_control", "startLine": 351 }, { "endLine": 159, "path": "crates/lanspread-peer/src/services/remote_state.rs", "role": "sink", "startLine": 147 } ], "occurrenceId": "occ_dc1e0812adfa054e42cddf8e", "provenance": { "candidateId": "cand-unauthenticated-hint-proxy", "originalCandidates": [ { "title": "Unauthenticated hint proxy" } ], "previousFindings": [], "source": "focused_investigator" }, "remediation": "If requester authentication remains absent, drop remote change hints and rely on pinned liveness reconciliation. Otherwise bind the hint to an authenticated client PeerId and remove the payload identity.", "rootCause": { "evidenceRefs": [ "hint-unbound-dispatch", "hint-third-party-select", "hint-full-pull" ], "summary": "A requester-anonymous protocol uses an untrusted claimed PeerId as a third-party work selector rather than binding or discarding hints." }, "ruleId": "resource-exhaustion.unauthenticated-state-hint-proxy", "severity": { "changeConditions": "Severity increases with large valid snapshots or metered/slow links.", "level": "medium", "rationale": "Small anonymous requests can repeatedly consume victim and third-party bandwidth/serialization CPU, but concurrency, tracked peers, and per-peer cadence are bounded." }, "summary": "Anonymous inbound connections may name any known PeerId in a change hint; a forged session/revision mismatch schedules a full pinned Hello pull to that unrelated peer.", "taxonomy": { "category": "confused-deputy", "cwe": [ "CWE-441" ] }, "title": "Unauthenticated hints can make the victim pull arbitrary known peers", "validation": { "assertions": [ "Server has no client auth.", "Claimed PeerId is the scheduler key.", "Session mismatch forces a full pull." ], "counterEvidence": [ "Hint and pinned queues are bounded/separate.", "At most eight pulls run concurrently.", "Each peer is coalesced to one pull per five seconds.", "Pulled state is TLS pinned." ], "disposition": "reportable", "evidenceRefs": [ "hint-unbound-dispatch", "hint-third-party-select", "hint-full-pull" ], "method": "Independent static source trace against the registered revision and strongest counterevidence.", "status": "validated", "summary": "Validated. State integrity remains protected by the pinned pull, while resource consumption is the concrete impact." } }, { "attackPath": { "controls": [ "64 active/recent cap", "5-second cooldown", "Pinned TLS before commit" ], "dataflow": { "evidenceRefs": [ "mdns-candidate-cap", "mdns-preauth-admission", "mdns-full-drop" ], "outcome": "Legitimate new peers are not discovered.", "sink": "Discovery candidate capacity.", "source": "Attacker-controlled multicast advertisements.", "summary": "mDNS TXT/address -> PeerEndpoint -> active candidate set -> pinned negotiation -> failure/repeat." }, "impact": { "level": "medium", "rationale": "New peer discovery is denied; existing state and content remain protected." }, "likelihood": { "level": "high", "rationale": "Only forged advertisements are required." }, "preconditions": [ "Discovery enabled", "Ability to advertise 64 unique records continuously" ], "reachability": { "attacker": "Hostile LAN participant.", "entrypoint": "mDNS browser service observations.", "evidenceRefs": [ "mdns-candidate-cap", "mdns-preauth-admission", "mdns-full-drop" ], "preconditions": [ "Discovery enabled", "Ability to advertise 64 unique records continuously" ], "summary": "Same multicast LAN while discovery is enabled." }, "summary": "Forged unique mDNS records occupy all pre-auth negotiations and are replenished as they fail." }, "codeEvidence": [ { "code": "const MAX_ACTIVE_DISCOVERY_CANDIDATES: usize = 64;\n...\nendpoint.peer_id == candidate.peer_id || endpoint.addr == candidate.addr\n...\n|| self.entries.len() >= MAX_ACTIVE_DISCOVERY_CANDIDATES", "endLine": 50, "explanation": "Distinct IDs and ports from one host fill the entire budget.", "id": "mdns-candidate-cap", "label": "Attacker controls both uniqueness keys", "language": "rust", "path": "crates/lanspread-peer/src/services/discovery.rs", "role": "root_control", "startLine": 30 }, { "code": "if let Some(endpoint) = validated_candidate_endpoint(&info) {\n ...\n let handshake = ReservedCandidateHandshake::reserve(handshake_ctx, endpoint).await?;\n active_candidates.insert(endpoint);\n negotiations.push(run_protocol_negotiation(...));\n}", "endLine": 259, "explanation": "TLS proof happens after the slot is occupied.", "id": "mdns-preauth-admission", "label": "Work starts from claimed fields", "language": "rust", "path": "crates/lanspread-peer/src/services/discovery.rs", "role": "entrypoint", "startLine": 233 }, { "code": "active.len() < MAX_ACTIVE_DISCOVERY_CANDIDATES\n && !candidate_conflicts(active, candidate)\n && recent.try_record(candidate, now)", "endLine": 309, "explanation": "No fair queue or per-origin reserve remains for legitimate candidates.", "id": "mdns-full-drop", "label": "Full set drops every later candidate", "language": "rust", "path": "crates/lanspread-peer/src/services/discovery.rs", "role": "sink", "startLine": 300 } ], "confidence": { "level": "high", "rationale": "Pre-auth admission, full-set rejection, and uniqueness keys are explicit." }, "extensions": {}, "findingId": "csf_a8fd48f15b36d21c1eae743b", "fingerprints": { "algorithm": "codex-security/v1", "primary": "codex-security/v1:sha256:3354152dfaef2ebe80ded38bcc4d7469856a92511d005d07d97fb1fe3046376b" }, "identity": { "anchor": "preauth-mdns-candidates-fill-all-negotiation-slots" }, "locations": [ { "endLine": 50, "path": "crates/lanspread-peer/src/services/discovery.rs", "role": "root_control", "startLine": 30 }, { "endLine": 259, "path": "crates/lanspread-peer/src/services/discovery.rs", "role": "entrypoint", "startLine": 233 }, { "endLine": 309, "path": "crates/lanspread-peer/src/services/discovery.rs", "role": "sink", "startLine": 294 } ], "occurrenceId": "occ_f3586624a8d633db89a319d4", "provenance": { "candidateId": "cand-mdns-discovery-monopoly", "originalCandidates": [ { "title": "mDNS candidate monopoly" } ], "previousFindings": [], "source": "focused_investigator" }, "remediation": "Add per-source-IP quotas, preserve capacity across origins/known peers, and use fair/randomized replacement or a cheap proof-of-key before the longer negotiation slot.", "rootCause": { "evidenceRefs": [ "mdns-candidate-cap", "mdns-preauth-admission", "mdns-full-drop" ], "summary": "First-come discovery capacity is keyed only by unauthenticated claimed PeerId and full socket address, with no origin fairness." }, "ruleId": "resource-exhaustion.mdns-candidate-monopoly", "severity": { "changeConditions": "Severity rises if discovery is the only operational path and attacks persist throughout events.", "level": "low", "rationale": "The attack suppresses discovery of new peers but is same-LAN, requires sustained advertisements, and cannot commit state or affect already known authenticated peers." }, "summary": "Sixty-four unique attacker-controlled PeerId/address hints occupy every active and recent candidate slot before TLS proof, causing legitimate new candidates to be dropped while the attacker rotates records.", "taxonomy": { "category": "resource-exhaustion", "cwe": [ "CWE-400" ] }, "title": "Forged mDNS candidates can monopolize discovery slots", "validation": { "assertions": [ "No private key is required to occupy a slot until handshake fails.", "All later candidates are rejected at 64 active entries.", "An attacker can rotate IDs/ports after deadlines." ], "counterEvidence": [ "Work is capped and timed.", "Duplicate IDs/addresses coalesce.", "No state commits without pinned TLS." ], "disposition": "reportable", "evidenceRefs": [ "mdns-candidate-cap", "mdns-preauth-admission", "mdns-full-drop" ], "method": "Independent static source trace against the registered revision and strongest counterevidence.", "status": "validated", "summary": "Validated with low severity. The candidate cap protects memory but not fair availability." } }, { "attackPath": { "controls": [ "Link/reparse rejection", "Special-file filtering", "Per-ID rescan coalescing", "Missed-tick skipping" ], "dataflow": { "evidenceRefs": [ "local-all-root-entries", "local-task-per-id", "local-index-whole-read", "legacy-whole-read" ], "outcome": "Persistent CPU/memory exhaustion or startup OOM.", "sink": "Desktop heap, blocking pool, async task set, and log file.", "source": "Locally or share-writable selected game directory and persisted index files.", "summary": "Selected filesystem -> root snapshot/WalkDir/whole-file read -> task set/heap/logs." }, "impact": { "level": "medium", "rationale": "Can stall or terminate the peer but does not grant file escape or code execution." }, "likelihood": { "level": "low", "rationale": "Requires local/shared filesystem placement and user selection." }, "preconditions": [ "Attacker-controlled directory contents", "Victim selects/restores directory" ], "reachability": { "attacker": "Lower-privileged local/shared-filesystem actor.", "entrypoint": "Game-directory activation and one-second local monitor.", "evidenceRefs": [ "local-all-root-entries", "local-task-per-id", "local-index-whole-read", "legacy-whole-read" ], "preconditions": [ "Attacker-controlled directory contents", "Victim selects/restores directory" ], "summary": "Requires the operator to select or restore an attacker-influenced directory." }, "summary": "A crafted selected directory or state file supplies extreme cardinality/depth/size, which periodic monitoring or startup migration consumes." }, "codeEvidence": [ { "code": "let mut games = BTreeMap::new();\nfor entry in fs::read_dir(game_dir) {\n ...\n games.insert(id.to_owned(), game_root);\n}", "endLine": 235, "explanation": "No catalog intersection or entry cap precedes retention.", "id": "local-all-root-entries", "label": "Every root name enters the snapshot", "language": "rust", "path": "crates/lanspread-peer/src/services/local_monitor.rs", "role": "entrypoint", "startLine": 200 }, { "code": "for id in ready_ids {\n queue_rescan(ctx, tx_notify_ui, gate, rescans, id).await;\n}\n...\nrescans.spawn(async move { run_gated_rescan(...).await; });", "endLine": 376, "explanation": "Only duplicate work for the same ID coalesces; no global worker cap applies.", "id": "local-task-per-id", "label": "Every changed ID spawns a task", "language": "rust", "path": "crates/lanspread-peer/src/services/local_monitor.rs", "role": "sink", "startLine": 329 }, { "code": "let data = match std::fs::read_to_string(path) { ... };\nmatch serde_json::from_str(&data) { ... }", "endLine": 284, "explanation": "A tampered app-state file can allocate arbitrarily.", "id": "local-index-whole-read", "label": "Current index is read without a byte cap", "language": "rust", "path": "crates/lanspread-peer/src/local_games.rs", "role": "evidence", "startLine": 268 }, { "code": "let data = fs::read(legacy_path)?;\nwrite_bytes_atomically(target_path, &data)?;\nremove_file_if_exists(legacy_path)?;", "endLine": 297, "explanation": "Selection automatically crosses this legacy input boundary.", "id": "legacy-whole-read", "label": "Legacy migration duplicates an unbounded file", "language": "rust", "path": "crates/lanspread-peer/src/migration.rs", "role": "evidence", "startLine": 284 } ], "confidence": { "level": "high", "rationale": "Unbounded enumeration, task spawn, WalkDir traversal, and whole-file reads are explicit." }, "extensions": {}, "findingId": "csf_b4156302e37bcb0e5a87f4af", "fingerprints": { "algorithm": "codex-security/v1", "primary": "codex-security/v1:sha256:57f045ce125ace9a603ada98f96c92eb5c248a29cbe75d763ea9ee8beaccc919" }, "identity": { "anchor": "selected-game-root-ingestion-lacks-aggregate-budgets" }, "locations": [ { "endLine": 235, "path": "crates/lanspread-peer/src/services/local_monitor.rs", "role": "entrypoint", "startLine": 200 }, { "endLine": 376, "path": "crates/lanspread-peer/src/services/local_monitor.rs", "role": "sink", "startLine": 329 }, { "endLine": 294, "path": "crates/lanspread-peer/src/local_games.rs", "role": "sink", "startLine": 268 }, { "endLine": 297, "path": "crates/lanspread-peer/src/migration.rs", "role": "sink", "startLine": 284 } ], "occurrenceId": "occ_396ac8c331a26fedd06ad199", "provenance": { "candidateId": "cand-local-library-budget", "originalCandidates": [ { "title": "Local-library ingestion budgets" } ], "previousFindings": [], "source": "focused_investigator" }, "remediation": "Intersect names with the catalog before retention/task admission; add root/per-game/depth/metadata budgets and a bounded rescan pool; bounded-read current and legacy indexes/version.ini and avoid raw invalid-content logging.", "rootCause": { "evidenceRefs": [ "local-all-root-entries", "local-task-per-id", "local-index-whole-read", "legacy-whole-read" ], "summary": "Local filesystem inputs have shape/link checks but no aggregate cardinality, traversal, task, or persisted-file byte budgets." }, "ruleId": "resource-exhaustion.local-library-ingestion", "severity": { "changeConditions": "Severity increases when selected game roots are writable by lower-privileged or remote filesystem users.", "level": "low", "rationale": "The desktop can be exhausted, but the attacker needs local/shared/removable-directory control plus operator selection; remote peers cannot create this fan-out." }, "summary": "The continuously monitored game root retains every top-level name, spawns one task per changed ID, recursively walks trees, and reads current/legacy state files without byte budgets.", "taxonomy": { "category": "resource-exhaustion", "cwe": [ "CWE-400" ] }, "title": "Selected game directories can trigger unbounded monitoring and migration work", "validation": { "assertions": [ "Polling occurs every second.", "All root names are retained before catalog filtering.", "Per-ID task fan-out is not globally bounded.", "Index/migration reads allocate complete files." ], "counterEvidence": [ "Symlinks/reparse points and special files are rejected.", "Repeated work for one ID coalesces.", "Remote catalog downloads cannot create arbitrary top-level entries." ], "disposition": "reportable", "evidenceRefs": [ "local-all-root-entries", "local-task-per-id", "local-index-whole-read", "legacy-whole-read" ], "method": "Independent static source trace against the registered revision and strongest counterevidence.", "status": "validated", "summary": "Validated and merged with the legacy-index candidate. Severity is low because meaningful influence is local/shared-root rather than ordinary LAN peer input." } }, { "attackPath": { "controls": [ "Safe argv handling inside Rust publisher", "Benign defaults" ], "dataflow": { "evidenceRefs": [ "just-raw-games-dir", "just-raw-fixture-args", "just-raw-production-args" ], "outcome": "Arbitrary command execution and catalog/build compromise.", "sink": "Catalog/build shell with operator privileges.", "source": "Operator-supplied recipe values.", "summary": "just argument/environment -> `{{...}}` template -> bash recipe text -> command substitution/quote break -> arbitrary command." }, "impact": { "level": "high", "rationale": "Build secrets and trusted catalog/bundle inputs can be modified or exfiltrated." }, "likelihood": { "level": "medium", "rationale": "Documented commands accept paths, but operators often choose them themselves." }, "preconditions": [ "Attacker-influenced just argument or LANSPREAD_UNRAR/GAMES_DIR", "Operator executes recipe" ], "reachability": { "attacker": "Package/path supplier or CI input actor.", "entrypoint": "catalog/build/run just recipes.", "evidenceRefs": [ "just-raw-games-dir", "just-raw-fixture-args", "just-raw-production-args" ], "preconditions": [ "Attacker-influenced just argument or LANSPREAD_UNRAR/GAMES_DIR", "Operator executes recipe" ], "summary": "Conditional on an operator or CI passing an attacker-influenced value." }, "summary": "A crafted path/selector/env value containing shell syntax is supplied to a documented recipe and evaluated by bash." }, "codeEvidence": [ { "code": "default:\n #!/usr/bin/env bash\n if [ -n \"{{GAMES_DIR}}\" ]; then\n just run-production \"{{GAMES_DIR}}\"\n else\n just run-fixture\n fi", "endLine": 31, "explanation": "Double quotes do not prevent shell command substitution after just renders the recipe.", "id": "just-raw-games-dir", "label": "GAMES_DIR is embedded in shell text", "language": "text", "path": "justfile", "role": "root_control", "startLine": 22 }, { "code": "catalog-generate-fixture OUTPUT GAME_ROOT GAME_ID:\n cargo run ... --output \"{{OUTPUT}}\" --game-root \"{{GAME_ROOT}}\" --game-id \"{{GAME_ID}}\" --unrar \"{{CATALOG_UNRAR}}\"", "endLine": 118, "explanation": "Quote-breaking or `$()` reaches the recipe shell before the CLI.", "id": "just-raw-fixture-args", "label": "Fixture parameters are embedded directly", "language": "text", "path": "justfile", "role": "evidence", "startLine": 105 }, { "code": "catalog-generate-production PACKAGES_DIR:\n #!/usr/bin/env bash\n if ... --packages-dir \"{{PACKAGES_DIR}}\" ... --unrar \"{{CATALOG_UNRAR}}\"; then ... fi", "endLine": 170, "explanation": "All cache/publisher invocations share the injection surface.", "id": "just-raw-production-args", "label": "Production values repeat across a shell conditional", "language": "text", "path": "justfile", "role": "sink", "startLine": 140 } ], "confidence": { "level": "high", "rationale": "The raw templates and a harmless `just --dry-run` with literal command-substitution syntax confirm the rendered shell grammar." }, "extensions": {}, "findingId": "csf_52309c6d49d62ae81258872c", "fingerprints": { "algorithm": "codex-security/v1", "primary": "codex-security/v1:sha256:612aaf874e672716f24d57db2b8b5793bf29242580683c9009791017da66b81c" }, "identity": { "anchor": "just-arguments-rendered-as-shell-source" }, "locations": [ { "endLine": 49, "path": "justfile", "role": "root_control", "startLine": 22 }, { "endLine": 118, "path": "justfile", "role": "sink", "startLine": 105 }, { "endLine": 170, "path": "justfile", "role": "sink", "startLine": 140 } ], "occurrenceId": "occ_9293ad354e62522b50537a56", "provenance": { "candidateId": "cand-justfile-shell-interpolation", "originalCandidates": [ { "title": "justfile shell interpolation" } ], "previousFindings": [], "source": "focused_investigator" }, "remediation": "Pass data through environment/argv to non-shell helpers or apply just's correct shell-quoting facility to every argument and environment-derived value; test `$()`, quotes, whitespace, leading dashes, and newlines.", "rootCause": { "evidenceRefs": [ "just-raw-games-dir", "just-raw-fixture-args", "just-raw-production-args" ], "summary": "just template interpolation is used as shell quoting even though interpolation happens before shell parsing." }, "ruleId": "command-injection.justfile-interpolation", "severity": { "changeConditions": "Severity increases in automated CI or workflows that pass externally supplied paths/IDs directly to just.", "level": "medium", "rationale": "Successful exploitation executes with catalog/build operator authority, but requires attacker influence over an operator-supplied recipe argument or environment value." }, "summary": "Documented just recipes embed path, selector, output, and environment-derived values directly into shell source; command substitution and quote-breaking run before Rust/Python argv parsing.", "taxonomy": { "category": "command-injection", "cwe": [ "CWE-78" ] }, "title": "Catalog/build recipe arguments are interpolated as shell code", "validation": { "assertions": [ "Arguments are rendered into recipe source.", "The shell parses command substitution inside double quotes.", "Rust subprocess construction is safe but occurs after this boundary." ], "counterEvidence": [ "Checked-in defaults and ordinary absolute paths are benign.", "Exploitation needs attacker influence over operator arguments/environment, not merely package filenames." ], "disposition": "reportable", "evidenceRefs": [ "just-raw-games-dir", "just-raw-fixture-args", "just-raw-production-args" ], "method": "Independent static source trace against the registered revision and strongest counterevidence.", "status": "validated", "summary": "Validated. `just --dry-run catalog-generate-production '$(printf SAFE_DRY_RUN_MARKER)'` preserved `$()` inside the rendered shell command; an actual shell would evaluate it." } }, { "attackPath": { "controls": [ "64 KiB version limit", "Final-component link/reparse check", "Unix inode/device comparison", "Later root validation" ], "dataflow": { "evidenceRefs": [ "publisher-preflight-order", "publisher-content-error", "publisher-windows-identity" ], "outcome": "Bounded out-of-root disclosure; Windows hash path may expose a digest oracle.", "sink": "Publisher memory and stderr/CI log.", "source": "Attacker-controlled package tree links/races.", "summary": "packages_dir/game_id path -> joined version.ini -> path-based lstat/open -> UTF-8 contents -> error log." }, "impact": { "level": "medium", "rationale": "Can expose bounded sensitive content but cannot publish a stable linked package." }, "likelihood": { "level": "low", "rationale": "Requires specially placed links or a filesystem race and often log visibility." }, "preconditions": [ "Readable target named version.ini or race target", "Access to resulting diagnostics for disclosure" ], "reachability": { "attacker": "Package-corpus supplier or concurrent local process.", "entrypoint": "Catalog generation version preflight.", "evidenceRefs": [ "publisher-preflight-order", "publisher-content-error", "publisher-windows-identity" ], "preconditions": [ "Readable target named version.ini or race target", "Access to resulting diagnostics for disclosure" ], "summary": "Requires publisher execution on an attacker-controlled package tree; Windows race is platform-specific." }, "summary": "A package supplier points a selected game root outside the corpus or races a Windows file after lstat so publisher reads a different target." }, "codeEvidence": [ { "code": "for game in &selected {\n package::validate_package_version(\n &options.packages_dir.join(&game.game_id),\n &game.game_version,\n )?;\n}", "endLine": 130, "explanation": "The later manifest builder's non-link directory validation has not run.", "id": "publisher-preflight-order", "label": "Version read precedes root validation", "language": "rust", "path": "crates/lanspread-compat/src/catalog_publisher/mod.rs", "role": "root_control", "startLine": 120 }, { "code": "let path = package_root.join(\"version.ini\");\nlet bytes = read_bounded_regular_file(&path, MAX_VERSION_INI_BYTES)?;\nlet version = std::str::from_utf8(&bytes)?.trim();\nif version != expected {\n eyre::bail!(\"... version.ini contains {version:?}\");\n}", "endLine": 137, "explanation": "Ancestor links are followed by the path open; mismatching content reaches stderr.", "id": "publisher-content-error", "label": "Out-of-root bytes are echoed on mismatch", "language": "rust", "path": "crates/lanspread-compat/src/catalog_publisher/package.rs", "role": "sink", "startLine": 125 }, { "code": "#[cfg(not(unix))]\nfn same_file(_before: &fs::Metadata, _after: &fs::Metadata) -> bool {\n true\n}\n...\n#[cfg(windows)]\nfn is_link_or_reparse(metadata: &fs::Metadata) -> bool { ... }", "endLine": 425, "explanation": "The pre-open reparse check is not bound to the opened handle on Windows.", "id": "publisher-windows-identity", "label": "Windows accepts every check/open identity", "language": "rust", "path": "crates/lanspread-compat/src/catalog_publisher/package.rs", "role": "root_control", "startLine": 403 } ], "confidence": { "level": "high", "rationale": "Ordering, whole diagnostic, and non-Unix `same_file=true` are explicit." }, "extensions": {}, "findingId": "csf_5079213437e3f254ae70f2ca", "fingerprints": { "algorithm": "codex-security/v1", "primary": "codex-security/v1:sha256:a4df8ff5972c151be57355357b646ab9cd4276992c8021cc8257d35d60a9f80a" }, "identity": { "anchor": "package-preflight-not-rooted-to-nofollow-handle" }, "locations": [ { "endLine": 130, "path": "crates/lanspread-compat/src/catalog_publisher/mod.rs", "role": "root_control", "startLine": 120 }, { "endLine": 137, "path": "crates/lanspread-compat/src/catalog_publisher/package.rs", "role": "sink", "startLine": 125 }, { "endLine": 425, "path": "crates/lanspread-compat/src/catalog_publisher/package.rs", "role": "root_control", "startLine": 403 } ], "occurrenceId": "occ_97c865ee39aa6ae912efe24f", "provenance": { "candidateId": "cand-package-root-link-preflight", "originalCandidates": [ { "title": "Publisher link preflight" } ], "previousFindings": [], "source": "focused_investigator" }, "remediation": "Open the packages/game roots through retained no-follow handles and open `version.ini` relative to them; implement Windows file-ID/reparse-safe identity checks; never print raw untrusted version contents.", "rootCause": { "evidenceRefs": [ "publisher-preflight-order", "publisher-content-error", "publisher-windows-identity" ], "summary": "Package reads are path-based rather than rooted in retained no-follow directory handles, and cross-platform object identity is not enforced." }, "ruleId": "path-traversal.catalog-preflight-links", "severity": { "changeConditions": "Severity increases when publisher logs are visible to package suppliers or the build account has sensitive readable version.ini files.", "level": "low", "rationale": "The read is bounded and publication later fails; disclosure requires package-tree control and access to operator/CI diagnostics, with Windows race prerequisites for the TOCTOU variant." }, "summary": "Version preflight joins `package_root/version.ini` before validating the game root, and Windows disables file-identity comparison, allowing ancestor-link traversal or a raced reparse target to be read and echoed.", "taxonomy": { "category": "path-traversal", "cwe": [ "CWE-59", "CWE-367" ] }, "title": "Catalog preflight can read outside the package root through links and Windows races", "validation": { "assertions": [ "Ancestor symlink validation is absent before preflight.", "Final-component checks do not prove ancestor confinement.", "Windows same_file unconditionally succeeds.", "Mismatch errors include contents." ], "counterEvidence": [ "Stable final-component links/reparse points are rejected.", "Read is capped at 64 KiB.", "Later manifest building rejects a stable linked root.", "Unix final-component swaps are device/inode checked." ], "disposition": "reportable", "evidenceRefs": [ "publisher-preflight-order", "publisher-content-error", "publisher-windows-identity" ], "method": "Independent static source trace against the registered revision and strongest counterevidence.", "status": "validated", "summary": "Validated and merged with the Windows TOCTOU candidate. Publication fail-closed behavior limits the impact to bounded disclosure/digest-oracle and provenance violation." } }, { "attackPath": { "controls": [ "Catalog validation for downloaded files", "Fixed unrar executable/argv", "Transactional staging", "Link/reparse rejection" ], "dataflow": { "evidenceRefs": [ "eti-all-root-files", "eti-promote-unverified", "eti-native-extract" ], "outcome": "Uncatalogued installed bytes and decompression resource exhaustion.", "sink": "Installed `local/` tree and native extraction resources.", "source": "Locally/shared-root controlled regular `.eti` file.", "summary": "Selected game root files -> extension enumeration -> native unrar -> staging -> local promotion." }, "impact": { "level": "medium", "rationale": "Installed content integrity and host availability are affected; direct remote or outside-root write is not established." }, "likelihood": { "level": "medium", "rationale": "Requires local/shared-directory placement but extraction is deterministic after user action." }, "preconditions": [ "Catalog game root with version.ini", "Attacker-controlled extra `.eti`", "Victim install/update" ], "reachability": { "attacker": "Local/shared-filesystem actor.", "entrypoint": "InstallGame/Update path after catalog ID and version sentinel checks.", "evidenceRefs": [ "eti-all-root-files", "eti-promote-unverified", "eti-native-extract" ], "preconditions": [ "Catalog game root with version.ini", "Attacker-controlled extra `.eti`", "Victim install/update" ], "summary": "Requires write influence over the selected game root and local install/update action." }, "summary": "A crafted unknown `.eti` is placed beside an otherwise catalog game; the victim invokes install/update; all archives are extracted and promoted." }, "codeEvidence": [ { "code": "let archives = root_eti_archives(game_root)?;\n...\nfor archive in archives {\n unpacker.unpack(&archive, staging, cancel_token.clone()).await?;\n}\n...\nif path.extension().is_some_and(|extension| extension == \"eti\") {\n archives.push(path);\n}", "endLine": 562, "explanation": "No local manifest archive-set, size, or digest check precedes native parsing.", "id": "eti-all-root-files", "label": "Every root `.eti` is selected", "language": "rust", "path": "crates/lanspread-peer/src/install/transaction.rs", "role": "root_control", "startLine": 514 }, { "code": "prepare_owned_empty_dir(&staging)?;\nunpack_archives(game_root, &staging, unpacker, cancel_token).await?;\nrename_path(&staging, &local)?;", "endLine": 468, "explanation": "Ordinary install does not receive or verify the catalog's extracted-output manifest.", "id": "eti-promote-unverified", "label": "Staging is promoted after extractor success only", "language": "rust", "path": "crates/lanspread-peer/src/install/transaction.rs", "role": "evidence", "startLine": 449 }, { "code": "ScopedProcess::spawn(\n program,\n [\"x\", \"-p-\", paths.archive.as_os_str(), \"-y\", \"-o\", &paths.destination_arg],\n ®istration.cancel_token(),\n UNRAR_LOG_CAPTURE_LIMIT,\n)", "endLine": 3206, "explanation": "The executable is fixed, but archive bytes and decompression cost cross a native parser boundary.", "id": "eti-native-extract", "label": "Tauri runs native extraction into staging", "language": "rust", "path": "crates/lanspread-tauri-deno-ts/src-tauri/src/lib.rs", "role": "sink", "startLine": 3195 } ], "confidence": { "level": "high", "rationale": "Archive enumeration, extraction loop, promotion, and absence of a manifest argument/check are explicit." }, "extensions": {}, "findingId": "csf_2e096654b094e0fac1b124cd", "fingerprints": { "algorithm": "codex-security/v1", "primary": "codex-security/v1:sha256:effedb3e055f82da4175c26119809a0af75499bf7de3c2418c62b0b4ef3e0777" }, "identity": { "anchor": "ordinary-install-extracts-all-root-eti-files" }, "locations": [ { "endLine": 562, "path": "crates/lanspread-peer/src/install/transaction.rs", "role": "root_control", "startLine": 449 }, { "endLine": 3206, "path": "crates/lanspread-tauri-deno-ts/src-tauri/src/lib.rs", "role": "sink", "startLine": 3195 }, { "endLine": 1488, "path": "crates/lanspread-peer/src/handlers.rs", "role": "entrypoint", "startLine": 1443 } ], "occurrenceId": "occ_4db1454c427333bbd2c39100", "provenance": { "candidateId": "cand-ordinary-install-uncatalogued-eti", "originalCandidates": [ { "title": "Uncatalogued ETI extraction" } ], "previousFindings": [], "source": "focused_investigator" }, "remediation": "Pass the exact catalog manifest into install/update; require the exact root archive set and verify each archive size/BLAKE3 through no-follow handles; verify every extracted path/kind/size/digest before promotion; enforce entry/decompressed-byte/total deadlines.", "rootCause": { "evidenceRefs": [ "eti-all-root-files", "eti-promote-unverified", "eti-native-extract" ], "summary": "The ordinary install path predates the catalog-owned archive/output contract used by Stream Install and treats filename extension plus extractor success as content authority." }, "ruleId": "integrity.ordinary-install-uncatalogued-archive", "severity": { "changeConditions": "Severity increases if unverified extracted binaries are later executed by elevated catalog scripts or if the selected game directory is remotely writable.", "level": "medium", "rationale": "A crafted selected/shared game root can bypass installed-content integrity and exhaust disk/CPU; exploitation needs local/shared-root influence and a user install/update action." }, "summary": "Install/update enumerates every root regular `.eti` file\u2014including unknown files deliberately preserved beside downloads\u2014runs native extraction for each, and promotes the staging tree without comparing the archive set or extracted output to the local catalog.", "taxonomy": { "category": "content-integrity", "cwe": [ "CWE-494", "CWE-400" ] }, "title": "Ordinary install extracts uncatalogued root archives without output verification", "validation": { "assertions": [ "Install admission can proceed with an untracked but sentinel-bearing root.", "Every root `.eti` is extracted.", "No extracted-output verification occurs before promotion." ], "counterEvidence": [ "Catalog-downloaded archive bytes are chunk-hash verified.", "Symlink/reparse roots are rejected.", "The sidecar path and argv grammar are fixed.", "Outside-root archive behavior of opaque unrar was not claimed." ], "disposition": "reportable", "evidenceRefs": [ "eti-all-root-files", "eti-promote-unverified", "eti-native-extract" ], "method": "Independent static source trace against the registered revision and strongest counterevidence.", "status": "validated", "summary": "Validated. Remote downloads cannot add unknown files, but the selected/shared filesystem is an explicit untrusted boundary and unknown files are preserved by download ownership." } }, { "attackPath": { "controls": [ "4096-event limit", "4 MiB author snapshot limit", "retention windows" ], "dataflow": { "evidenceRefs": [ "ctp-render-event-cap", "ctp-render-clock", "ctp-render-all-rows" ], "outcome": "Unresponsive launcher.", "sink": "Main renderer CPU, heap, and DOM.", "source": "Attacker-controlled valid Create events.", "summary": "Pinned author snapshot -> Rust CallToPlayView -> reducer -> one-second recomputation -> full ticker/overlay render." }, "impact": { "level": "medium", "rationale": "UI availability can be lost without native compromise." }, "likelihood": { "level": "high", "rationale": "One attacker identity can generate the valid event set." }, "reachability": { "attacker": "Authenticated hostile LAN peer.", "entrypoint": "HelloSnapshot Call-to-Play slice.", "evidenceRefs": [ "ctp-render-event-cap" ], "preconditions": [ "Sharing enabled", "Valid 4096-event author snapshot" ], "summary": "Requires one connected hostile peer while sharing is enabled; no local click is needed after synchronization." }, "summary": "A hostile peer publishes a maximal valid active-call slice that drives repeated full reduction and DOM reconciliation." }, "codeEvidence": [ { "code": "pub const MAX_CALL_TO_PLAY_EVENTS_PER_AUTHOR: usize = 4_096;\npub const MAX_CALL_TO_PLAY_AUTHOR_SNAPSHOT_BYTES: usize = 4 * 1024 * 1024;", "endLine": 20, "explanation": "The wire cap is not a smaller semantic active-call/display cap.", "id": "ctp-render-event-cap", "label": "A single author may publish 4096 events", "language": "rust", "path": "crates/lanspread-proto/src/lib.rs", "role": "source", "startLine": 17 }, { "code": "const timer = window.setInterval(() => {\n setNow(Date.now());\n}, 1_000);", "endLine": 72, "explanation": "`now` is a dependency of the complete call reduction.", "id": "ctp-render-clock", "label": "Full reduction reruns each second", "language": "typescript", "path": "crates/lanspread-tauri-deno-ts/src/hooks/useCallToPlay.ts", "role": "root_control", "startLine": 68 }, { "code": "const rows = nominations.map(nomination => ({ nomination, status: tickerStatusOf(nomination, now) })).sort(...);\n...\n{rows.map(({ nomination, status }) => {", "endLine": 94, "explanation": "There is no pagination, virtualization, or visible-row cap in the always-mounted ticker.", "id": "ctp-render-all-rows", "label": "Ticker renders every nomination", "language": "typescript", "path": "crates/lanspread-tauri-deno-ts/src/components/calltoplay/CallToPlayTicker.tsx", "role": "sink", "startLine": 80 } ], "confidence": { "level": "high", "rationale": "The semantic validation, one-second recomputation, and full list rendering are explicit." }, "extensions": {}, "findingId": "csf_a094c3abe43e8a361f0e7f84", "fingerprints": { "algorithm": "codex-security/v1", "primary": "codex-security/v1:sha256:0720a2a98628af9fcddc5bcbaffb29db6a8dbaef7bf4b32bdd6eb76635d7ced9" }, "identity": { "anchor": "maximal-active-calls-rendered-every-second" }, "locations": [ { "endLine": 20, "path": "crates/lanspread-proto/src/lib.rs", "role": "root_control", "startLine": 17 }, { "endLine": 72, "path": "crates/lanspread-tauri-deno-ts/src/hooks/useCallToPlay.ts", "role": "root_control", "startLine": 68 }, { "endLine": 154, "path": "crates/lanspread-tauri-deno-ts/src/components/calltoplay/CallToPlayTicker.tsx", "role": "sink", "startLine": 80 } ], "occurrenceId": "occ_83d9017253563f8852490859", "provenance": { "candidateId": "cand-ctp-active-call-rendering", "originalCandidates": [ { "attacker": "One hostile authenticated LAN peer.", "confidence": "high", "cwe": "CWE-400", "impact": "UI CPU/memory exhaustion and an unusable desktop renderer.", "locations": [ "proto/lib.rs:17-20", "call_to_play.rs:944-1039", "frontend callToPlay.ts:125-146", "useCallToPlay.ts:68-72,248-250", "CallToPlayTicker.tsx:80-154", "CallToPlayOverlay.tsx:38-95", "NominationCard.tsx:139-247" ], "severity": "medium", "source_to_sink": "A valid 4,096-event author slice can contain thousands of active Create roots; the frontend reduces/sorts the full set every second and renders every nomination in the always-mounted ticker and overlay.", "title": "A hostile peer can force continuous rendering of thousands of active Call-to-Play entries" } ], "previousFindings": [], "source": "focused_investigator" }, "remediation": "Enforce small per-author/global active-call caps before publication, render only a ranked ticker subset, virtualize/paginate the overlay, and avoid recomputing unchanged projections on every clock tick.", "rootCause": { "evidenceRefs": [ "ctp-render-event-cap", "ctp-render-clock", "ctp-render-all-rows" ], "summary": "Wire-level event/byte limits are used as the only semantic and rendering budget; active roots and DOM rows have no smaller cap." }, "ruleId": "resource-exhaustion.call-to-play-rendering", "severity": { "level": "medium", "rationale": "One authenticated LAN peer can freeze the renderer without further user interaction, but protocol byte/event limits bound the state." }, "summary": "A valid 4,096-event author slice can contain thousands of simultaneous Create roots; the frontend reduces and sorts the full set every second and renders every nomination in the always-mounted ticker.", "taxonomy": { "category": "resource-exhaustion", "cwe": [ "CWE-400" ] }, "title": "One peer can force continuous rendering of thousands of active calls", "validation": { "assertions": [ "4096 valid Create events can represent 4096 active calls.", "Full reduction reruns each second.", "All nominations are rendered." ], "counterEvidence": [ "Snapshot size and event count are finite.", "Expired/terminal retention exists.", "Per-card participant count is bounded." ], "disposition": "reportable", "evidenceRefs": [ "ctp-render-event-cap", "ctp-render-clock", "ctp-render-all-rows" ], "method": "Static source trace of maximal valid author state through the Rust projection and frontend render loop.", "status": "validated", "summary": "Validated as distinct from aggregate Sybil retention: one identity and one maximal valid slice are sufficient." } }, { "attackPath": { "controls": [ "64-peer cap", "one attempt per identity", "integrity quarantine", "user cancellation" ], "dataflow": { "evidenceRefs": [ "retry-all-identities", "retry-transport-requeues", "retry-ten-minute-attempt" ], "outcome": "Multi-hour denial of a game download.", "sink": "Active download transaction, preallocated storage, and network tasks.", "source": "Attacker-controlled PeerIds/endpoints.", "summary": "Sybil availability claims -> exact-content source vector -> sequential retry batches -> fresh ten-minute deadline per identity." }, "impact": { "level": "medium", "rationale": "One game operation can be held for many hours and consumes resources." }, "likelihood": { "level": "medium", "rationale": "Requires many identities plus a local user-started download." }, "reachability": { "attacker": "Malicious same-LAN host.", "entrypoint": "Remote library snapshots and ordinary chunk transport.", "evidenceRefs": [ "retry-all-identities" ], "preconditions": [ "User starts download", "Up to 64 Sybil peers claim exact ContentId", "Sources stall/fail transport" ], "summary": "Requires a user-started download and many authenticated Sybil sources claiming the expected local catalog ContentId." }, "summary": "One host advertises the exact ContentId under many identities and stalls each sequential chunk attempt." }, "codeEvidence": [ { "code": "/// Retries failed chunks against every eligible, nonquarantined peer identity.\n/// Each source is attempted at most once per chunk. There is no numeric retry cap.\n...\nwhile !queue.is_empty() { ... }", "endLine": 327, "explanation": "Identity multiplicity directly controls total operation duration.", "id": "retry-all-identities", "label": "Retries exhaust the complete source set", "language": "rust", "path": "crates/lanspread-peer/src/download/retry.rs", "role": "root_control", "startLine": 294 }, { "code": "match kind {\n DownloadTransferErrorKind::Integrity | DownloadTransferErrorKind::Transport => {\n retry.last_error = error;\n queue.push_back(retry);\n }\n ...\n}", "endLine": 219, "explanation": "A stalling source is not quarantined and advances to the next identity.", "id": "retry-transport-requeues", "label": "Transport stalls are retryable", "language": "rust", "path": "crates/lanspread-peer/src/download/retry.rs", "role": "root_control", "startLine": 192 }, { "code": "const ORDINARY_CHUNK_TRANSFER_TIMEOUT: Duration = Duration::from_mins(10);", "endLine": 34, "explanation": "Sixty-four distinct identities can multiply the per-attempt deadline to about 640 minutes.", "id": "retry-ten-minute-attempt", "label": "Each source gets a fresh ten-minute deadline", "language": "rust", "path": "crates/lanspread-peer/src/download/transport.rs", "role": "sink", "startLine": 34 } ], "confidence": { "level": "high", "rationale": "The full-source retry loop, retry classification, peer cap, and per-attempt deadline are explicit." }, "extensions": {}, "findingId": "csf_1c204082cf65f3b51769f582", "fingerprints": { "algorithm": "codex-security/v1", "primary": "codex-security/v1:sha256:73147d89e16ed49c48a790b8e6bb11fd0b5d7733f568fca8b60abb87a597f57a" }, "identity": { "anchor": "per-source-deadline-multiplied-by-sybil-sources" }, "locations": [ { "endLine": 327, "path": "crates/lanspread-peer/src/download/retry.rs", "role": "root_control", "startLine": 294 }, { "endLine": 34, "path": "crates/lanspread-peer/src/download/transport.rs", "role": "sink", "startLine": 34 }, { "endLine": 667, "path": "crates/lanspread-peer/src/peer_db.rs", "role": "source", "startLine": 654 } ], "occurrenceId": "occ_80bdddc3df1afd907ea7579a", "provenance": { "candidateId": "cand-sybil-download-retry-budget", "originalCandidates": [ { "attacker": "One LAN host controlling many authenticated identities that advertise the exact catalog ContentId.", "confidence": "high", "cwe": "CWE-400", "impact": "A user-started chunk can remain active for roughly 640 minutes across 64 identities.", "locations": [ "handlers.rs:126-139", "peer_db.rs:22,654-667", "download/retry.rs:29-53,82-129,192-219,294-327", "download/transport.rs:34", "identity.rs:81-103", "tls.rs:50-73" ], "severity": "medium", "source_to_sink": "Retry state attempts every distinct identity with no numeric or total deadline; transport stalls are retryable and each source receives a fresh ten-minute chunk deadline.", "title": "Sybil content sources multiply the per-chunk deadline into a multi-hour retry loop" } ], "previousFindings": [], "source": "focused_investigator" }, "remediation": "Add total per-chunk/download wall-clock and attempt budgets independent of source count, cap automatically tried identities, add per-origin identity quotas, and require explicit user retry after budget exhaustion.", "rootCause": { "evidenceRefs": [ "retry-all-identities", "retry-transport-requeues", "retry-ten-minute-attempt" ], "summary": "The retry budget is defined per identity rather than per chunk/download, while identities are cheap and attacker-multipliable." }, "ruleId": "resource-exhaustion.download-retry-total-budget", "severity": { "level": "medium", "rationale": "A hostile LAN host can hold a user-started operation for roughly 640 minutes, but the source count is finite and cancellation remains available." }, "summary": "A download retries every distinct peer identity with no numeric or total deadline; transport stalls remain retryable and each of up to 64 Sybil sources receives a fresh ten-minute chunk deadline.", "taxonomy": { "category": "resource-exhaustion", "cwe": [ "CWE-400" ] }, "title": "Sybil sources can multiply one chunk deadline into a multi-hour retry loop", "validation": { "assertions": [ "Up to 64 exact-content claimants enter the source set.", "Every identity can be attempted once.", "Transport stalls requeue.", "Each attempt gets ten minutes." ], "counterEvidence": [ "Source count is capped at 64.", "Integrity failures quarantine the peer/content pair.", "User cancellation drains children and rolls back." ], "disposition": "reportable", "evidenceRefs": [ "retry-all-identities", "retry-transport-requeues", "retry-ten-minute-attempt" ], "method": "Static trace of source selection, transport failure policy, retry termination, and per-attempt deadline.", "status": "validated", "summary": "Validated; exact content verification prevents corrupt acceptance but not operation-lifetime exhaustion." } }, { "attackPath": { "controls": [ "Current internal catalog/single-component checks", "Fixed marker basename" ], "dataflow": { "evidenceRefs": [ "state-path-raw-join", "state-path-public-write", "state-path-sink" ], "outcome": "Fixed marker file creation/overwrite.", "sink": "Filesystem outside state_dir.", "source": "Embedding application input.", "summary": "Raw game_id -> public path helper -> escaped PathBuf -> create_dir_all/write." }, "impact": { "level": "low", "rationale": "Write target basename is fixed, but directories/path can escape." }, "likelihood": { "level": "low", "rationale": "Current workspace callers prevalidate; exploitation depends on another caller." }, "reachability": { "attacker": "Caller controlling a game_id consumed by an embedding application.", "entrypoint": "mark_launch_settings_applied or exported path helpers.", "evidenceRefs": [ "state-path-public-write" ], "preconditions": [ "Embedding caller forwards untrusted identifier" ], "summary": "Public Rust API boundary; no shipping LAN route was found." }, "summary": "An embedding caller forwards an untrusted game_id to the public marker API." }, "codeEvidence": [ { "code": "pub(crate) fn game_state_dir(state_dir: &Path, game_id: &str) -> PathBuf {\n games_state_dir(state_dir).join(game_id)\n}\n...\npub fn launch_settings_applied_path(state_dir: &Path, game_id: &str) -> PathBuf {\n game_state_dir(state_dir, game_id).join(LAUNCH_SETTINGS_APPLIED_FILE)\n}", "endLine": 59, "explanation": "Absolute and parent components are not rejected before Path::join.", "id": "state-path-raw-join", "label": "Raw game ID selects the state child", "language": "rust", "path": "crates/lanspread-peer/src/state_paths.rs", "role": "root_control", "startLine": 44 }, { "code": "pub fn mark_launch_settings_applied(state_dir: &Path, game_id: &str) -> eyre::Result<()> {\n scoped_blocking(|| mark_applied(&launch_settings_applied_path(state_dir, game_id)))\n}", "endLine": 175, "explanation": "The public function documents no validated-ID precondition.", "id": "state-path-public-write", "label": "Public API writes the escaped marker", "language": "rust", "path": "crates/lanspread-peer/src/launch_settings.rs", "role": "entrypoint", "startLine": 168 }, { "code": "if let Some(parent) = marker.parent() {\n std::fs::create_dir_all(parent)?;\n}\nstd::fs::write(marker, [])?;", "endLine": 389, "explanation": "The escaped path drives mutation with application privileges.", "id": "state-path-sink", "label": "Parents are created and marker overwritten", "language": "rust", "path": "crates/lanspread-peer/src/launch_settings.rs", "role": "sink", "startLine": 383 } ], "confidence": { "level": "high", "rationale": "The raw joins, public re-exports, and filesystem write are direct." }, "extensions": {}, "findingId": "csf_8fefa5cb607eaa71c76a60ae", "fingerprints": { "algorithm": "codex-security/v1", "primary": "codex-security/v1:sha256:0a3fdc1b7078165af877d4c58e0c2168c9f3911c3ae9a5086ef452dda147be52" }, "identity": { "anchor": "raw-game-id-joined-into-public-state-marker-path" }, "locations": [ { "endLine": 59, "path": "crates/lanspread-peer/src/state_paths.rs", "role": "root_control", "startLine": 44 }, { "endLine": 175, "path": "crates/lanspread-peer/src/launch_settings.rs", "role": "entrypoint", "startLine": 168 }, { "endLine": 389, "path": "crates/lanspread-peer/src/launch_settings.rs", "role": "sink", "startLine": 383 } ], "occurrenceId": "occ_7a4292dcad47ad7e3e8412ef", "provenance": { "candidateId": "cand-public-state-path-traversal", "originalCandidates": [ { "attacker": "Untrusted game_id passed by an embedding caller.", "confidence": "high", "cwe": "CWE-22", "impact": "Directory creation and fixed-basename file overwrite outside state_dir.", "locations": [ "state_paths.rs:44-59", "lib.rs:118-135", "launch_settings.rs:168-175,383-389" ], "severity": "low", "source_to_sink": "Public state path helpers Path::join raw game_id; mark_launch_settings_applied creates parents and writes a fixed marker at the resulting path.", "title": "Public per-game state helpers accept traversal and absolute game IDs" } ], "previousFindings": [], "source": "focused_investigator" }, "remediation": "Require a validated single-component GameId newtype or make helpers fallible and reject absolute/prefix/dot/parent/separator/reserved forms; write relative to a retained no-follow state-directory handle.", "rootCause": { "evidenceRefs": [ "state-path-raw-join", "state-path-public-write", "state-path-sink" ], "summary": "The public API represents game IDs as raw strings instead of a validated single-component type." }, "ruleId": "path-traversal.public-state-path-helper", "severity": { "level": "low", "rationale": "The write is constrained to a fixed basename and shipping callers validate/catalog-source IDs, but an embedding caller forwarding untrusted IDs crosses a real public library boundary." }, "summary": "Public per-game path and marker APIs join an unvalidated game ID; absolute or parent-containing IDs escape `state_dir/games`, after which the marker writer creates parents and overwrites a fixed file.", "taxonomy": { "category": "path-traversal", "cwe": [ "CWE-22" ] }, "title": "Public state helpers permit marker writes outside the state directory", "validation": { "assertions": [ "Absolute child replaces the accumulated PathBuf prefix.", "Parent components escape when resolved.", "Public marker API creates parents and writes." ], "counterEvidence": [ "Windows run-game checks one component.", "Internal StreamInstall calls use catalog IDs.", "Only a fixed basename is written." ], "disposition": "reportable", "evidenceRefs": [ "state-path-raw-join", "state-path-public-write", "state-path-sink" ], "method": "Static public-API trace from caller-controlled identifier through Path::join to filesystem write.", "status": "validated", "summary": "Validated with low severity; no direct LAN route exists and current shipping callers use validated IDs." } } ], "scanId": "916f0812-d79c-465f-a422-81d75a258f76", "schemaVersion": "1.0" }