Quasar: Compromising Electron Apps
Electron apps install their application files to user-writeable directories and package them in easily unpackable ASAR archives without integrity checking. An attacker with local access could modify these files to inject malicious code, achieving code execution and UI manipulation.
We all kinda know that Electron apps are dangerous—at least to our RAM, am I right??
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
Root cause
Likely the root cause is that Electron apps are installed to user-writeable directories and their ASAR archives are not integrity-checked, allowing local modification of application code.
Impact
An attacker with local access could execute arbitrary code and manipulate the app's user interface, potentially leading to further compromise.
What the attacker needed
Local access to the victim's machine; ability to write to the app's installation directory
The fix
The text does not state a fix; it notes that cryptographic signing of ASAR files is not being considered and suggests detections for unexpected process execution and file modifications.
How it was found
- Locate the app.asar file in the user-writeable installation directory.
- Extract the ASAR archive using a tool such as the 7-Zip plugin.
- Modify a JavaScript file (e.g., main.bundle.js) to include code that uses child_process.
- Repack the modified files into an ASAR archive.
- Replace the original app.asar with the modified one.
- Launch the Electron app to execute the injected code.
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.
Electron is a framework for building desktop apps using web technologies. These apps store their code in a special archive file that any user can open and change. Because the app does not verify that the code is unchanged, someone with access to the computer can alter the code to run their own programs or change what the app displays.
What is Misconfiguration?
Settings left unsafe: exposed panels, open storage buckets, debug modes, default credentials.