Security audit remediation (PD-001…PD-050) - #24
Open
aronprins wants to merge 3 commits into
Open
Conversation
Implements the highest-priority fixes from docs/bugs/audit.md across the Electron main process, connection layer, launcher UI, build/release scripts, and CI. Build and all 52 unit tests pass; new tests cover the security-relevant behavior changes. Supply chain: - PD-015: verify bundled Node against nodejs.org SHASUMS256.txt before extract - PD-016: version-keyed Node cache; stale cache rebuilt on NODE_VERSION bump Electron main (src/main.ts): - PD-001: single-instance lock + second-instance focus - PD-002: strict numeric PID validation before treeKill - PD-005/006: idempotent killServer with shared promise + SIGKILL escalation - PD-008: port-probe connect timeout Connection layer: - PD-040/041/049: preflight body timeout, 256KB size cap, JSON misclassification - PD-042/050: atomic profile write, discriminating reader, mode 0600, .bak backup - PD-043/044: private-host classifier fixes (fc/fd, 0.0.0.0, fe80, mapped IPv6) - PD-011/046: UUID-validate/regenerate profile ids + de-dup on load Launcher UI (src/launcher-html.ts): - PD-010: verify-token staleness guard + verified-URL match before connect - PD-013/014: null snapshot guards, connect re-entry guard - PD-009: preload onStatus returns unsubscribe Release gates / CI: - PD-021: missing embedded server bundle fails verification - PD-022: notarization fails closed unless ALLOW_UNNOTARIZED_MACOS_BUILD=true - PD-030: workflow_dispatch inputs via step env: + tag validation - add ci.yml (build + unit tests on PR/push) - PD-038: noImplicitOverride, noFallthroughCasesInSwitch See docs/bugs/audit.md "Remediation log" for deferred items. Co-Authored-By: Claude Fable 5 <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.
Implements the highest-priority fixes from
docs/bugs/audit.md. Build passes and all 52 unit tests are green; new tests cover the security-relevant changes.What's fixed
Supply chain
SHASUMS256.txtbefore extractionNODE_VERSIONbumpElectron main process
second-instancefocus (stops a 2nd instance killing the 1st's server)/^\d+$/PID validation beforetreeKillkillServer(shared promise) with SIGKILL escalation after 5sConnection layer
0.0.0.0,fe80::/10, IPv4-mapped IPv6)Launcher UI
snapshotguards, connect re-entry/double-submit guardonStatusreturns an unsubscribeRelease gates / CI
ALLOW_UNNOTARIZED_MACOS_BUILD=trueworkflow_dispatchinputs routed through stepenv:+ tag validation (all 3 workflows)ci.yml— build + unit tests on PR/pushnoImplicitOverride,noFallthroughCasesInSwitchDeferred (tracked in the audit's Remediation log)
PD-017/018/019/020 (need a committed staging lockfile / pinned upstream commit), PD-031 (SHA-pin actions), PD-032 (entitlements need a notarized test build),
noUncheckedIndexedAccess(broad unrelated fallout), and remaining lows.Test plan
pnpm build✅node --test test/*.test.mjs→ 52 passing ✅ (added cases for PD-010 classifier, PD-039 window-policy adversarial URLs, PD-011/046/042 profile sanitization)🤖 Generated with Claude Code