Skip to content

security: warn on an active KIT_DEVICE_ID override (#79) - #246

Merged
sandstream merged 1 commit into
mainfrom
claude/web-kit-status-sync-p6fg9a
Jul 6, 2026
Merged

sandstream merged 1 commit into
mainfrom
claude/web-kit-status-sync-p6fg9a

Conversation

@sandstream

Copy link
Copy Markdown
Owner

Description

The last actionable code item from holistic-review-4.0.md. The device id is trust-bearing — the device fences in palList / palSyncFindings auto-close another device's open findings by it, so a spoofed KIT_DEVICE_ID could silently close them. deviceId() only validates the format; the protection was otherwise doc-only.

Changes

  • deviceIdOverrideActive() (src/memory/pal.ts) — true only when KIT_DEVICE_ID is set AND well-formed (a malformed override is ignored by deviceId(), so it isn't "active").
  • device-id override check (src/check-security.ts) — WARNs (never fails by default; escalates under --fail-on-warning) when the override is active AND a store exists (a device fence is actually in effect); skips otherwise.

Type of Change

  • Security hardening

Testing

  • npm test — 2373 pass, 0 fail
  • New tests: deviceIdOverrideActive (unset / valid / blank / malformed); checkDeviceIdOverride (skip-no-override / skip-no-store / warn).

Verified already-fixed (no change)

Breaking Changes

kit check gains a low-severity device-id override warning when KIT_DEVICE_ID is set on a machine with a memory store. Informational; only escalates under --fail-on-warning.

🤖 Generated with Claude Code

https://claude.ai/code/session_01DbF4MFePXWNCd4dxBQvqH2


Generated by Claude Code

The device id is trust-bearing: the device fences in palList/palSyncFindings
auto-close another device's open findings by it, so a spoofed KIT_DEVICE_ID
could silently close them. deviceId() only validates the format; the protection
was otherwise doc-only.

Add deviceIdOverrideActive() and a `device-id override` security check that WARNs
(never fails by default; escalates under --fail-on-warning) when a well-formed
override is set AND a store exists (a device fence is actually in effect); skips
otherwise. Tests cover the predicate (unset/valid/malformed) and the check
(skip/skip-no-store/warn).

Verified already-fixed: #45/#47 (isNewer strips prerelease/build, is exported,
has direct tests) — no change needed.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DbF4MFePXWNCd4dxBQvqH2
@github-actions

github-actions Bot commented Jul 6, 2026

Copy link
Copy Markdown

✅ Docker image built successfully

  • CLI image: docker.io/sandstream/kit:test

@sandstream
sandstream merged commit 57fefed into main Jul 6, 2026
17 checks passed
@sandstream
sandstream deleted the claude/web-kit-status-sync-p6fg9a branch July 6, 2026 16:45
sandstream added a commit that referenced this pull request Jul 6, 2026
…ingestion (#248)

Cuts [Unreleased] (PRs #232–#246 + red-team/holistic-review sweeps) to 4.2.0.
No breaking changes — the exec-broker gates are opt-in passthrough by default.

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
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.

2 participants