Skip to content
This repository has been archived by the owner on Nov 4, 2024. It is now read-only.

Security Vulnerability "/_data_/…/storage/cfg/…/…/accounts" #2134

Open
the-djmaze opened this issue Nov 10, 2021 · 1 comment
Open

Comments

@the-djmaze
Copy link
Contributor

the-djmaze commented Nov 10, 2021

RainLoop version, browser, OS:
v1.16

Expected behavior:
File can't be decrypted on (backup) server.

actual behavior:
File can be decrypted on (backup) server.

Steps to reproduce the problem:
When calling \RainLoop\Actions->SetAccounts()
It will store an array of values from \RainLoop\Model\Account->GetAuthToken()
Which in turn calls \RainLoop\Utils::EncodeKeyValues()
And that calls \RainLoop\Utils::EncryptString(@\serialize($aValues), \md5(APP_SALT))

When someone/something has access to the SALT.php file,
it can decode the encrypted accounts and gain all passwords.

These days with server breaches, ransomware, other attacks and the increase of backup behavior, the chance of being listed on "have i been pwned" has increased and the above mentioned issue becomes a bigger vulnerability.

Solutions:

  1. Encrypting the file based on user cookie is very unreliable and has a high fail rate.
  2. Encrypting with a server stored key (like the SALT.php) opens this issue
  3. Encrypting using the main account password (the login) fails when password is changed or when using OAUTHBEARER/XOAuth2
  4. Only encrypting the account passwords with (3) keeps the accounts, but only login will fail.

With (4) you could store an HMAC of the encrypted password to check if the account login works.

Same issue applies to the 'contacts_sync' file

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants