DEV Community

andreagomez
andreagomez

Posted on

A Unicode quote in a folder name can become PowerShell in Electerm

A Unicode quote in a folder name can become PowerShell in Electerm

CVE-2026-134793 affects Electerm before 5.9.0 on Windows. The flaw lets a crafted file or folder name containing the Unicode right single quotation mark, U+2019, break out of quoting in calls such as getFolderSizeWin() and calcLocal(). The advisory says the resulting command runs PowerShell as the Electerm user. The CVSS 3.1 score is 7.8, and the fixed release is 5.9.0.

Why a filename crosses the command boundary

Windows file names can contain characters that look like punctuation but do not behave like the ASCII quote a command builder expects. If a developer-facing tool concatenates a path into a PowerShell command string, the Unicode character can end the intended quoted section early. The rest of the name then becomes command syntax.

The advisory names archives, WSL distributions and SMB shares as possible delivery paths. Those are practical because a user may first inspect the archive in Electerm and only trigger folder-size calculation when browsing into the extracted content. A shared folder can carry the same problem without an archive.

This is not a remote service vulnerability in the usual sense. It requires a file or folder name the victim handles and a user action that invokes the vulnerable function. The reward for an attacker is code execution in the user's session. On a developer workstation, that session may have access to SSH keys, cloud credentials, repositories, browser profiles and internal network routes.

Patch first, then inspect

Update Electerm to 5.9.0 or later on Windows endpoints. Confirm the running application version and restart the process so the old executable is no longer resident. Packaging and software inventory should include portable copies, not only the centrally installed package.

Before the update, avoid opening untrusted archives or shared folders through the affected folder-size features. Disabling the feature is safer only if the product supports that control and the user understands the change. Blocking all names with U+2019 at a file gateway may reduce one delivery path, but it is not a complete fix because the vulnerable tool still constructs a command from a path.

After the update, search endpoint and file-share logs for the relevant folder names, but expect that many systems normalize or escape Unicode. Look for the creation of files with unusual punctuation near the time of suspicious PowerShell activity. PowerShell script-block logging, process creation events and command-line telemetry can help determine whether a file-name operation launched code. A logged file name alone is not proof that command injection occurred.

If execution is suspected, capture the PowerShell command line, parent process and user context. Review recent downloads, archive extraction and SMB access. Rotate credentials that were reachable from the user's profile, including cloud tokens and Git credentials. Check startup folders, scheduled tasks and shell profiles for persistence. A command that ran once may leave no executable file in the directory that carried the crafted name.

Make path handling boring

Command construction should use native argument arrays or a shell API that separates arguments from the executable. String concatenation is especially fragile when the input can contain quotes, newlines or characters outside the ASCII range. The fix also needs tests with Unicode lookalikes, not only " and '.

Electerm is useful precisely because it places local files, remote sessions and terminal operations in one window. That concentration also raises the value of a desktop command injection. Updating every Windows copy and reviewing PowerShell evidence is the practical response.

References

Top comments (0)