Electron AppImage Vulnerability Allows Arbitrary Code Execution via Path Hijacking (CVE-2026-54672)
A high-severity vulnerability (CVE-2026-54672) in the `app-builder-lib` component of Electron Builder allows an attacker to achieve arbitrary code execution by placing a malicious shared library in the current working directory when a vulnerable AppImage is executed, due to an uncontrolled search path element in the `LD_LIBRARY_PATH` environment variable.
A critical vulnerability, tracked as CVE-2026-54672, has been identified in app-builder-lib versions prior to 26.15.0 and its upstream dependency app-builder-bin. This flaw affects AppImages built with these toolsets, primarily impacting Linux systems. The vulnerability stems from an uncontrolled search path element in the LD_LIBRARY_PATH environment variable. Specifically, when LD_LIBRARY_PATH is not explicitly set at launch time, the AppRun script generated by app-builder-lib (or app-builder-bin) can introduce an empty path component, effectively adding the current working directory to the dynamic linker's search path. This allows an attacker who can place a malicious shared library (e.g., libfoo.so) in the same directory as a vulnerable AppImage to achieve arbitrary code execution with the privileges of the user who launches the AppImage. This issue is similar to CVE-2024-41817 and underscores the risks associated with dynamic linker search order vulnerabilities.
Attack Chain
- Vulnerable Application Identification: An attacker identifies a vulnerable
AppImagebuilt withapp-builder-lib < 26.15.0orapp-builder-bin, present on a Linux system. - User-Writable Directory Placement: The attacker finds or manipulates the victim into placing the vulnerable
AppImagein a user-writable directory (e.g.,/tmp, a user's home directory). - Malicious Library Creation: The attacker crafts a malicious shared library (e.g.,
libfoo.so) designed to perform arbitrary actions, such as establishing a reverse shell or exfiltrating data. - Library Deployment: The attacker places the malicious shared library in the same user-writable directory as the vulnerable
AppImage. - Execution with Compromised Environment: The victim executes the vulnerable
AppImagefrom this compromised directory. - Dynamic Linker Path Resolution: During
AppImageexecution, theAppRunscript, due to the vulnerability, setsLD_LIBRARY_PATHwith a trailing colon when the variable is unset. - Library Hijacking: This trailing colon causes the dynamic linker to include the current working directory in its search path, leading it to load the malicious shared library from that directory instead of the legitimate one.
- Arbitrary Code Execution: The malicious code within the attacker's shared library is executed with the privileges of the victim user, resulting in arbitrary code execution and potential system compromise.
Impact
Successful exploitation of this vulnerability grants an attacker arbitrary code execution capabilities on the affected Linux system. The code will execute with the privileges of the user who launched the vulnerable AppImage. This can lead to a wide range of malicious activities, including system compromise, data exfiltration, installation of further malware, or lateral movement within the network. Organizations using Electron-based AppImages built with affected versions of app-builder-lib are at risk, particularly if users frequently execute applications from untrusted or world-writable directories.
Recommendation
- Patch
app-builder-libto version26.15.0or newer immediately to mitigate CVE-2026-54672 in newly built AppImages. - Educate users to avoid running
AppImagefiles from world-writable directories such as/tmpor untrusted download locations. - Ensure that existing vulnerable AppImages (built with
app-builder-lib < 26.15.0orapp-builder-bin) are updated or rebuilt with the patched version. - Set
LD_LIBRARY_PATHto a non-empty value before launching AppImages if patching is not immediately possible to prevent the empty path component.