Skip to content

feat: Windows DPAPI cookie decryption + v20 fallback - #392

Closed
getabsolutehealth wants to merge 4 commits into
garrytan:mainfrom
getabsolutehealth:claude/windows-cookie-import
Closed

getabsolutehealth wants to merge 4 commits into
garrytan:mainfrom
getabsolutehealth:claude/windows-cookie-import

Conversation

@getabsolutehealth

Copy link
Copy Markdown

Summary

  • Windows DPAPI cookie decryption — cookie import now works on Windows via DPAPI + AES-256-GCM for v10 cookies. Supports Chrome, Edge, Brave, Arc, Comet with multi-profile detection.
  • v20 App-Bound Encryption fallback — when Chrome 127+ v20 cookies can't be decrypted, the picker UI shows a console-script fallback (paste one line in DevTools).
  • New /cookie-picker/import-raw endpoint — accepts pre-decrypted cookies for the fallback flow.
  • Platform-aware browser open — picker now opens correctly on Windows.
  • 5 review-driven fixes — cmd /c start title arg, dangling setTimeout, short buffer protection, SQLITE_CANTOPEN handling, empty domain filter.

Test Coverage

23 tests pass (0 fail). 5 new AES-256-GCM tests: round-trip, special chars, empty value, tampered auth tag, tampered ciphertext.

Pre-Landing Review

1 issue found, auto-fixed (empty domain cookies in import-raw endpoint). Adversarial review found 5 additional fixable issues — all auto-fixed.

Test plan

  • Cookie import tests pass (23 tests, 0 failures)
  • Windows AES-256-GCM round-trip decryption verified
  • Auth tag tamper detection verified
  • Pre-existing test failures triaged (unrelated: missing diff package, browse binary)

🤖 Generated with Claude Code

Anthony Pellegrino and others added 4 commits March 23, 2026 11:38
Add cross-platform cookie extraction for Windows Chromium browsers:
- Platform-aware path resolution (LOCALAPPDATA + windowsDataDir)
- DPAPI key extraction via PowerShell for v10 cookies
- AES-256-GCM decryption (Windows) alongside existing AES-128-CBC (macOS)
- Multi-profile detection (Default + Profile N directories)
- Network/Cookies path support for newer Chromium
- SQLITE_CANTOPEN handling for Windows exclusive file locks
- Informative v20 App-Bound Encryption error message
- Short buffer protection in decryptWindows
- Dangling timeout fix in DPAPI PowerShell call
- 5 new AES-256-GCM round-trip and tamper-detection tests
When Windows v20 App-Bound Encryption prevents direct decryption:
- New /cookie-picker/import-raw POST endpoint accepts pre-decrypted cookies
- Picker UI shows console-script fallback with copy button
- Script captures document.cookie and sends to gstack's import-raw endpoint
- Domain validation skips cookies without a domain
- Windows: cmd /c start '' <url> (with empty title arg)
- macOS: open <url>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@time-attack

Copy link
Copy Markdown
Contributor

@16francej Please close this PR. Windows cookie decryption and the Chrome v20 fallback already shipped in the safer #892/#1028 implementation. This branch is now redundant.

@capy-ai

capy-ai Bot commented Sep 28, 2026

Copy link
Copy Markdown

Heads up: this is superseded. #2964 shipped Windows DPAPI cookie decryption with a deliberate no-TCP-fallback / sign-in-manually policy for App-Bound (v20) cookies, and #2987 builds on that (Opera/Opera GX, a Windows v10 hash-prefix fix, actionable recovery messages). I'll close this after #2987 merges. Thanks for the early work on this path.

@capy-ai

capy-ai Bot commented Sep 28, 2026

Copy link
Copy Markdown

Closing now that #2987 has merged (v1.91.4.0), which supersedes this. Thank you!

@capy-ai capy-ai Bot closed this Sep 28, 2026
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.

2 participants