Skip to content

Add Linux cookie/token decryption for Slack and Discord#35

Merged
devxoul merged 2 commits intomainfrom
fix/linux-cookie-decryption
Mar 5, 2026
Merged

Add Linux cookie/token decryption for Slack and Discord#35
devxoul merged 2 commits intomainfrom
fix/linux-cookie-decryption

Conversation

@devxoul
Copy link
Owner

@devxoul devxoul commented Mar 5, 2026

Summary

  • Linux Chromium-based apps encrypt cookies/tokens using a hardcoded peanuts password via pbkdf2('peanuts', 'saltysalt', 1, 16, 'sha1'). The Teams extractor already had this, but Slack and Discord were missing it entirely — all Linux users got empty cookies/null tokens and auth failures.

Changes

src/platforms/slack/token-extractor.ts

  • Add decryptV10CookieLinux() method using the peanuts-derived key for AES-128-CBC decryption.
  • Route linux platform to the new method in tryDecryptCookie() before falling through to the macOS Keychain path.

src/platforms/discord/token-extractor.ts

  • Add decryptLinuxToken() method using the same peanuts-derived key, delegating to existing decryptAESCBC().
  • Route linux platform to the new method in decryptToken().

Tests

  • Slack: end-to-end test encrypting a cookie with the Linux key and verifying round-trip decryption.
  • Discord: unit test encrypting a token with the Linux key and verifying decryptToken() returns the plaintext.

Verified

  • bun test — 51 pass, 0 fail (across both test files).
  • bun typecheck — clean.
  • bun lint — clean, 166 files checked.

Summary by cubic

Adds Linux decryption for Slack cookies and Discord tokens using Chromium’s hardcoded “peanuts” key to fix null cookies/tokens and auth failures for Linux users.

  • Bug Fixes
    • Slack: added decryptV10CookieLinux (AES-128-CBC with PBKDF2 “peanuts” + “saltysalt”, IV of spaces) and routed linux in tryDecryptCookie.
    • Discord: added decryptLinuxToken and routed linux in decryptToken.
    • Tests: added Linux-specific tests; all pass, typecheck and lint clean.

Written for commit ba35dff. Summary will update on new commits.

devxoul added 2 commits March 5, 2026 21:25
Linux Chromium uses a hardcoded 'peanuts' password for cookie encryption.
The Teams extractor already had this but Slack was missing it, causing all
Linux users to get empty cookies and auth failures.
Same missing Linux decryption as Slack — encrypted tokens on Linux use the
Chromium hardcoded 'peanuts' password but Discord had no Linux path,
returning null for all encrypted tokens.
@vercel
Copy link

vercel bot commented Mar 5, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated (UTC)
agent-messenger Ignored Ignored Mar 5, 2026 0:25am

Request Review

Copy link

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 4 files

@devxoul devxoul merged commit bbc1e9c into main Mar 5, 2026
5 checks passed
@devxoul devxoul deleted the fix/linux-cookie-decryption branch March 5, 2026 12:34
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.

1 participant