Skip to main content

electron-betterauth

Enables secure authentication in Electron apps using BetterAuth with OS-level token encryption and automatic token refresh.

Install this skill

or
0/100

Security score

The electron-betterauth skill was audited on Mar 8, 2026 and we found 24 security issues across 4 threat categories, including 6 high-severity. Review the findings below before installing.

Categories Tested

Security Issues

medium line 173

Template literal with variable interpolation in command context

SourceSKILL.md
173return { success: false, error: `Encryption failed: ${error}` };
medium line 189

Template literal with variable interpolation in command context

SourceSKILL.md
189return { success: false, error: `Decryption failed: ${error}` };
medium line 198

Template literal with variable interpolation in command context

SourceSKILL.md
198return { success: false, error: `Delete failed: ${error}` };
medium line 207

Template literal with variable interpolation in command context

SourceSKILL.md
207return { success: false, error: `Clear failed: ${error}` };
medium line 430

Template literal with variable interpolation in command context

SourceSKILL.md
430context.headers.set("Authorization", `Bearer ${result.data}`);
medium line 521

Template literal with variable interpolation in command context

SourceSKILL.md
521throw new Error(`Failed to store tokens: ${tokenResult.error}`);
medium line 661

Template literal with variable interpolation in command context

SourceSKILL.md
661const response = await fetch(`${API_BASE_URL}/api/auth/refresh`, {
medium line 695

Template literal with variable interpolation in command context

SourceSKILL.md
695headers: { ...options.headers, Authorization: `Bearer ${accessToken}` },
medium line 706

Template literal with variable interpolation in command context

SourceSKILL.md
706headers: { ...options.headers, Authorization: `Bearer ${newToken}` },
medium line 745

Template literal with variable interpolation in command context

SourceSKILL.md
745const url = `${API_BASE_URL}${path}`;
medium line 753

Template literal with variable interpolation in command context

SourceSKILL.md
753...(accessToken ? { Authorization: `Bearer ${accessToken}` } : {}),
high line 20

Access to system keychain/keyring

SourceSKILL.md
20multi-process architecture, BetterAuth's session model, and OS keychain services
high line 29

Access to system keychain/keyring

SourceSKILL.md
29- Storing tokens securely in a desktop app with OS keychain encryption
high line 54

Access to system keychain/keyring

SourceSKILL.md
54keychain
medium line 66

Access to system keychain/keyring

SourceSKILL.md
66- NEVER sees raw encryption keys or OS keychain
medium line 79

Access to system keychain/keyring

SourceSKILL.md
79- Owns safeStorage API (OS keychain access)
medium line 165

Access to system keychain/keyring

SourceSKILL.md
165// 1. Encrypt with OS keychain
high line 213

Access to system keychain/keyring

SourceSKILL.md
213keychain but does NOT persist. `electron-store` persists but does NOT encrypt.
medium line 483

Access to system keychain/keyring

SourceSKILL.md
483// 1. Check if OS keychain is available (Linux edge case)
high line 880

Access to system keychain/keyring

SourceSKILL.md
880`safeStorage.encryptString()` uses the OS keychain to encrypt a string, but it
high line 891

Access to system keychain/keyring

SourceSKILL.md
891gnome-keyring or KWallet. You must check availability before any auth operations
low line 185

Buffer.from base64 decode

SourceSKILL.md
185const encrypted = Buffer.from(base64, "base64");
low line 415

External URL reference

SourceSKILL.md
415baseURL: "https://your-api.example.com", // Your API server
low line 643

External URL reference

SourceSKILL.md
643const API_BASE_URL = "https://your-api.example.com";
Scanned on Mar 8, 2026
View Security Dashboard