Repository navigation
security: warn on an active KIT_DEVICE_ID override (#79) - #246
Merged
Merged
Conversation
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
|
✅ Docker image built successfully
|
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.
Description
The last actionable code item from
holistic-review-4.0.md. The device id is trust-bearing — the device fences inpalList/palSyncFindingsauto-close another device's open findings by it, so a spoofedKIT_DEVICE_IDcould silently close them.deviceId()only validates the format; the protection was otherwise doc-only.Changes
deviceIdOverrideActive()(src/memory/pal.ts) — true only whenKIT_DEVICE_IDis set AND well-formed (a malformed override is ignored bydeviceId(), so it isn't "active").device-id overridecheck (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
Testing
npm test— 2373 pass, 0 faildeviceIdOverrideActive(unset / valid / blank / malformed);checkDeviceIdOverride(skip-no-override / skip-no-store / warn).Verified already-fixed (no change)
isNeweralready strips prerelease/build before the numeric compare, is exported, and has direct prerelease/build tests. No change needed.Breaking Changes
kit checkgains a low-severitydevice-id overridewarning whenKIT_DEVICE_IDis 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