Skip to content

[Bug]: Chromium cookie import aborts on TEXT-backed encrypted_value rows #30465

Open

Description

@nedlane

Before submitting

  • I searched existing issues and did not find a duplicate.
  • I included enough detail to reproduce or investigate the problem.

Area

apps/desktop

Steps to reproduce

  1. Use an existing Arc profile whose Chromium cookies.encrypted_value column contains at least one row with SQLite storage class text. The column has BLOB affinity, but SQLite permits individual TEXT-backed rows.

  2. Confirm the condition without reading cookie values:

    SELECT typeof(encrypted_value), count(*)
    FROM cookies
    GROUP BY typeof(encrypted_value);
  3. Quit Arc.

  4. In T3 Code, open Settings, Integrations, Browser profiles, Add profile, Import from Arc.

  5. Select the affected Arc profile and start the import.

This was reproduced with two existing Arc profiles on macOS. One database contained 3 TEXT-backed rows among 6,596 cookies. The other contained 313 among 3,556. Both databases passed PRAGMA quick_check before testing.

Expected behavior

T3 Code should read valid Chromium cookie databases even when SQLite returns a TEXT-backed encrypted_value. The importer can cast the column to BLOB in its read-only snapshot query before schema decoding, as previously implemented in #19377.

Actual behavior

The importer expects every encrypted_value to arrive as Uint8Array. A TEXT-backed row arrives as a string, schema decoding fails, and T3 Code aborts the entire profile import with "The browser's cookie database could not be read."

After making verified backups and changing only the affected rows' SQLite storage class with CAST(encrypted_value AS BLOB), both real profiles imported successfully in the same installed T3 Code build. Logical byte digests for every encrypted_value were identical before and after the workaround, and both databases still passed PRAGMA quick_check.

This matches the defect fixed in #19377. That PR was reverted in #22222 because it had not been run on a real desktop build with existing user state. This report provides the missing macOS before-and-after validation.

Impact

Major degradation or frequent failure

Version or commit

  • Reproduced in installed T3 Code Beta 0.1.0.
  • Still present in nightly v0.1.7-nightly.20261103.4138 at 115739c1e02e181d6c176a4d8b43716f8f83d1d4.
  • Still present on main at 87049668615717241c1bd4449e872ae82ab1702e.

The nightly and current main queries still select encrypted_value without casting it to BLOB.

Environment

  • macOS 26.3.1, build 25D771280a
  • Arc 1.170.0
  • T3 Code desktop app

Logs or stack traces

ChromiumCookieReadError: Could not read Chromium cookies at $HOME/Library/Application Support/Arc/User Data/Default/Cookies: readFailed.
  [cause]: SchemaError: Expected Uint8Array
    at [0]["encrypted_value"]

Workaround

With Arc fully quit, back up the database and normalize TEXT-backed rows:

UPDATE cookies
SET encrypted_value = CAST(encrypted_value AS BLOB)
WHERE typeof(encrypted_value) = 'text';

This workaround should not be necessary. The importer can remain read-only and cast in both snapshot SELECT branches, as in #19377, with its mixed TEXT/BLOB regression tests restored.

Activity

  1. shivamhwp commented on Nov 4, 2026

    @shivamhwp
    Collaborator

    [GPT-6.1 Sol][Codex] on behalf of shivam.

    Julius has taken this over in #30496, currently at dcff8c8, which targets this issue. This issue-watch run is handing off there. No code changes or additional test runs were made here.

  2. bradenbiz commented on Nov 7, 2026

    @bradenbiz

    Also reproduced with Brave on macOS (darwin arm64, 25.2.0), T3 Code Desktop 0.1.8-nightly.20261104.4192. Default/Cookies had 22 TEXT-backed encrypted_value rows (all v10-prefixed, 13 hosts) among 3,478 cookies; the first row was TEXT-backed, so the import aborted immediately:

    ChromiumCookieReadError: Could not read Chromium cookies at $HOME/Library/Application Support/BraveSoftware/Brave-Browser/Default/Cookies: readFailed.
      [cause]: SchemaError: Expected Uint8Array at [0]["encrypted_value"]
    

    The CAST(encrypted_value AS BLOB) workaround from the issue body converted all 22 rows with byte-identical encrypted_value digests and a clean PRAGMA quick_check.

    So this affects at least Arc and Brave, not just one browser. +1 for landing #30496.

    Triaged by Claude Opus 5.5 (Claude Code) via T3 Code triage.

  3. andras-gyarmati commented on Nov 13, 2026

    @andras-gyarmati

    still happens on 0.1.10-nightly.20261113.4630 (macos, arc). arc's Default profile had 4 text-backed encrypted_value rows among 3,530 cookies (google hosts, all v10) and the first row it read was one of them, so the whole import aborted with Expected Uint8Array at [0]["encrypted_value"]. the same workaround worked here too: backup, CAST(encrypted_value AS BLOB) on the 4 rows, bytes identical before and after, then the import added 2,902 cookies. would be great to get #30496 merged

  4. HugoVizcainoSantana commented on Nov 17, 2026

    @HugoVizcainoSantana
    Contributor

    Also reproduced with Chrome on macOS, on today's nightly.

    • T3 Code Desktop (Nightly) 0.1.11-nightly.20261117.4838, darwin arm64 (Darwin 25.3.0)
    • Google Chrome 157.0.8103.79, profile Default, cookie DB schema meta.version = 24
    • Default/Cookies: 6 TEXT-backed encrypted_value rows among 2,749 cookies (all v10-prefixed, created 2023–2024 and never rewritten since). The first row returned was TEXT-backed, so the whole import aborted.
    • Chrome was closed (no browserRunning) and the Keychain read succeeded (ChromiumKeys.readKeychainSecret → Success), so this is only the decoding issue.

    Desktop trace (desktop.trace.ndjson), paths redacted:

    BrowserImport.importCookies → Failure
      Importing cookies from chrome failed: readFailed.
      Could not read Chromium cookies at $HOME/Library/Application Support/Google/Chrome/Default/Cookies: readFailed.
    ChromiumCookies.readChromiumCookieDatabase → Failure
      SchemaError: Expected Uint8Array
        at [0]["encrypted_value"]
    

    Read-only check (no cookie values read):

    SELECT typeof(encrypted_value), count(*) FROM cookies GROUP BY 1;
    -- blob|2743
    -- text|6

    main at 733821285c still selects encrypted_value without CAST(... AS BLOB), so #30496 (green checks, approved by Macroscope) still looks like the fix. It would be great to get it merged.

    Investigated with t3 triage (playbook run by hand) by Claude Opus 5.5 in Claude Code.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions