feat: decrypt Chromium v10/v11 across host OS#605
Merged
Conversation
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.
Codecov Report❌ Patch coverage is
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
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
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.DecryptChromiumGCMandcrypto.DecryptChromiumCBCprimitives and removes the build-tag-splitDecryptChromium. - Updates
browser/chromium/decryptValueto 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.
This was referenced Jun 1, 2026
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.
| 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) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Chromium's
v10prefix 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 Windowsv10value even with the correct dumped key —keys export/keys importwas effectively same-OS-only.Change
cryptonow exposes platform-neutral primitivesDecryptChromiumGCM/DecryptChromiumCBC; the build-tag-splitDecryptChromiumis removed.DecryptDPAPIstays build-tag-split (a genuine Win32 syscall that truly can't run cross-OS).decryptValuedispatchesv10by 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 throughdecryptValue.Verification
crypto+browser/chromium(GCM / CBC / kEmptyKey fallback / short-ciphertext); pass undergo veton darwin/linux/windows and on both go1.20 and go1.26.keys exporton a Win10 host →keys importon macOS decrypted 126/128 Yandexv10cookies to plaintext.