Skip to content

fix(security): handle remaining from_utf8_lossy decision/scan sites (WI-4.3 follow-up)#348

Merged
githubrobbi merged 1 commit into
mainfrom
fix/wi-4.3-followup-from-utf8
Jun 4, 2026
Merged

fix(security): handle remaining from_utf8_lossy decision/scan sites (WI-4.3 follow-up)#348
githubrobbi merged 1 commit into
mainfrom
fix/wi-4.3-followup-from-utf8

Conversation

@githubrobbi

@githubrobbi githubrobbi commented Jun 4, 2026

Copy link
Copy Markdown
Collaborator

Summary

Follow-up to WI-4.3 (merged in #346). After #347 tightened the anti-pattern gate to flag from_utf8_lossy, it surfaced 9 more sites beyond the 3 files WI-4.3 originally covered. This handles all of them — gate from_utf8_lossy flags: 9 → 0.

Triage + fixes

  • Strict-parse (1 real decision): system_status.rs parent-process-name lookup (mirrors the mcp resolve_parent_name fix) → core::str::from_utf8(..).ok()?, fail-closed.
  • AUDIT-OK(bytes) (8 fail-safe / display):
    • daemon-identity substring probes — connect_sync_autostart.rs ×2, mcp_pid.rs tasklist: a lossy decode can only fail the match → treat as "not the daemon" (safe reconnect), never a false positive.
    • system_status.rs per-line PID scan + HTTP probe body (display).
    • definitions.rs decode of a locally-assembled buffer.
    • macOS system.rs sysctl/vm_stat memory-stats parses (already .parse().ok()? → fail closed).

Status

After this, the anti-pattern gate's only remaining reds are 4 from_utf16_lossy (Windows path/exe/pipe-name decodes) = the WI-4.2 follow-up. Once WI-4.2 lands, the gate goes fully green and can be wired into the go lane.

Native + Windows-target clippy clean; no new deps; --locked clean.

…WI-4.3 follow-up)

The tightened anti-pattern gate surfaced 9 from_utf8_lossy sites beyond
the 3 files WI-4.3 first covered. Strict-parse the one real decision
(system_status parent-process-name → fail-closed); AUDIT-OK(bytes) the
rest with precise reasons: daemon-identity substring probes that only
fail-safe (connect_sync_autostart ×2, mcp_pid), per-line PID scans, HTTP
display bodies, a locally-assembled buffer, and macOS memory-stats parses
that already fail closed. Gate from_utf8_lossy flags: 9 → 0.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@githubrobbi githubrobbi enabled auto-merge (squash) June 4, 2026 17:15
@githubrobbi githubrobbi merged commit 9024d5d into main Jun 4, 2026
21 checks passed
@githubrobbi githubrobbi deleted the fix/wi-4.3-followup-from-utf8 branch June 4, 2026 17:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant