Skip to content

Import portable browser profile data - #229

Open
IlyaasK wants to merge 3 commits into
browser-import/03-connectorfrom
browser-import/04-profile-data
Open

Import portable browser profile data#229
IlyaasK wants to merge 3 commits into
browser-import/03-connectorfrom
browser-import/04-profile-data

Conversation

@IlyaasK

@IlyaasK IlyaasK commented Aug 14, 2026

Copy link
Copy Markdown
Contributor

What

Extend kernel profiles import-local beyond cookies to import approved portable browser data from Chrome and Helium on macOS:

  • bookmarks, selected by default
  • browsing history from the configured --days window, selected by default
  • localStorage, selected by default with a 64 MiB review boundary
  • Chrome Web Store extension IDs, selected under the profile and organization plan limits
  • a final summary and approval before cookie/localStorage values are decrypted and uploaded

Passwords and supported TOTP seeds remain a separate Managed Auth step. IndexedDB, cache, arbitrary preferences, and extension state are intentionally excluded.

Why

A useful imported profile needs more than cookies. This keeps the moment-to-magic flow simple while preserving a portable, bounded contract and making sensitive categories visible before upload. History uses actual visits in the chosen time window instead of lifetime URL counters.

How

  • snapshot live Chromium SQLite and LevelDB data before reading
  • translate bookmarks, recent history, and localStorage into the existing portable bundle format
  • inspect only metadata before approval; export values only after selection
  • enforce the API 100,000-record, 1 MiB-record, 16/64 MiB-category, and 128 MiB-bundle limits locally
  • query stored-extension capacity and constrain non-interactive/default selection
  • preserve the existing cookies_imported JSON field while adding per-category results

Depends on kernel/kernel PR #3244 for server-side extension persistence and entitlement enforcement.

Verification

  • go test ./internal/browserimport ./cmd -count=1
  • go vet ./internal/browserimport ./cmd
  • go mod tidy -diff
  • git diff --check
  • make build
  • verified the generated help shows history enabled by default
  • exercised the LevelDB reader against the local Helium profile without exposing stored values

Note

Medium Risk
Touches sensitive browser data export/upload and new LevelDB/SQLite snapshot paths; server extension support is an external dependency, but changes are bounded with local limit enforcement and approval before value decryption.

Overview
profiles import-local now imports bookmarks, browsing history (via --history, default on), localStorage, and Chrome Web Store extensions—not only cookies—from Chrome/Helium on macOS.

The flow adds interactive category selection, a pre-upload confirmation (before decrypting cookie/storage values), and plan-aware extension caps from org limits (max_stored_extensions). Local storage over 64 MiB requires interactive origin picking; non-interactive runs fail when over limit or when too many extensions are selected.

internal/browserimport gains Chromium readers (SQLite history, LevelDB localStorage snapshots, bookmark/extension export), BuildProfileBundle with portable size limits, and goleveldb as a dependency. Upload inventory/selection and JSON output add per-category counts (browser_data_imported) while keeping cookies_imported.

The macOS connector deep-link launcher now pulls KERNEL_* env vars via launchctl getenv before invoking the CLI.

Reviewed by Cursor Bugbot for commit 60febc7. Bugbot is set up for automated code reviews on this repo. Configure here.

Import bookmarks, recent history, local storage, and selected Web Store extensions alongside cookies. Keep values local until final approval, enforce the API payload bounds in the CLI, and apply extension entitlements before upload.
@socket-security

socket-security Bot commented Aug 14, 2026

Copy link
Copy Markdown

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Addedgolang/​github.com/​syndtr/​goleveldb@​v1.0.09610010075100

View full report

Comment thread cmd/browser_import_profile_data.go
Comment thread cmd/browser_import_profile_data.go
Comment thread cmd/browser_import_profile_data.go

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes using high effort and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 60febc7. Configure here.

return `on «event GURLGURL» incomingURL
set kernelExecutable to "` + appleScriptString(executable) + `"
set commandText to quoted form of kernelExecutable & " connector open " & quoted form of incomingURL
set commandText to "for variable in KERNEL_BASE_URL KERNEL_API_KEY KERNEL_AUTH_BASE_URL; do value=$(/bin/launchctl getenv \"$variable\"); if [[ -n \"$value\" ]]; then export \"$variable=$value\"; fi; done; exec " & quoted form of kernelExecutable & " connector open " & quoted form of incomingURL

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Strict shell aborts env prelude

Medium Severity

The new commandText prelude assigns value=$(/bin/launchctl getenv "$variable") for KERNEL_BASE_URL, KERNEL_API_KEY, and KERNEL_AUTH_BASE_URL before execing the CLI. Those vars are often unset, and launchctl getenv then exits non-zero. That assignment runs in the main body of zsh -lic after startup files load, so a user setopt ERR_EXIT / set -e aborts the script before kernel connector open, and the dashboard import never starts.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 60febc7. Configure here.

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.

1 participant