{"id":"CVE-2025-61927","revision":null,"records":[{"revision":"140d37dafc864e6f9ea55ff25f266427","observedAt":"2026-10-23T15:48:27.903+00:00","statement":{"source":"cve-program","id":"CVE-2025-61927","aliases":[],"title":"Happy-DOM has VM Context Escape","description":"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.","state":0,"publishedAt":"2025-10-10T19:38:19.835+00:00","modifiedAt":"2025-10-10T19:59:09.406+00:00","affected":[{"ecosystem":"Vendor product","name":"happy-dom","ranges":[],"versions":[],"rawVersionEvidence":"{\n                    \"vendor\": \"capricorn86\",\n                    \"product\": \"happy-dom\",\n                    \"versions\": [\n                        {\n                            \"version\": \"< 20.0.0\",\n                            \"status\": \"affected\"\n                        }\n                    ]\n                }"}],"metrics":[{"system":"CVSS 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","score":7.2,"severity":"HIGH"}],"references":["https://github.com/capricorn86/happy-dom/security/advisories/GHSA-37j7-fg3j-429f","https://github.com/capricorn86/happy-dom/commit/819d15ba289495439eda8be360d92a614ce22405"],"sourceUrl":"https://www.cve.org/CVERecord?id=CVE-2025-61927","license":"CVE Program Terms of Use","key":"cve-program:CVE-2025-61927","identifiers":["CVE-2025-61927"]},"retained":false,"historicalAffected":[]},{"revision":"27690708d7214b6ab3e1a063fbe67ea5","observedAt":"2026-11-11T04:29:52.883+00:00","statement":{"source":"euvd","id":"EUVD-2025-33777","aliases":["CVE-2025-61927","GHSA-37j7-fg3j-429f"],"title":"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.…","description":"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.","state":0,"publishedAt":null,"modifiedAt":null,"affected":[],"metrics":[{"system":"EUVD CVSS 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","score":7.2,"severity":null}],"references":["https://github.com/capricorn86/happy-dom/security/advisories/GHSA-37j7-fg3j-429f","https://github.com/capricorn86/happy-dom/commit/819d15ba289495439eda8be360d92a614ce22405"],"sourceUrl":"https://euvd.enisa.europa.eu/vulnerability/EUVD-2025-33777","license":"ENISA EUVD · source terms and attribution apply","enrichment":{"sourceStatus":null,"weaknesses":[],"productCriteria":[],"sourceDates":{"datePublished":"Oct 10, 2025, 7:38:19 PM","dateUpdated":"Oct 10, 2025, 7:59:09 PM"},"relatedAdvisories":[{"id":"RHSA-2025:23225","title":"Red Hat Security Advisory: Red Hat OpenShift Dev Spaces 3.25.0 Release.","vulnerabilityIds":["CVE-2024-4067","CVE-2025-55247","CVE-2025-55248","CVE-2025-55315","CVE-2025-55752","CVE-2025-61927","CVE-2025-66516"]}],"note":"EUVD source date text has no stated timezone and is retained without inventing a UTC instant. Related bulletin membership is not an alias, common cause or applicability claim. A missing vector with a zero score is treated as unrated. Complete vendor/product and underlying source evidence remains in the original JSON."},"key":"euvd:EUVD-2025-33777","identifiers":["EUVD-2025-33777","CVE-2025-61927","GHSA-37j7-fg3j-429f"]},"retained":false,"historicalAffected":[]},{"revision":"64f5c538f7894674917c63c312a099f3","observedAt":"2026-10-25T03:17:27.277+00:00","statement":{"source":"nvd","id":"CVE-2025-61927","aliases":[],"title":"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.…","description":"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.","state":0,"publishedAt":"2025-10-10T20:15:38.43+00:00","modifiedAt":"2026-10-08T13:10:00.2+00:00","affected":[],"metrics":[{"system":"CVSS 4.0 · security-advisories@github.com · Secondary","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/E:X/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X","score":7.2,"severity":"HIGH"}],"references":["https://github.com/capricorn86/happy-dom/commit/819d15ba289495439eda8be360d92a614ce22405","https://github.com/capricorn86/happy-dom/security/advisories/GHSA-37j7-fg3j-429f"],"sourceUrl":"https://nvd.nist.gov/vuln/detail/CVE-2025-61927","license":"NIST NVD usage terms; underlying source attribution retained","enrichment":{"sourceStatus":"Deferred","weaknesses":["CWE-94"],"productCriteria":[],"sourceDates":{"published":"2025-10-10T20:15:38.430","lastModified":"2026-10-08T13:10:00.200"},"relatedAdvisories":[],"note":"NVD analysis and CPE criteria are source context, not proof that a package or your environment is affected. Complete affected data, logical configurations and SSVC are retained in the original JSON."},"key":"nvd:CVE-2025-61927","identifiers":["CVE-2025-61927"]},"retained":false,"historicalAffected":[]},{"revision":"926f376f038b499eb4a064ec645f4eb1","observedAt":"2026-10-24T13:17:17.793+00:00","statement":{"source":"osv","id":"GHSA-37j7-fg3j-429f","aliases":["CVE-2025-61927"],"title":"Happy DOM: VM Context Escape can lead to Remote Code Execution","description":"# Escape of VM Context gives access to process level functionality\n\n## Summary\nHappy DOM v19 and lower contains a security vulnerability that puts the owner system at the risk of RCE (Remote Code Execution) attacks.\n\nA 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.\n\nIt 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.\n\nHappy 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.\n\n## Reproduce\n\n### CommonJS (Possible to get hold of require)\n\n```javascript\nconst { Window } = require('happy-dom');\nconst window = new Window({ console });\n\nwindow.document.write(`\n  <script>\n     const process = this.constructor.constructor('return process')();\n     const require = process.mainModule.require;\n  \n     console.log('Files:', require('fs').readdirSync('.').slice(0,3));\n  </script>\n`);\n```\n### ESM (Not possible to get hold of import or require)\n\n```javascript\nconst { Window } = require('happy-dom');\nconst window = new Window({ console });\n\nwindow.document.write(`\n  <script>\n     const process = this.constructor.constructor('return process')();\n  \n     console.log('PID:', process.pid);\n  </script>\n`);\n```\n\n## Potential Impact\n\n#### Server-Side Rendering (SSR)\n```javascript\nconst { Window } = require('happy-dom');\nconst window = new Window();\nwindow.document.innerHTML = userControlledHTML;\n```\n\n#### Testing Frameworks\nAny test suite using Happy-DOM with untrusted content may be at risk\n\n## Attack Scenarios\n\n1. **Data Exfiltration**: Access to environment variables, configuration files, secrets\n2. **Lateral Movement**: Network access for connecting to internal systems. Happy DOM already gives access to the network by fetch, but has protections in place (such as CORS and header validation etc.).\n3. **Code Execution**: Child process access for running arbitrary commands\n4. **Persistence**: File system access\n\n## Recommended Immediate Actions\n\n1. Update Happy DOM to v20 or above\n    - This version has JavaScript evaluation disabled by default\n    - This version will output a warning if JavaScript is enabled in an insecure environment\n2. Run Node.js with the \"--disallow-code-generation-from-strings\" if you need JavaScript evaluation enabled\n    - This makes sure that evaluation can't be used at process level to escape the VM\n    - `eval()` and `Function()` can still be used within the Happy DOM VM without any known security risk\n    - Happy DOM v20 and above will output a warning if this flag is not in use\n4. If you can't update Happy DOM right now, it's recommended to disable JavaScript evaluation, unless you completely trust the content within the environment\n\n## Technical Root Cause\n\nAll classes and functions inherit from [Function](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function). By walking the constructor chain it's possible to get hold of [Function](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function) at process level. As [Function](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function) can evaluate code from strings, it's possible to execute code at process level.\n\nRunning Node with the \"--disallow-code-generation-from-strings\" flag protects against this.","state":0,"publishedAt":"2025-10-10T23:46:42+00:00","modifiedAt":"2025-10-13T15:48:53+00:00","affected":[{"ecosystem":"npm","name":"happy-dom","ranges":[{"type":"SEMVER","events":[{"kind":"introduced","version":"0"},{"kind":"fixed","version":"20.0.0"}]}],"versions":[],"rawVersionEvidence":null}],"metrics":[{"system":"CVSS_V4","vector":"CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:H/VI:H/VA:H/SC:H/SI:H/SA:H/E:P","score":null,"severity":null},{"system":"Publisher rating","vector":null,"score":null,"severity":"CRITICAL"}],"references":["https://github.com/capricorn86/happy-dom/security/advisories/GHSA-37j7-fg3j-429f","https://nvd.nist.gov/vuln/detail/CVE-2025-61927","https://github.com/capricorn86/happy-dom/commit/819d15ba289495439eda8be360d92a614ce22405","https://github.com/capricorn86/happy-dom/commit/de438ad72921c69793584aa657b48d3655dfac97","https://github.com/capricorn86/happy-dom","https://github.com/capricorn86/happy-dom/releases/tag/v20.0.0"],"sourceUrl":"https://github.com/advisories/GHSA-37j7-fg3j-429f","license":"GitHub Advisory Database · CC-BY-4.0","key":"osv:GHSA-37j7-fg3j-429f","identifiers":["GHSA-37j7-fg3j-429f","CVE-2025-61927"]},"retained":false,"historicalAffected":[]}],"coverage":[{"source":"cisa-kev:global","scope":"Complete CISA KEV catalog; all vendors. Missing entries do not establish absence of exploitation.","generation":"2026-11-11T09:26:00.1517867+00:00","complete":true,"records":1779,"lastAttemptAt":"2026-11-11T09:26:00.1517867+00:00","lastSuccessAt":"2026-11-11T09:26:00.3919657+00:00","error":null,"lastVerifiedAt":"2026-11-11T09:26:00.3919664+00:00","snapshotPublishedAt":null,"importing":false,"stagedRecords":0,"checkedIdentifiers":null,"expectedIdentifiers":null,"failedIdentifiers":null},{"source":"cve-program","scope":"Official CVE Program baseline and cumulative hourly delta; all vendors, published and rejected records","generation":"cve-de3b77103708811b6494d2ff7c979037d73ae579742cd1649a5c765137ae5083-f19af5e22c13aa688d23829fe96c281d0deaf6cf2f8cee6748f54f5a479127b2","complete":true,"records":424021,"lastAttemptAt":"2026-11-11T09:25:54.6180937+00:00","lastSuccessAt":"2026-11-11T09:25:54.5258746+00:00","error":null,"lastVerifiedAt":"2026-11-11T09:25:54.6180937+00:00","snapshotPublishedAt":"2026-11-11T09:25:28+00:00","importing":false,"stagedRecords":0,"checkedIdentifiers":null,"expectedIdentifiers":null,"failedIdentifiers":null},{"source":"euvd","scope":"Rolling EUVD lookups of CVE aliases in current public OSV archives; 500 identifiers per refresh, rechecked after 48 hours. Not a global EUVD catalog. Successful not-found lookups count as checked; they do not imply withdrawal or safety. No reader inventory is sent.","generation":"enrichment-f3cfddba55ce40a0bbff5d425c207d59","complete":false,"records":13758,"lastAttemptAt":"2026-11-11T09:37:37.9804078+00:00","lastSuccessAt":"2026-11-11T09:37:37.974+00:00","error":"16 identifier lookups failed; latest failures include HTTP 403. Other identifiers were checked independently.","lastVerifiedAt":"2026-11-11T09:37:37.974+00:00","snapshotPublishedAt":null,"importing":false,"stagedRecords":0,"checkedIdentifiers":13776,"expectedIdentifiers":13812,"failedIdentifiers":16},{"source":"first-epss:nuget","scope":"FIRST EPSS for explicit CVE aliases in the collected public NuGet archive. Not a global EPSS backfill.","generation":"2026-11-11T09:26:00.1517867+00:00","complete":true,"records":1097,"lastAttemptAt":"2026-11-11T09:26:00.1517867+00:00","lastSuccessAt":"2026-11-11T09:26:00.3927797+00:00","error":null,"lastVerifiedAt":"2026-11-11T09:26:00.3927799+00:00","snapshotPublishedAt":null,"importing":false,"stagedRecords":0,"checkedIdentifiers":null,"expectedIdentifiers":null,"failedIdentifiers":null},{"source":"nvd","scope":"Rolling NVD lookups of CVE aliases in current public OSV archives; 500 identifiers per refresh, rechecked after 48 hours. Not a global NVD catalog. Successful not-found lookups count as checked; they do not imply withdrawal or safety. No reader inventory is sent.","generation":"enrichment-304fa97221904da4b3dcd306fc4b8a4b","complete":true,"records":13752,"lastAttemptAt":"2026-11-11T09:26:01.4581358+00:00","lastSuccessAt":"2026-11-11T09:26:01.454+00:00","error":null,"lastVerifiedAt":"2026-11-11T09:26:01.454+00:00","snapshotPublishedAt":null,"importing":false,"stagedRecords":0,"checkedIdentifiers":13812,"expectedIdentifiers":13812,"failedIdentifiers":0},{"source":"osv:Go","scope":"Complete OSV Go ecosystem archive, including withdrawn and malicious-package source records; statement counts are not unique CVE counts","generation":"go-3562b6c78fd1bd0f0b55daf66a0926ae24f65e462df7f6d928caad458fc696bf","complete":true,"records":9947,"lastAttemptAt":"2026-11-11T09:25:54.9948719+00:00","lastSuccessAt":"2026-11-11T04:27:43.6877707+00:00","error":null,"lastVerifiedAt":"2026-11-11T09:25:54.9948719+00:00","snapshotPublishedAt":"2026-11-11T03:32:46+00:00","importing":false,"stagedRecords":0,"checkedIdentifiers":null,"expectedIdentifiers":null,"failedIdentifiers":null},{"source":"osv:NuGet","scope":"Complete OSV NuGet ecosystem archive, including GitHub Advisory Database records; NuGet version matching only","generation":"nuget-456002455e0ab94bb92c95476d4e6d175c104cd594749982afd96c893728ecbc","complete":true,"records":2010,"lastAttemptAt":"2026-11-11T09:25:54.7785287+00:00","lastSuccessAt":"2026-11-11T02:36:58.1276999+00:00","error":null,"lastVerifiedAt":"2026-11-11T09:25:54.7785287+00:00","snapshotPublishedAt":"2026-11-11T01:17:51+00:00","importing":false,"stagedRecords":0,"checkedIdentifiers":null,"expectedIdentifiers":null,"failedIdentifiers":null},{"source":"osv:crates.io","scope":"Complete OSV crates.io ecosystem archive, including withdrawn and malicious-package source records; statement counts are not unique CVE counts","generation":"crates.io-2bc186fc4a8179fd66d765079d475b0b8e3af9f89b57dcc310e7773ded48b2cc","complete":true,"records":3088,"lastAttemptAt":"2026-11-11T09:26:00.1096189+00:00","lastSuccessAt":"2026-11-11T09:25:59.9234294+00:00","error":null,"lastVerifiedAt":"2026-11-11T09:26:00.1096189+00:00","snapshotPublishedAt":"2026-11-11T09:02:55+00:00","importing":false,"stagedRecords":0,"checkedIdentifiers":null,"expectedIdentifiers":null,"failedIdentifiers":null},{"source":"osv:npm","scope":"Complete OSV npm ecosystem archive, including withdrawn and malicious-package source records; statement counts are not unique CVE counts","generation":"npm-085e065fc9050ae18408f7e722c39653aeb186872334d7b3ec1fcafb7ed43d25","complete":true,"records":231665,"lastAttemptAt":"2026-11-11T09:25:54.8906223+00:00","lastSuccessAt":"2026-11-11T08:27:45.2700102+00:00","error":null,"lastVerifiedAt":"2026-11-11T09:25:54.8906223+00:00","snapshotPublishedAt":"2026-11-11T07:32:59+00:00","importing":false,"stagedRecords":0,"checkedIdentifiers":null,"expectedIdentifiers":null,"failedIdentifiers":null}]}