Summary
Electerm for Windows before 5.9.0 has an OS command injection flaw in folder-size calculation. If a victim requests the size of a folder whose name contains crafted Unicode quote characters, PowerShell code may run with the privileges of the Electerm user.
Affected context
The issue affects Electerm on Windows before 5.9.0 when folder names are incorporated into commands used by getFolderSizeWin() and calcLocal(). Names delivered through archives, WSL distributions, or SMB shares may be relevant if a victim later requests a folder-size calculation.
Exploit preconditions
- Attack surface: Windows folder-size calculation in Electerm
- Required access: An attacker must be able to provide or influence a file or folder name that Electerm processes
- Trigger point: The victim requests a folder-size calculation for the affected item
- Why exploitation is possible: Certain Unicode quote characters in the name can disrupt command quoting, allowing the name to be interpreted as part of a PowerShell command
Why this happens
The application incorporates file or folder names into an operating-system command without safely handling all characters that can affect command parsing. Unicode quote characters can undermine the quoting assumptions used by the Windows command construction logic. This is an OS command injection weakness, mapped to CWE-78: Improper Neutralization of Special Elements used in an OS Command.
Potential impact
- PowerShell code could execute with the privileges of the Electerm user
- An attacker may gain access to data or resources available to that user
- The affected workstation could be compromised, depending on the user's permissions and environment
General mitigation guidance
Defensive patterns for this class of issue include:
- Avoiding shell command construction when a library or direct API can perform the required operation
- Passing arguments through APIs that keep executable names and arguments separate
- Treating file and folder names as untrusted input, regardless of their source
- Applying robust argument handling rather than relying on ad hoc quoting or character filtering
- Running desktop applications with only the privileges they need
How teams detect issues like this
Review code that builds operating-system commands from paths or names, especially folder-size and file-management routines. Static analysis can flag shell execution APIs and data flowing from file names into command strings; code review can check whether arguments are passed separately and safely. Policies can restrict shell invocation where direct APIs are available, and endpoint monitoring may help identify unexpected PowerShell activity associated with the application.

