Security: User ID exposure in Beancount ledger accounts #8
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Problem
Castle currently uses LNbits
user_id(truncated to 8 chars) in Beancount account names:Assets:Receivable:User-c32bb2c8Liabilities:Payable:User-c32bb2c8Security risk: LNbits allows login with just the
user_id(no password required by default). Anyone with read access to the ledger file could potentially extract user IDs and gain access to those LNbits accounts.Current Exposure Points
Options to Consider
Option 1: Disable user_id login in LNbits (Recommended short-term)
LNBITS_ALLOW_URL_LOGIN=falseOption 2: Use a derived pseudonymous identifier
hash(user_id + castle_salt)Option 3: Use usernames instead of IDs
Liabilities:Payable:User-aliceOption 4: Use wallet_id instead
Option 5: Encrypt/obfuscate identifiers in ledger
Recommendation
Short-term: Enable
LNBITS_ALLOW_URL_LOGIN=falseon production serversLong-term: Implement Option 2 (derived pseudonymous identifier) with:
Related Files
account_utils.py- Account naming logicfava_client.py- User ID usage in queriescrud.py- Database operations with user IDsviews_api.py- API endpoints exposing user data