Skip to content

fix: P0 research fixes — IPv6 carry, SNMPv3, loader, ARP, DNS task - #88

Merged
jacobyoby merged 2 commits into
mainfrom
improve/p0-research-fixes
Sep 18, 2026
Merged

jacobyoby merged 2 commits into
mainfrom
improve/p0-research-fixes

Conversation

@jacobyoby

Copy link
Copy Markdown
Owner

Research audit (5 lenses) found 18 items. This PR ships the 6 P0 correctness/security fixes:

  • Get-IPv6CidrScanTarget:48 carry overflow (ff+1=100) for /120 — add byte-carry loop
  • Invoke-SnmpWalk:1-105 v3 used -c community (wrong) + proc-list leak + LASTEXITCODE no-discrimination — now -u for v3 with redacted verbose
  • NetDiagram-PS.psm1:13,23-29 ErrorActionPreference leak + Write-Error half-load + SilentlyContinue swallowing missing files — local EAP, fail-fast, throw
  • ConvertFrom-ArpText:14,21,29,50,56 throw vs continue + Regex :::: + no TryParse — skip with warning, TryParse for IPv4-only drop
  • Wait-DnsLookupTask:9 abandon no Cancel leak + IsFaulted/IsCanceled handling, observe Exception to prevent UnobservedTaskException
  • Examples/New-NetworkDiagram.ps1 locals dedup noted (kept intentional for offline wizard)

Tests: 175→179 Pester, 0 PSScriptAnalyzer Error, durable coverage for all 5 fixes (P0 research fixes describe)
Refs: research workflow dd3045e + e64a83c (lint hygiene)

- Invoke-PortScan: log banner-grab and closed-port filters via Write-Verbose
- Test-DeviceReachability: log TCP fallback failure via Write-Verbose
- Get-SnmpNeighbors: Write-Host -> Write-Information -Tags NetDiagram
- Add durable Pester coverage for Information stream and closed-port path

Fixes PSScriptAnalyzer PSAvoidUsingEmptyCatchBlock / PSAvoidUsingWriteHost
- Get-IPv6CidrScanTarget: carry overflow across bytes (ff+1=100) for /120
- Invoke-SnmpWalk: use -u for v3 (not -c), redact -u, fix LASTEXITCODE path
- NetDiagram-PS.psm1: local ErrorActionPreference, fail-fast on missing dirs/files, throw not Write-Error
- ConvertFrom-ArpText: macOS/LinuxArp skip with warning not throw, TryParse for IPv4-only drop
- Wait-DnsLookupTask: observe faulted task via Exception property, handle IsFaulted/IsCanceled, prevent UnobservedTaskException
- Add durable Pester coverage for all 5 fixes (179 tests)

Research: P0 batch from 5-lens audit
@jacobyoby
jacobyoby merged commit 4387c89 into main Sep 18, 2026
7 checks passed
@cursor
cursor Bot deleted the improve/p0-research-fixes branch September 19, 2026 18:20
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