CVE-2024-29900
Executive Summary
CVE-2024-29900 is a medium-severity information disclosure vulnerability in Electron Packager, a tool used to bundle Electron-based applications into distributable executables. The vulnerability arises from a memory leak where a random segment of Node.js heap memory (approximately 1-10KB) is inadvertently included in the final packaged executable. This leaked memory may contain sensitive information such as environment variables, secrets files, API keys, or other confidential data processed by the application during the packaging process. The issue is patched in version 18.3.1. The CVSS score is 7.5 (High), with a vector of CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N, indicating network-based exploitation with no privileges required and no user interaction, but only affecting confidentiality.
This record — and 170,000+ others — are available via the ValtersIT API. One endpoint replaces five: NVD + GitHub CVE + CISA KEV + EPSS + Nuclei + Exploit-DB, unified.
No signup required
Supply Chain & Package Security
This vulnerability is specific to the Electron Packager npm package. Organizations using Electron Packager to distribute applications should treat this as a supply chain risk, as the leaked memory could expose secrets from the build environment. The package is widely used in the Electron ecosystem, and the vulnerability affects all versions prior to 18.3.1.
CVSS Breakdown & Threat Level
- CVSS Score: 7.5 (High)
- Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N
- Attack Vector: Network (AV:N) – The vulnerability can be exploited remotely.
- Attack Complexity: Low (AC:L) – No special conditions required.
- Privileges Required: None (PR:N) – No authentication needed.
- User Interaction: None (UI:N) – No user action required.
- Scope: Unchanged (S:U) – The vulnerability does not affect other components.
- Confidentiality Impact: High (C:H) – Sensitive data can be exposed.
- Integrity Impact: None (I:N) – No data modification.
- Availability Impact: None (A:N) – No denial of service.
Threat Level: High. The vulnerability allows an attacker to extract sensitive information from packaged Electron applications, potentially leading to further compromise of systems or data.
Deep Dive & Mechanics
The vulnerability exists in the Electron Packager tool, which is used to create distributable executables from Electron applications. During the packaging process, the tool reads the application source code and bundles it with a renamed Electron executable and supporting files. A bug in the memory management of Node.js causes a random segment of heap memory (approximately 1-10KB) to be included in the final executable. This memory is allocated adjacent to a known buffer and is not properly cleared before being written to the output file.
The leaked memory can contain any data that was present in the Node.js heap at the time of packaging, including:
- Environment variables (e.g., API keys, database credentials)
- Secrets files (e.g., .env, config files)
- In-memory tokens or session data
- Other sensitive information processed by the application
The vulnerability is triggered automatically during the packaging process, without any user interaction. An attacker who obtains the packaged executable can analyze the binary to extract the leaked memory segment.
Vulnerable vs. Patched Code
Vulnerable Code (versions < 18.3.1): The vulnerable code does not properly clear or sanitize memory buffers before writing them to the output file. The exact vulnerable code is not publicly disclosed, but the issue is related to how Node.js heap memory is handled during the packaging process.
Patched Code (version 18.3.1): The patch ensures that memory buffers are properly cleared or that sensitive data is not inadvertently included in the output. The specific fix involves zeroing out memory segments or using secure memory allocation practices.
Exploitation & Lab Setup
Red Team
Exploitation Steps:
- Obtain a packaged Electron application that was built with a vulnerable version of Electron Packager (prior to 18.3.1).
- Analyze the executable binary using a hex editor or memory analysis tool (e.g.,
strings,binwalk, or a custom script). - Search for patterns that indicate leaked memory, such as environment variable names, JSON structures, or other sensitive data.
- Extract the leaked memory segment (approximately 1-10KB) and parse it for sensitive information.
Example Command:
strings vulnerable-app.exe | grep -E "(API_KEY|SECRET|PASSWORD|TOKEN)"
Lab Setup:
- Use a vulnerable version of Electron Packager (e.g., 18.3.0) to package a test application.
- Include environment variables or a secrets file in the build environment.
- Analyze the resulting executable to observe the memory leak.
Blue Team
Detection Steps:
- Monitor for the use of vulnerable Electron Packager versions in build pipelines.
- Scan packaged executables for signs of memory leaks using static analysis tools.
- Implement runtime monitoring to detect if a packaged application is leaking memory.
Mitigation:
- Upgrade to Electron Packager version 18.3.1 or later.
- Ensure that build environments do not contain sensitive data in memory during packaging.
- Use secure build practices, such as running builds in isolated containers with minimal secrets.
Indicators of Compromise (IOCs)
- File Hashes: (None provided; generate during analysis)
- Network Indicators: (None; vulnerability is local to the packaged executable)
- Behavioral Indicators:
- Packaged executables containing unexpected strings or data patterns (e.g., environment variable names, JSON structures).
- Executables with unusually large or random data segments.
- YARA Rule: (See Detection Engineering)
Detection Engineering
YARA Rule
rule CVE_2024_29900_Memory_Leak {
meta:
description = "Detects potential memory leak from Electron Packager CVE-2024-29900"
author = "Valters IT"
date = "2024-01-01"
reference = "CVE-2024-29900"
strings:
$env_var = /[A-Z_]+=[A-Za-z0-9_]+/ nocase
$secret_pattern = /(secret|token|password|api_key|key)/ nocase
$json_pattern = /{"[^"]+":\s*"[^"]+"}/
condition:
any of ($env_var) or any of ($secret_pattern) or any of ($json_pattern)
}
Sigma Rule
title: CVE-2024-29900 Memory Leak Detection
id: 12345678-1234-1234-1234-123456789012
status: experimental
description: Detects potential memory leak from Electron Packager CVE-2024-29900
author: Valters IT
date: 2024-01-01
references:
- https://nvd.nist.gov/vuln/detail/CVE-2024-29900
logsource:
category: process_creation
product: windows
detection:
selection:
Image|endswith: '\electron.exe'
CommandLine|contains: '--packager'
condition: selection
falsepositives:
- Legitimate use of Electron Packager
level: medium
Suricata Rule
alert tcp any any -> any any (msg:"CVE-2024-29900 Memory Leak Detection"; flow:to_server; content:"|00|"; depth:1; offset:0; content:"|00|"; within:10240; reference:cve,2024-29900; classtype:attempted-recon; sid:1000001; rev:1;)
Remediation & Mitigation
Immediate Actions:
- Upgrade Electron Packager to version 18.3.1 or later.
- Rebuild any packaged applications that were created with vulnerable versions.
- Rotate any secrets or credentials that may have been exposed in the leaked memory.
Long-Term Mitigations:
- Implement secure build practices, such as running builds in isolated environments with minimal secrets.
- Use memory-safe programming practices and tools to prevent memory leaks.
- Regularly audit build tools and dependencies for vulnerabilities.
Patch Details:
- Upgrade to Electron Packager version 18.3.1.
- The patch is available via npm:
npm install electron-packager@18.3.1
Valters IT Signature This report was generated by Valters IT Cyber Threat Intelligence. For more information, visit https://valters.it