{"id":"CVE-2025-61927","published":"2025-10-10T19:38:19Z","modified":"2025-10-10T19:59:09Z","title":"Happy-DOM has VM Context Escape","vendor":"capricorn86","product":"happy-dom","tier":"tail","description":{"text":"Happy DOM is a JavaScript implementation of a web browser without its graphical user interface. Happy DOM v19 and lower contains a security vulnerability that puts the owner system at the risk of RCE (Remote Code Execution) attacks. A Node.js VM Context is not an isolated environment, and if the user runs untrusted JavaScript code within the Happy DOM VM Context, it may escape the VM and get access to process level functionality. It seems like what the attacker can get control over depends on if the process is using ESM or CommonJS. With CommonJS the attacker can get hold of the `require()` function to import modules. Happy DOM has JavaScript evaluation enabled by default. This may not be obvious to the consumer of Happy DOM and can potentially put the user at risk if untrusted code is executed within the environment. Version 20.0.0 patches the issue by changing JavaScript evaluation to be disabled by default.","provenance":"source","from":"CVE.org"},"cvss":{"score":7.2,"severity":"HIGH","version":"4.0","vector":"CVSS:4.0/AV:N/AC:L/AT:P/PR:H/UI:A/VC:L/VI:H/VA:H/SC:H/SI:H/SA:H","provenance":"source","from":"CVE.org CNA"},"epss":{"score":0.00933,"percentile":0.59043,"provenance":"source"},"cwes":[{"id":"CWE-94","name":"Improper Control of Generation of Code"}],"references":[{"url":"https://github.com/capricorn86/happy-dom/security/advisories/GHSA-37j7-fg3j-429f","tags":["x_refsource_CONFIRM"]},{"url":"https://github.com/capricorn86/happy-dom/commit/819d15ba289495439eda8be360d92a614ce22405","tags":["x_refsource_MISC"]}],"priority":{"score":16.8,"factors":[{"name":"EPSS percentile","points":11.81},{"name":"CVSS severity","points":5.04}]},"vendorSlug":"capricorn86","affectedVersions":[{"vendor":"capricorn86","product":"happy-dom","versions":["< 20.0.0"]}],"ssvc":{"exploitation":"poc","automatable":"no","technicalImpact":"partial","timestamp":"2025-10-10T19:58:56.264973Z","from":"CISA ADP","provenance":"source"},"affected":[{"ecosystem":"npm","package":"happy-dom","vulnerableRanges":["<20.0.0"],"patched":["20.0.0"],"from":["GHSA-37j7-fg3j-429f"],"provenance":"source"}],"summary":{"text":"Happy-DOM, a JavaScript implementation of a headless web browser, contains a VM context escape flaw in its JavaScript evaluation feature, which is enabled by default in version 19 and lower. Exploitation requires the consumer to run untrusted JavaScript inside the Happy-DOM VM context, after which code can break out of the sandbox and reach process-level functionality, such as require() under CommonJS.","provenance":"ai","model":"claude-haiku-5-5","generatedAt":"2026-11-20T21:29:57Z"},"euvd":{"id":"EUVD-2025-33777","exploited":false,"provenance":"source"},"lineage":{"familyId":"fam-capricorn86-happy-dom-cve-2025-61927","children":[{"from":"CVE-2025-61927","to":"CVE-2025-62410","relation":"incomplete-fix","confidence":"high","kind":"lineage","evidence":[{"kind":"text","provenance":"source","relation":"incomplete-fix","quote":"This vulnerability is due to an incomplete fix for CVE-2025-61927.","from":"CVE.org","in":"CVE-2025-62410"},{"kind":"version-step","provenance":"source","package":"npm:happy-dom","fromFixed":"20.0.0","toFixed":"20.0.2","daysApart":5},{"kind":"same-code","provenance":"machine","files":["packages/@happy-dom/server-renderer/src/ServerRenderer.ts"],"commits":["https://github.com/capricorn86/happy-dom/commit/819d15ba289495439eda8be360d92a614ce22405","https://github.com/capricorn86/happy-dom/commit/de438ad72921c69793584aa657b48d3655dfac97","https://github.com/capricorn86/happy-dom/commit/f4bd4ebe3fe5abd2be2bcea1c07043c8b0b70eea"],"basis":"shared function","functions":["ServerRenderer"]}]},{"from":"CVE-2025-61927","to":"CVE-2026-115895","relation":"related","confidence":"medium","kind":"lineage","evidence":[{"kind":"same-code","provenance":"machine","files":["packages/happy-dom/src/module/ECMAScriptModuleCompiler.ts"],"commits":["https://github.com/capricorn86/happy-dom/commit/819d15ba289495439eda8be360d92a614ce22405","https://github.com/capricorn86/happy-dom/commit/de438ad72921c69793584aa657b48d3655dfac97","https://github.com/capricorn86/happy-dom/commit/fd163520b74d9fa146be91f7b4e4f46d6cccbe13"],"basis":"shared function","functions":["ECMAScriptModuleCompiler"]}]},{"from":"CVE-2025-61927","to":"CVE-2026-118660","relation":"related","confidence":"medium","kind":"lineage","evidence":[{"kind":"same-code","provenance":"machine","files":["packages/@happy-dom/server-renderer/src/utilities/HelpPrinterRows.ts","packages/@happy-dom/server-renderer/src/utilities/ProcessArgumentsParser.ts","packages/happy-dom/src/browser/DefaultBrowserSettings.ts","packages/happy-dom/src/browser/types/IBrowserSettings.ts","packages/happy-dom/src/browser/types/IOptionalBrowserSettings.ts"],"commits":["https://github.com/capricorn86/happy-dom/commit/819d15ba289495439eda8be360d92a614ce22405","https://github.com/capricorn86/happy-dom/commit/de438ad72921c69793584aa657b48d3655dfac97","https://github.com/capricorn86/happy-dom/commit/0a99c7525a1d0043e3182843ae33466ab7b19e74"],"basis":"shared function","functions":["HTMLLinkElement","IBrowserSettings","IOptionalBrowserSettings","ProcessArgumentsParser"]}]},{"from":"CVE-2025-61927","to":"CVE-2026-33943","relation":"related","confidence":"medium","kind":"lineage","evidence":[{"kind":"same-code","provenance":"machine","files":["packages/happy-dom/src/module/ECMAScriptModuleCompiler.ts"],"commits":["https://github.com/capricorn86/happy-dom/commit/819d15ba289495439eda8be360d92a614ce22405","https://github.com/capricorn86/happy-dom/commit/de438ad72921c69793584aa657b48d3655dfac97","https://github.com/capricorn86/happy-dom/commit/5437fdf8f13adb9590f9f52616d9f69c3ee8db3c"],"basis":"shared function","functions":["ECMAScriptModuleCompiler"]}]}],"packageHistory":[{"cve":"CVE-2024-51757","published":"2024-11-06","fixed":"15.10.2","kev":false},{"cve":"CVE-2025-61927","published":"2025-10-10","fixed":"20.0.0","kev":false},{"cve":"CVE-2025-62410","published":"2025-10-15","fixed":"20.0.2","kev":false},{"cve":"CVE-2026-33943","published":"2026-03-27","fixed":"20.8.8","kev":false},{"cve":"CVE-2026-34226","published":"2026-03-27","fixed":"20.8.9","kev":false}],"package":"npm:happy-dom"}}