chore(deps): update dependency happy-dom to v20.8.9 [security]#1342
Open
renovate[bot] wants to merge 1 commit intomasterfrom
Open
chore(deps): update dependency happy-dom to v20.8.9 [security]#1342renovate[bot] wants to merge 1 commit intomasterfrom
renovate[bot] wants to merge 1 commit intomasterfrom
Conversation
Contributor
size-limit report 📦
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #1342 +/- ##
=======================================
Coverage 90.00% 90.00%
=======================================
Files 3 3
Lines 80 80
Branches 20 20
=======================================
Hits 72 72
Misses 6 6
Partials 2 2 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
40f488d to
7802511
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR contains the following updates:
20.0.8→20.8.9GitHub Vulnerability Alerts
CVE-2026-33943
Summary
A code injection vulnerability in
ECMAScriptModuleCompilerallows an attacker to achieve Remote Code Execution (RCE) by injecting arbitrary JavaScript expressions insideexport { }declarations in ES module scripts processed by happy-dom. The compiler directly interpolates unsanitized content into generated code as an executable expression, and the quote filter does not strip backticks, allowing template literal-based payloads to bypass sanitization.Details
Vulnerable file:
packages/happy-dom/src/module/ECMAScriptModuleCompiler.ts, lines 371-385The "Export object" handler extracts content from
export { ... }using the regexexport\s*{([^}]+)}, then generates executable code by directly interpolating it:The issue has three root causes:
STATEMENT_REGEXPuses{[^}]+}which matches any content inside braces, not just valid JavaScript identifiersimportNameis placed in code context (as a JS expression to evaluate), not in string context.replace(/["']/g, '')strips"and'but not backticks, so template literal strings like`child_process`survive the filterAttack flow:
Note: This is a different vulnerability from CVE-2024-51757 (SyncFetchScriptBuilder injection) and CVE-2025-61927 (VM context escape). Those were patched in v15.10.2 and v20.0.0 respectively, but this vulnerable code path in
ECMAScriptModuleCompilerremains present in v20.8.4 (latest). In v20.0.0+ where JavaScript evaluation is disabled by default, this vulnerability is exploitable when JavaScript evaluation is explicitly enabled by the user.PoC
Standalone PoC script — reproduces the vulnerability without installing happy-dom by replicating the compiler's exact code generation logic:
Execution result:
HTML attack vector — when processed by happy-dom with JavaScript evaluation enabled:
Impact
An attacker who can inject or control HTML content processed by happy-dom (with JavaScript evaluation enabled) can achieve arbitrary command execution on the host system.
Realistic attack scenarios:
Suggested fix: Validate that
importNameis a valid JavaScript identifier before interpolating it into generated code:CVE-2026-34226
Summary
happy-dommay attach cookies from the current page origin (window.location) instead of the request target URL whenfetch(..., { credentials: "include" })is used. This can leak cookies from origin A to destination B.Details
In
packages/happy-dom/src/fetch/utilities/FetchRequestHeaderUtility.ts(getRequestHeaders()), cookie selection is performed withoriginURL:Here,
originURLrepresents the page URL, not the request destination URL. For outgoing requests, cookie lookup should use the request URL (for example:new URL(options.request[PropertySymbol.url])).PoC Script Content
Environment:
happy-dom20.6.1*.127.0.0.1.nip.ioReproduction steps:
page_cookie=PAGE_ONLYona.127.0.0.1.nip.ioapi_cookie=API_ONLYonb.127.0.0.1.nip.iocredentials: "include"Cookieheader received by the target hostExpected:
api_cookie=API_ONLYpage_cookie=PAGE_ONLYActual (observed):
page_cookie=PAGE_ONLYapi_cookie=API_ONLYObserved output:
Impact
Cross-origin sensitive information disclosure (cookie leakage).
Impacted users are applications relying on
happy-dombrowser-like fetch behavior in authenticated/session-based flows (for example SSR/test/proxy-like scenarios), where cookies from one origin can be sent to another origin.Release Notes
capricorn86/happy-dom (happy-dom)
v20.8.9Compare Source
👷♂️ Patch fixes
v20.8.8Compare Source
👷♂️ Patch fixes
v20.8.7Compare Source
👷♂️ Patch fixes
Consolewith commonIConsoleinterface to support latest version of Bun - By @YevheniiKotyrlo in task #1845v20.8.6Compare Source
👷♂️ Patch fixes
Request.formData()should honor "Content-Type" header - By @brianhelba in task #2106v20.8.5Compare Source
👷♂️ Patch fixes
connectedCallback()- By @capricorn86 in task #2110v20.8.4Compare Source
v20.8.3Compare Source
👷♂️ Patch fixes
v20.8.2Compare Source
👷♂️ Patch fixes
Event.cancelBubbleandEvent.defaultPreventedwhen callingEvent.initEvent()- By @capricorn86 in task #2090v20.8.1Compare Source
👷♂️ Patch fixes
v20.8.0Compare Source
v20.7.2Compare Source
👷♂️ Patch fixes
v20.7.1Compare Source
v20.7.0Compare Source
🎨 Features
Window.getScreenDetails()- By @TrevorBurnham in task #1923ScreenfromEventTarget- By @TrevorBurnham in task #1923v20.6.5Compare Source
👷♂️ Patch fixes
v20.6.4Compare Source
👷♂️ Patch fixes
v20.6.3Compare Source
👷♂️ Patch fixes
[data-value="it's a test"]) - By @capricorn86 in task #2034v20.6.2Compare Source
👷♂️ Patch fixes
v20.6.1Compare Source
v20.6.0Compare Source
v20.5.5Compare Source
v20.5.4Compare Source
👷♂️ Patch fixes
v20.5.3Compare Source
v20.5.2Compare Source
v20.5.1Compare Source
v20.5.0Compare Source
v20.4.0Compare Source
🎨 Features
v20.3.9Compare Source
👷♂️ Patch fixes
v20.3.8Compare Source
👷♂️ Patch fixes
focusNodeandfocusOffsetin the Selection API returned incorrect values - By @skoch13 in task #1850v20.3.7Compare Source
👷♂️ Patch fixes
v20.3.6Compare Source
👷♂️ Patch fixes
<details>by clicking on a child of the<summary>element - By @Nxooah in task #1928v20.3.5Compare Source
👷♂️ Patch fixes
BrowserFrameURLto avoid mock interference - By @marchaos in task #1964CookieURLUtility- By @marchaos in task #1968v20.3.4Compare Source
v20.3.3Compare Source
v20.3.2Compare Source
v20.3.1Compare Source
👷♂️ Patch fixes
DataTransfer.getData()- By @marchaos in task #1965XMLHttpRequest- By @rexxars in task #1890v20.3.0Compare Source
🎨 Features
RegExpto convert ASCII character casing to improve performance - By @TrevorBurnham in task #1886v20.2.0Compare Source
🎨 Features
Element.classList.contains()instead of splittingclassNamein query selectors to improve performance as it's cached - By @TrevorBurnham in task #1884v20.1.1Compare Source
👷♂️ Patch fixes
querySelector()- By @TrevorBurnham in task #1882querySelector()to improve performance - By @TrevorBurnham in task #1882v20.1.0Compare Source
🎨 Features
BrowserPage.evaluateModule()andBrowserFrame.evaluateModule()- By @capricorn86 in task #1944moduleto the browser settings - By @capricorn86 in task #1944import()to JavaScript evaluation - By @capricorn86 in task #1944type="module"on script elementsWebSocket- By @capricorn86 in task #1944CloseEvent- By @capricorn86 in task #1944render.setupScriptandrender.modeto the configuration in @happy-dom/server-renderer - By @capricorn86 in task #1944urlstorenderItemsin the configuration in @happy-dom/server-renderer - By @capricorn86 in task #1944👷♂️ Patch fixes
v20.0.11Compare Source
v20.0.10Compare Source
v20.0.9Compare Source
Configuration
📅 Schedule: Branch creation - "" (UTC), Automerge - At any time (no schedule defined).
🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.
♻ Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.
🔕 Ignore: Close this PR and you won't be reminded about this update again.
This PR was generated by Mend Renovate. View the repository job log.