fix(security): handle remaining from_utf8_lossy decision/scan sites (WI-4.3 follow-up)#348
Merged
Merged
Conversation
…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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 — gatefrom_utf8_lossyflags: 9 → 0.Triage + fixes
system_status.rsparent-process-name lookup (mirrors the mcpresolve_parent_namefix) →core::str::from_utf8(..).ok()?, fail-closed.connect_sync_autostart.rs×2,mcp_pid.rstasklist: a lossy decode can only fail the match → treat as "not the daemon" (safe reconnect), never a false positive.system_status.rsper-line PID scan + HTTP probe body (display).definitions.rsdecode of a locally-assembled buffer.system.rssysctl/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 thegolane.Native + Windows-target clippy clean; no new deps;
--lockedclean.