ITADN

Helium browser cookie decryption fails — wrong keychain label + shared singleton key

#7Openbald-ai 创建于 2026-02-25
B
bald-aicommented
## Problem SweetCookieKit cannot decrypt cookies from the [Helium browser](https://github.com/nicbarker/helium) due to two bugs. ## Bug 1: Incorrect keychain service name for Helium In `BrowserCatalog.swift`, Helium's `safeStorageLabels` are: ```swift safeStorageLabels: [ ("Helium Safe Storage", "Helium"), ("net.imput.helium Safe Storage", "net.imput.helium"), ], ``` But Helium actually stores its safe storage password under: ``` service: "Helium Storage Key" account: "Helium" ``` Verified via: ```bash $ security dump-keychain | grep -A5 "helium" 0x00000007 <blob>="Helium Storage Key" "acct"<blob>="Helium" ``` Neither `"Helium Safe Storage"` nor `"net.imput.helium Safe Storage"` exist in the keychain. **Fix:** Change the labels to: ```swift safeStorageLabels: [ ("Helium Storage Key", "Helium"), ], ``` ## Bug 2: `chromeSafeStorageKey()` is a shared singleton across all Chromium browsers `ChromeCookieImporter.chromeSafeStorageKey()` iterates through `BrowserCatalog.safeStorageLabels` (a global list ordered Chrome → Chromium → Brave → … → Helium → …), finds the **first** matching key, caches it, and uses it for **all** Chromium browsers. On a machine with Chrome installed, Chrome's key is found first and cached. When SweetCookieKit then tries to read Helium's cookies, it uses Chrome's key → decryption silently fails → cookie is skipped. **Verified manually:** ``` Decrypt Helium kimi-auth with Chrome key → FAILED (nil) Decrypt Helium kimi-auth with Helium key → SUCCESS: eyJhbGciOiJIUzUxMiIsInR5cCI6IkpXVCJ9... ``` Each Chromium-based browser generates its own unique safe storage password. They are not interchangeable. **Fix:** `chromeSafeStorageKey()` (or the call site) needs to resolve the key **per-browser** using that browser's own `safeStorageLabels`, rather than iterating through a global list and caching the first hit. ## Impact Any user with multiple Chromium browsers installed will only be able to import cookies from whichever browser's keychain entry is found first (typically Chrome). All other Chromium browsers silently fail.
1 条评论