Skip to content
Info disclosure Write-up Intermediate

Electron-Based App Security Testing Fundamentals Part 3 (2nd Section) — Extracting and Analyzing .asar Files

The application stored the encryption key, IV, and salt in the same SQLite database as the encrypted credentials, and the decryption algorithm was present in the extracted app.asar file. An attacker with local access could decrypt the stored credentials and reuse them elsewhere.

YoKo Kho Follow

Published on firstsight.me

Information Disclosure of Hardcoded Keys (in SQLite) and Encryption Algorithm (in AesFormula.js File) Resulting in Compromised the Real Credentials.

YoKo Kho, on firstsight.me

The full write-up lives on its author's site

It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.

Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.

How it worked

Impact

An attacker with local access could decrypt the stored credentials and use them outside the local machine, bypassing time constraints of local access.

What the attacker needed

Local access to the victim's machine; the 'Remember my key' feature enabled

The fix

The application should use the Electron safeStorage module or OS-level secure storage to protect the encryption key material, rather than storing it alongside the encrypted data.

How it was found

  1. Log in with the 'Remember my key' option enabled.
  2. Search the application's data directories for the username.
  3. Find the username in a SQLite database file within a hidden directory.
  4. Open the database and locate the encrypted key, URL, and username.
  5. Extract the app.asar file and find the AesFormula.js file containing the decryption logic.
  6. Use the stored encryptionMaterial values with the decryption function to recover the plaintext key.

Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.

Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.

When an app offers to remember your password, it often saves it on your computer. Here, the app scrambled the password but also saved the unscrambling recipe right next to it. Anyone who could read those files could recover the real password.

What is Info disclosure?

Data the application should keep private (personal data, internal details, other users' records) reaches someone it should not.

More by YoKo Kho

View all

3 more disclosed reports, best first.

Similar reports

View all

Same bug class and techniques, clearest first.

Information disclosure

The lesson behind this report.

Data the application should keep private (personal data, internal details, other users' records) reaches someone it should not.