# CVE-2024-39698: Code Signing Bypass on Windows in electron-updater < 6.3.0-alpha.6

> Attackers can bypass Windows code signature verification in electron-updater to execute malicious updates if the update manifest is compromised.

- **Severity:** High 7.5 (`CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:U/C:H/I:H/A:H`)
- **Exploited in the wild:** Not known
- **Login needed:** Not needed
- **Attackable:** Over the internet
- **Victim action needed:** A user has to click or open something
- **Fix available:** Yes
- **Published:** 9 Jul 2024
- **Updated:** 2 Aug 2024
- **Also known as:** GHSA-9jxc-qjr9-vjxq

## What is CVE-2024-39698?

CVE-2024-39698 is a high-severity vulnerability in electron-userland electron-builder, published on 9 Jul 2024. An attacker can exploit it over the internet without logging in, and only if a user opens a file or follows a link.

### Official description

electron-updater allows for automatic updates for Electron apps. The file `packages/electron-updater/src/windowsExecutableCodeSignatureVerifier.ts` implements the signature validation routine for Electron applications on Windows. Because of the surrounding shell, a first pass by `cmd.exe` expands any environment variable found in command-line above. This creates a situation where `verifySignature()` can be tricked into validating the certificate of a different file than the one that was just downloaded. If the step is successful, the malicious update will be executed even if its signature is invalid. This attack assumes a compromised update manifest (server compromise, Man-in-the-Middle attack if fetched over HTTP, Cross-Site Scripting to point the application to a malicious updater server, etc.). The patch is available starting from 6.3.0-alpha.6.

Weakness: CWE-295 (Improper Certificate Validation), CWE-154 (Improper Neutralization of Variable Name Delimiters)

## Which versions are affected by CVE-2024-39698?

2 open source packages ship an affected version, including electron-updater. It affects 1 product.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `electron-updater` | npm | All versions | 6.3.0-alpha.6 |
| `electron-updater` | npm | All versions | 6.3.0-alpha.6 |

Products: Electron Electron-Builder.

## How do I fix CVE-2024-39698?

Upgrade electron-updater to 6.3.0-alpha.6 or later.

## Is CVE-2024-39698 being exploited?

It is not confirmed as exploited in the wild, but public exploit code for CVE-2024-39698 exists.

## Other vulnerabilities in electron-userland electron-builder

- [CVE-2026-54672](https://insights.sbomify.com/CVE-2026-54672/): electron-updater: Uncontrolled search path elements within `AppImage` built by `app-builder-lib` (high 7.8)
- [CVE-2024-27303](https://insights.sbomify.com/CVE-2024-27303/): electron-builder's NSIS installer - execute arbitrary code on the target machine (Windows only) (high 7.3)

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2024-39698 and fix it if it is affected.

What it is: CVE-2024-39698 is a high-severity vulnerability in electron-userland electron-builder, published on 9 Jul 2024. An attacker can exploit it over the internet without logging in, and only if a user opens a file or follows a link.
Exploitation: It is not confirmed as exploited in the wild, but public exploit code for CVE-2024-39698 exists.

Affected packages and fixed versions:
- electron-updater (npm): affected all versions; fixed in 6.3.0-alpha.6
- electron-updater (npm): affected all versions; fixed in 6.3.0-alpha.6

Task:
1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.
2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.
3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.
4. Run the tests and summarise what changed and why.
5. If nothing in the project is affected, say so and change nothing.

Reference: https://insights.sbomify.com/CVE-2024-39698/ (Markdown: https://insights.sbomify.com/CVE-2024-39698/index.md)
```

## Sources

- CVE record: https://www.cve.org/CVERecord?id=CVE-2024-39698
- NVD: https://nvd.nist.gov/vuln/detail/CVE-2024-39698
- OSV: https://osv.dev/vulnerability/CVE-2024-39698

---
From sbomify Insights: https://insights.sbomify.com/CVE-2024-39698/
Summaries are generated and may contain mistakes; the official description above is the record.
