Repository navigation
Conversation
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Want higher recall? High effort reviews run extra passes and find more bugs. A team admin can switch effort levels in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit fd35e98. Configure here.
| } | ||
| if err := os.WriteFile(path, bytes.TrimRight(buf.Bytes(), "\n"), 0o644); err != nil { | ||
| return fmt.Errorf("write Local State: %w", err) | ||
| } |
There was a problem hiding this comment.
Failed rewrite can corrupt Local State
Medium Severity
A write error in stripProfileKernelLocalState still installs the profile. os.WriteFile truncates Local State before writing, so a failed write can leave empty or partial JSON. Configure then swaps that copy in, which can drop os_crypt and other browser-wide prefs instead of keeping the original file.
Additional Locations (1)
Reviewed by Cursor Bugbot for commit fd35e98. Configure here.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>


Summary
Kernel's Chromium build stores browser-wide settings set over CDP in Chrome's
Local State, under a top-levelkernelobject (fingerprint overrides and request header rules). Saved profiles archive the whole user-data directory, so a profile saved from a browser with these settings brings them back into every browser that loads it.When
/chromium/configureinstalls a profile, it now removes thekernelobject from the unpacked profile'sLocal Statebefore swapping it in for user-data. LikestripProfileSessionRestore, only the live copy is changed; the stored archive is not. This covers archives saved before the API stopped including these settings (kernel/kernel#5396).A missing
Local Stateis a no-op. If the file cannot be read, parsed or written, configure logs a warning and installs the profile anyway. A file without akernelobject is not rewritten, and the rewrite keeps the file's owner and mode.Validation
kernel, keeps large integers and URLs with&, keeps the file mode, leaves files withoutkernelbyte-for-byte unchanged, treats a missing file as a no-op, and reports invalid JSON.sanitizePreparedProfile. Its test covers both start_url cases and confirms an unreadable Local State does not fail the load. Removing the Local State strip from the helper fails the test.chromiumConfigureRestartcall into that helper, which needs a running Chromium under supervisor. Not exercised end to end in an image.🤖 Generated with Claude Code
Note
Medium Risk
Changes profile install behavior in the Chromium configure restart path; mistaken stripping could affect fingerprint/header behavior, but Local State failures are non-blocking by design.
Overview
When
/chromium/configureinstalls a profile archive, profile prep now runs throughsanitizePreparedProfile, which still removesDefault/Sessionsonly when astart_urlnavigation is requested, and always strips the top-levelkernelobject from the unpacked profile’sLocal Stateso saved fingerprint/header settings from another browser are not reapplied.stripProfileKernelLocalStateparses and rewritesLocal Statein place on the live unpacked copy only; missing files or absentkernelare no-ops. Errors reading/parsing/writingLocal Stateare warned and ignored so configure can still install the profile. Unit tests cover the strip helper and the combined sanitizer (with/without navigation, and invalidLocal Statenot failing the load).Reviewed by Cursor Bugbot for commit 64e3b3f. Bugbot is set up for automated code reviews on this repo. Configure here.