Skip to content

v0.1.1 — Correctness & Security

Choose a tag to compare

@kolkov kolkov released this 12 Sep 03:53
· 16 commits to main since this release
a4533af

Fixed

  • Start() creates DataDir if missing (os.MkdirAll) — first-run failure
  • Idle timer arms on startup with zero connections — was waiting forever
  • ConnTracker.Disconnect() clamps to zero — no more negative count
  • Stop() uses IsAlive() (PID + binary verification) — no more killing unrelated processes. Note: macOS/BSD remains PID-only (no /proc, deferred to v0.2.0)
  • Unix reaper goroutine prevents zombie processes; isZombie() via /proc/<pid>/stat
  • EnsureRunning() serialized with exclusive file lock (flock/LockFileEx)
  • Unlock() no longer deletes lock file (flock+unlink race fix)
  • Binary path comparison handles (deleted) suffix + symlinks + case-insensitive on Windows
  • Serve() compare-and-delete: orphan cleanup can't delete a live daemon's PID file
  • Proxy() skips disconnect if connect failed (no stray decrements)

Security

  • loopbackGuard middleware: rejects non-loopback Host/Origin headers (DNS rebinding, MCP spec)
  • Origin validation via url.Parse + hostname (blocks 127.0.0.1.evil.com bypass)

Tests

  • Lock exclusivity + no-delete regression (V1)
  • binaryPathsEqual 10 table-driven cases incl. (deleted) suffix
  • Compare-and-delete: orphan keeps foreign PID, own removed (V2c)
  • Loopback guard 16 cases incl. bypass attack vectors
  • ConnTracker clamp 6 table-driven cases
  • isZombie parser 13 cases