Skip to content

fix: harden update metadata boundary - #38

Merged
abruption merged 1 commit into
mainfrom
security/28-update-cache-contract
Sep 22, 2026
Merged

abruption merged 1 commit into
mainfrom
security/28-update-cache-contract

Conversation

@abruption

Copy link
Copy Markdown
Owner

Summary

  • add a fail-closed update metadata foundation with a strict 24-hour/4 KiB cache, same-user 0700/0600 permissions, symlink and hard-link refusal, fsync + atomic replacement, and strict stable SemVer
  • serialize refreshes with a real nonblocking advisory lock; an unlocked stale file is residue rather than ownership evidence and stores no PID, path, or token
  • bound the fixed npm HTTPS request by host, redirect policy, 5-second deadline, 64 KiB streamed response cap, JSON content type, and stable version parsing
  • define CI, TTY, JSON, and opt-out policy without wiring notices into the CLI yet
  • document the privacy/failure-isolation contract consumed by feat: show a cached advisory notice when codex-unlock is outdated #20 and ship the internal module in the exact package allowlist

Safety evidence

  • update cache and lock paths are completely separate from CODEX_HOME, native locks, rollouts, and unlock leases
  • fetch failures do not overwrite an existing valid cache
  • malformed, stale, future, oversized, symlinked, hard-linked, wrong-mode, offline, redirect, timeout, and registry-error cases fail closed
  • a real advisory-lock unlock test instruments registry calls and the reserved refresh-child argument; both remain zero across inspection, revalidation, SIGTERM, and post-checks
  • cache failure fixtures leave deterministic primary JSON bytes, stderr, and exit status unchanged
  • no automatic self-update and no CLI update notice are introduced in this PR

Verification

  • npm ci (0 vulnerabilities)
  • npm run check
  • npm run lint
  • npm test (76 tests passed)
  • npm run smoke:package
  • live fixed-registry probe returned stable 0.2.0

Closes #28
Depends-on follow-up: #20

@abruption
abruption merged commit 3170ebd into main Sep 22, 2026
20 checks passed
@abruption
abruption deleted the security/28-update-cache-contract branch September 27, 2026 06:08
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.

security: specify update-cache privacy and failure isolation

1 participant