Skip to content

feat: decrypt Chromium v10/v11 across host OS#605

Merged
moonD4rk merged 2 commits into
mainfrom
feat/cross-os-v10-decrypt
Jun 3, 2026
Merged

feat: decrypt Chromium v10/v11 across host OS#605
moonD4rk merged 2 commits into
mainfrom
feat/cross-os-v10-decrypt

Conversation

@moonD4rk

@moonD4rk moonD4rk commented Jun 1, 2026

Copy link
Copy Markdown
Owner

Chromium's v10 prefix means AES-GCM on Windows but AES-CBC on macOS/Linux. The cipher was chosen at compile time by build tag, so a macOS/Linux binary couldn't decrypt a Windows v10 value even with the correct dumped key — keys export / keys import was effectively same-OS-only.

Change

  • crypto now exposes platform-neutral primitives DecryptChromiumGCM / DecryptChromiumCBC; the build-tag-split DecryptChromium is removed. DecryptDPAPI stays build-tag-split (a genuine Win32 syscall that truly can't run cross-OS).
  • decryptValue dispatches v10 by master-key length: 32B (AES-256) → GCM, 16B (AES-128) → CBC. Chromium pairs each key size with exactly one cipher, so key length is a self-contained signal — no need to thread the origin OS through decryptValue.

Verification

  • Cross-platform unit tests in crypto + browser/chromium (GCM / CBC / kEmptyKey fallback / short-ciphertext); pass under go vet on darwin/linux/windows and on both go1.20 and go1.26.
  • E2E Windows→macOS: keys export on a Win10 host → keys import on macOS decrypted 126/128 Yandex v10 cookies to plaintext.
  • Zero regression for same-OS: Windows keys are 32B→GCM, macOS/Linux 16B→CBC — unchanged.

Chromium's v10 means AES-GCM on Windows but AES-CBC on macOS/Linux.
Dispatch the cipher by master-key length (32B GCM, 16B CBC) so one
binary can decrypt a key dumped from a different OS.
Copilot AI review requested due to automatic review settings June 1, 2026 14:45
@codecov-commenter

codecov-commenter commented Jun 1, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 93.75000% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 73.63%. Comparing base (c444314) to head (f230aeb).

Files with missing lines Patch % Lines
crypto/crypto.go 90.90% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #605      +/-   ##
==========================================
+ Coverage   73.35%   73.63%   +0.28%     
==========================================
  Files          67       67              
  Lines        2987     2989       +2     
==========================================
+ Hits         2191     2201      +10     
+ Misses        598      591       -7     
+ Partials      198      197       -1     
Flag Coverage Δ
unittests 73.63% <93.75%> (+0.28%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copilot AI 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.

Pull request overview

This PR makes Chromium decryption for v10/v11 platform-neutral so a binary on one OS can decrypt Chromium data sealed on a different OS (given the correct exported/imported master key).

Changes:

  • Adds cross-platform crypto.DecryptChromiumGCM and crypto.DecryptChromiumCBC primitives and removes the build-tag-split DecryptChromium.
  • Updates browser/chromium/decryptValue to route v10 based on key length (32B→GCM, 16B→CBC) and routes v20 through the shared GCM path.
  • Consolidates Chromium CBC constants/fallback (chromiumCBCIV, kEmptyKey) into the cross-platform crypto package and updates tests accordingly.

Reviewed changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
crypto/crypto.go Introduces cross-platform Chromium GCM/CBC decrypt helpers and shared CBC constants/fallback key.
crypto/crypto_windows.go Removes the Windows-only DecryptChromium wrapper; keeps DPAPI decryption Windows-only.
crypto/crypto_test.go Adds cross-platform unit tests for Chromium v10/v11/v20-related crypto primitives and fallbacks.
crypto/crypto_linux.go Removes Linux-only Chromium decrypt wrapper; keeps DPAPI stub for non-Windows.
crypto/crypto_linux_test.go Removes Linux-only tests now covered by cross-platform tests.
crypto/crypto_darwin.go Removes macOS-only Chromium decrypt wrapper; keeps DPAPI stub for non-Windows.
browser/chromium/decrypt.go Updates v10/v11/v20 routing to use the new platform-neutral decrypt primitives.
browser/chromium/decrypt_v20_test.go Updates v20 routing test to reference the new GCM decrypt function and adds a v10 cross-host GCM test.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread browser/chromium/decrypt.go
decryptValue routes v10 by key length (32B→GCM, 16B→CBC); the test's
16B key landed on the CBC path against GCM ciphertext. Real Windows v10
keys are always 32B.

Copilot AI 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.

Pull request overview

Copilot reviewed 9 out of 9 changed files in this pull request and generated 2 comments.

Comment thread crypto/crypto_test.go
assert.Equal(t, plaintext, got)
}

func TestDecryptChromium_ShortCiphertext(t *testing.T) {
Comment on lines +32 to +35
if len(masterKeys.V10) == 32 {
return crypto.DecryptChromiumGCM(masterKeys.V10, ciphertext)
}
return crypto.DecryptChromiumCBC(masterKeys.V10, ciphertext)
@moonD4rk moonD4rk merged commit 2666b81 into main Jun 3, 2026
10 checks passed
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.

3 participants