Skip to content

Electerm's full process.env exposed to renderer via window.pre.env

Moderate severity GitHub Reviewed Published May 4, 2026 in electerm/electerm • Updated May 8, 2026

Package

npm electerm (npm)

Affected versions

<= 3.8.15

Patched versions

None

Description

Impact

The getConstants() IPC handler in src/app/lib/ipc-sync.js serialises the entire process.env object and sends it to the renderer. The data is stored as window.pre.env and is accessible from any JavaScript running in the renderer (e.g., via the DevTools console or a compromised webview context).

On developer and CI machines, process.env routinely contains secrets such as:

  • AWS_SECRET_ACCESS_KEY / AWS_SESSION_TOKEN
  • GITHUB_TOKEN / NPM_TOKEN
  • OPENAI_API_KEY / DOCKER_AUTH
  • Internal service credentials, API keys, and database URLs

An attacker who achieves any JavaScript execution within the renderer—for example, through a malicious plugin, a cross-site scripting (XSS) flaw, or the terminal hyperlink execution chain—can trivially exfiltrate these secrets to a remote server, leading to cloud account compromise, supply chain attacks, and lateral movement. The exposure is visible even without any code execution by simply opening the "Info" modal in the application, though that requires local access.

Patches

A patch is yet to be available.

Workarounds

Until a patch is released:

  • Avoid launching electerm with sensitive environment variables set. Use shell scripts or a dedicated terminal profile that clears secrets before starting the application.
  • Do not install plugins from untrusted sources, and audit any installed plugins for network access.
  • Keep the renderer context as locked down as possible: disable the remote debugging port, and do not paste untrusted code into the DevTools console.

Resources

References

@zxdong262 zxdong262 published to electerm/electerm May 4, 2026
Published by the National Vulnerability Database May 8, 2026
Published to the GitHub Advisory Database May 8, 2026
Reviewed May 8, 2026
Last updated May 8, 2026

Severity

Moderate

CVSS overall score

This score calculates overall vulnerability severity from 0 to 10 and is based on the Common Vulnerability Scoring System (CVSS).
/ 10

CVSS v3 base metrics

Attack vector
Network
Attack complexity
Low
Privileges required
Low
User interaction
None
Scope
Unchanged
Confidentiality
High
Integrity
None
Availability
None

CVSS v3 base metrics

Attack vector: More severe the more the remote (logically and physically) an attacker can be in order to exploit the vulnerability.
Attack complexity: More severe for the least complex attacks.
Privileges required: More severe if no privileges are required.
User interaction: More severe when no user interaction is required.
Scope: More severe when a scope change occurs, e.g. one vulnerable component impacts resources in components beyond its security scope.
Confidentiality: More severe when loss of data confidentiality is highest, measuring the level of data access available to an unauthorized user.
Integrity: More severe when loss of data integrity is the highest, measuring the consequence of data modification possible by an unauthorized user.
Availability: More severe when the loss of impacted component availability is highest.
CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:N/A:N

EPSS score

Exploit Prediction Scoring System (EPSS)

This score estimates the probability of this vulnerability being exploited within the next 30 days. Data provided by FIRST.
(1st percentile)

Weaknesses

Exposure of Sensitive Information to an Unauthorized Actor

The product exposes sensitive information to an actor that is not explicitly authorized to have access to that information. Learn more on MITRE.

Cleartext Storage of Sensitive Information

The product stores sensitive information in cleartext within a resource that might be accessible to another control sphere. Learn more on MITRE.

CVE ID

CVE-2026-43942

GHSA ID

GHSA-37j4-88rp-2f6h

Source code

Credits

Loading Checking history
See something to contribute? Suggest improvements for this vulnerability.