CVE Intelligence

Vulnerabilidades do Npm Happy-dom

🔔 Criar alerta RSS Verificador de versão

CVEs publicadas que afetam Npm Happy-dom: 5 registro(s), com versões afetadas e correções.

CVE-2026-118661 Média · 6.5 CWE-565 28/10/2026
Happy DOM: Cookie scope forgery: no DNS-label boundary on Domain= matching , attacker origin sets victim cookies
Happy DOM is a JavaScript implementation of a web browser without its graphical user interface. Prior to 20.14.6, Happy DOM's CookieContainer in src/cookie/CookieContainer.ts does not correctly validate or match Domain cookie attributes. It can accept a Domain unrelated to the origin setting the cookie, including a public suffix, and separately treats an unrelated suffix-sharing hostname as a match because cookieMatchesURL does not enforce a DNS-label boundary. In server-side rendering and prerendering applications that contact attacker-controlled origins and then make requests to a victim origin, these behaviors can plant and deliver a forged cookie, enabling cookie injection or session fixation. This issue is fixed in version 20.14.6.
CVE-2026-118660 Alta · 8.6 CWE-918 28/10/2026
Happy DOM: SSRF via iframe and link stylesheet when parsing untrusted HTML
Happy DOM is a JavaScript implementation of a web browser without its graphical user interface. Prior to 21.0.0, Happy DOM loads iframe src URLs and link rel="stylesheet" href URLs by default while parsing untrusted HTML on the server because disableIframePageLoading and disableCSSFileLoading default to false. An attacker who controls parsed HTML can therefore cause server-side requests to arbitrary internal or cloud endpoints without an application opt-in and may expose confidential responses or credentials returned by those endpoints. This issue is fixed in version 21.0.0.
CVE-2026-115895 Alta · 8.8 CWE-94 23/10/2026
Happy DOM: Incomplete fix for CVE-2026-33943: unsanitized import alias leads to host code execution
Happy DOM is a JavaScript implementation of a web browser without its graphical user interface. From 17.0.0 until 21.0.4, packages/happy-dom/src/module/ECMAScriptModuleCompiler.ts accepts a named ESM import alias without validating that it is a JavaScript binding identifier before inserting it into a generated destructuring binding. With enableJavaScriptEvaluation enabled, attacker-controlled HTML or module source can use an invalid alias that becomes a valid default initializer after compilation, causing the generated JavaScript to execute in the Node.js host process. The demonstrated reachable path uses a JSON module import attribute, which prevents the malicious alias from being emitted again in a later ESM circular-import assignment and keeps the generated function syntactically valid. This incomplete fix for CVE-2026-33943 is a distinct residual path because the earlier remediation validated the local export importName path but not the named-import alias. This issue is fixed in version 21.0.4.
CVE-2026-34226 Alta · 7.5 CWE-201 27/03/2026
Happy DOM's fetch credentials include uses page-origin cookies instead of target-origin cookies
Happy DOM is a JavaScript implementation of a web browser without its graphical user interface. Versions prior to 20.8.9 may attach cookies from the current page origin (`window.location`) instead of the request target URL when `fetch(..., { credentials: "include" })` is used. This can leak cookies from origin A to destination B. Version 20.8.9 fixes the issue.
CVE-2026-33943 Crítica · 9.8 CWE-94 27/03/2026
Happy DOM ECMAScriptModuleCompiler: injeção de código por nomes de exportação não sanitizados
Happy DOM é uma implementação em JavaScript de um navegador web sem sua interface gráfica. Nas versões 15.10.0 até 20.8.7, uma vulnerabilidade de injeção de código no ECMAScriptModuleCompiler permite que um atacante alcance Remote Code Execution (RCE) ao injetar expressões JavaScript arbitrárias dentro de declarações export { } em scripts de módulos ES processados pelo happy-dom. O compilador interpola diretamente conteúdo não sanitizado no código gerado como uma expressão executável, e o filtro de aspas não remove crases, o que permite que payloads baseados em template literals contornem a sanitização. A versão 20.8.8 corrige o problema.