Skip to content

fix(factory-reset): scrub inherited USB and Thunderbolt trust - #74

Merged
mark-groves merged 2 commits into
cursor/upstream-changes-pr-492bfrom
cursor/factory-reset-accessory-trust-70cf
Oct 14, 2026
Merged

mark-groves merged 2 commits into
cursor/upstream-changes-pr-492bfrom
cursor/factory-reset-accessory-trust-70cf

Conversation

@mark-groves

Copy link
Copy Markdown
Owner

Why

Factory reset boots a clone of the install snapshot. After USB and Thunderbolt approval was removed, that clone still started the previous owner's USBGuard allowlist and still held their Bolt enrollments. The removal migration edits the running system only.

What changed

  • disable_factory_usbguard disables USBGuard in the booted clone and the retained baseline when the snapshot still has the unit.
  • reset_factory_thunderbolt removes authorization markers, the journal, and Bolt device, key, and domain records in both roots, then sets AuthMode to enabled.
  • test/shell.d/factory-reset-accessory-trust-test.sh runs stage_full_reset against a snapshot that still carries that trust.

Scope

Covers a factory snapshot that still has the approval-era USBGuard unit or Thunderbolt authorization state. The USBGuard rules file stays on disk. The daemon is disabled, so the allowlist is not enforced. The live removal migration is unchanged, and device approval is not restored.

Tradeoffs

USBGuard stays installed and disabled. The snapshot is offline, so the reset cannot drop the package the way an update of the running system can. Bolt's mode becomes enabled after its enrollments are deleted. An empty store does not authorize the previous owner's devices.

Blast Radius

This runs only during factory reset, and only when the snapshot still has the USBGuard unit or Thunderbolt authorization markers. A snapshot without them is unchanged. A Bolt directory that is a symlink aborts the reset before the new root is activated.

Verification

  • Before the scrub, bash test/shell.d/factory-reset-accessory-trust-test.sh failed with not ok - the booted factory system still enables USBGuard.
  • After the scrub, that file passed all four checks. factory-reset-accounts-test.sh, factory-reset-dispatch-test.sh, and factory-reset-elevation-test.sh passed.
Open in Web Open in Cursor 

cursoragent and others added 2 commits October 14, 2026 02:34
A snapshot from the approval window still enables USBGuard and keeps Bolt enrollments after stage_full_reset.

Co-authored-by: ai <ai@id.grovr.au>
The removal migration edits the running root only, so a reset of an approval-era snapshot was booting the previous owner's allowlist and Bolt enrollments.

Co-authored-by: ai <ai@id.grovr.au>
@coderabbitai

coderabbitai Bot commented Oct 14, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration
  • Configuration used: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 5e2e19ca-f2ed-41bd-b3eb-e1e1002a10cc

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@mark-groves
mark-groves merged commit b493942 into cursor/upstream-changes-pr-492b Oct 14, 2026
3 checks passed
@mark-groves
mark-groves deleted the cursor/factory-reset-accessory-trust-70cf branch October 17, 2026 23:22
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