Electron: contextBridge object copy honors prototype settersGHSA-ff2p-hmqr-hxm4
MEDIUMFix: electron/electron#51083GHSA-ff2p-hmqr-hxm4 is a medium-severity (CVSS 5.4) CWE-1321 vulnerability in electron. A fix is available for electron — see the affected versions and patch details below.
Exploitation Status
No confirmed exploitation observed yet
- CISA’s own triage has not observed active exploitation or public proof-of-concept code for this CVE as of its last assessment.
Exploitation and automatability from CISA’s SSVC triage for GHSA-ff2p-hmqr-hxm4.
EPSS Exploitation Probability
Probability of exploitation in the next 30 days, from FIRST.org EPSS.
How urgent is this, really
Where this sits among everything scored
Real-World Exposure
How broadly this vulnerability is actually deployed: weekly install volume shows current usage, and reverse-dependency count shows how many other packages break if it stays unpatched.
electronnpmDescription
Impact
Objects copied across the contextBridge boundary from untrusted content could carry an attacker-influenced prototype, enabling prototype-pollution-style attacks against preload code despite context isolation being enabled.
Apps are only affected if their preload code accepts object arguments from untrusted content and reads properties from them without own-property checks. Apps that only accept primitive arguments, or that validate object arguments, are not affected.
Workarounds
Validate objects received from untrusted content with own-property checks (Object.hasOwn), or copy them onto a null-prototype object before use.
Fixed Versions
42.0.0-beta.441.2.240.9.239.8.9
For more information
If you have any questions or comments about this advisory, email Electron at [email protected]
Affected Packages
| Ecosystem | Package | Vulnerable range | Fix |
|---|---|---|---|
| 📦npm | electron | all versions | 39.8.9npm install electron@39.8.9 |
| 📦npm | electron | ≥ 40.0.0-alpha.1&&< 40.9.2 | 40.9.2npm install electron@40.9.2 |
| 📦npm | electron | ≥ 41.0.0-alpha.1&&< 41.2.2 | 41.2.2npm install electron@41.2.2 |
| 📦npm | electron | ≥ 42.0.0-alpha.1&&< 42.0.0-beta.4 | 42.0.0-beta.4npm install electron@42.0.0-beta.4 |
Affected Products
electronelectronjsDetection & mitigation playbook
Open-source dependencyDetect
Scan your dependency tree (package-lock.json, pnpm-lock.yaml, requirements.txt, go.sum, etc.) for electron, including transitive dependencies — a direct dependency you never call can still pull in a vulnerable version.
Fix
Update electron to 39.8.9 or later, then make sure no transitive (indirect) dependency still pins the vulnerable range — O3 confirms GHSA-ff2p-hmqr-hxm4 is resolved across your whole dependency graph.
Workarounds
If you can't upgrade right away: gate or disable the affected feature, validate untrusted input at the boundary, and avoid passing attacker-controlled data into the vulnerable path. O3's runtime protection blocks exploitation in production as an interim safeguard until the upgrade lands.
Frequently Asked Questions
Is GHSA-ff2p-hmqr-hxm4 in your dependencies?
Find it across npm, including transitive dependencies.