Repository navigation
chore(deps): update dependency happy-dom to v21 [security] - #89
Open
renovate[bot] wants to merge 1 commit into
Open
renovate[bot] wants to merge 1 commit into
renovate[bot] wants to merge 1 commit into
Conversation
❌ Deploy Preview for timjames failed.
|
renovate
Bot
force-pushed
the
renovate/npm-happy-dom-vulnerability
branch
3 times, most recently
from
May 3, 2025 00:59
b4dbd2d to
f2d195f
Compare
renovate
Bot
force-pushed
the
renovate/npm-happy-dom-vulnerability
branch
from
October 11, 2025 00:31
f2d195f to
5c2345d
Compare
Contributor
Author
|
renovate
Bot
force-pushed
the
renovate/npm-happy-dom-vulnerability
branch
from
January 7, 2026 02:21
5c2345d to
8381147
Compare
✅ Deploy Preview for timjames canceled.
|
renovate
Bot
force-pushed
the
renovate/npm-happy-dom-vulnerability
branch
from
March 26, 2026 10:57
8381147 to
42e8532
Compare
❌ Deploy Preview for timjames failed.
|
auto-merge was automatically disabled
March 27, 2026 01:00
Pull request was closed
renovate
Bot
force-pushed
the
renovate/npm-happy-dom-vulnerability
branch
2 times, most recently
from
March 29, 2026 21:00
42e8532 to
7757d09
Compare
renovate
Bot
force-pushed
the
renovate/npm-happy-dom-vulnerability
branch
2 times, most recently
from
May 23, 2026 21:10
7757d09 to
903cfbf
Compare
❌ Deploy Preview for timjames failed.
|
renovate
Bot
force-pushed
the
renovate/npm-happy-dom-vulnerability
branch
from
June 3, 2026 15:17
903cfbf to
78cee05
Compare
renovate
Bot
force-pushed
the
renovate/npm-happy-dom-vulnerability
branch
from
November 4, 2026 16:48
78cee05 to
c3293d1
Compare
❌ Deploy Preview for timjames failed.
|
This branch has not been deployed
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.
Note
This PR body was truncated due to platform limits.
This PR contains the following updates:
^13.3.8→^21.0.0happy-dom allows for server side code to be executed by a <script> tag
CVE-2024-51757 / GHSA-96g7-g7g9-jxw8
More information
Details
Impact
Consumers of the NPM package
happy-domPatches
The security vulnerability has been patched in v15.10.2
Workarounds
No easy workarounds to my knowledge
References
#1585
Severity
CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:NReferences
This data is provided by the GitHub Advisory Database (CC-BY 4.0).
Happy DOM: VM Context Escape can lead to Remote Code Execution
CVE-2025-61927 / GHSA-37j7-fg3j-429f
More information
Details
Escape of VM Context gives access to process level functionality
Summary
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.
Reproduce
CommonJS (Possible to get hold of require)
ESM (Not possible to get hold of import or require)
Potential Impact
Server-Side Rendering (SSR)
Testing Frameworks
Any test suite using Happy-DOM with untrusted content may be at risk
Attack Scenarios
Recommended Immediate Actions
eval()andFunction()can still be used within the Happy DOM VM without any known security riskTechnical Root Cause
All classes and functions inherit from Function. By walking the constructor chain it's possible to get hold of Function at process level. As Function can evaluate code from strings, it's possible to execute code at process level.
Running Node with the "--disallow-code-generation-from-strings" flag protects against this.
Severity
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:PReferences
This data is provided by the GitHub Advisory Database (CC-BY 4.0).
Happy DOM's fetch credentials include uses page-origin cookies instead of target-origin cookies
CVE-2026-34226 / GHSA-w4gp-fjgq-3q4g
More information
Details
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.Severity
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:NReferences
This data is provided by the GitHub Advisory Database (CC-BY 4.0).
Happy DOM has cookie scope forgery: no DNS-label boundary on Domain= matching , attacker origin sets victim cookies
CVE-2026-118661 / GHSA-5fpq-26gf-qwcr
More information
Details
Summary
A cookie-scoping bug in happy-dom lets an attacker origin set cookies that a victim origin then receives, diverging from browser semantics.
Details
happy-dom matches Domain=example.com against notexample.com (endsWith without a DNS-label boundary), diverging from browser semantics (verified 20.11.6 npm latest: cookieMatchesURL(Domain=example.com, url=http://notexample.com) = true). Relevant where happy-dom is used for SSR/prerender cookie handling. Matching in src/cookie/CookieContainer.ts.
PoC
Run:
Full proof-of-concept source (poc-happydom-cookie-domain.js):
Observed output (verbatim, Node 24.15.0, Windows):
Impact
Cookie-scoping divergence / session forgery . Applications using happy-dom for SSR/prerender cookie handling can accept cookies from wrong origins. Affects happy-dom <= 20.14.5. Note: main pushback will be that happy-dom is a test DOM — state the SSR use case.
Severity
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:NReferences
This data is provided by the GitHub Advisory Database (CC-BY 4.0).
Happy DOM: SSRF via iframe and link stylesheet when parsing untrusted HTML
CVE-2026-118660 / GHSA-c8p4-j97h-3vg8
More information
Details
Summary
happy-dom v20.8.9 makes real server-side HTTP requests to arbitrary URLs when parsing HTML containing
<iframe>or<link rel="stylesheet">elements. This behavior is enabled by default (disableIframePageLoading: false,disableCSSFileLoading: false). When an application uses happy-dom to parse untrusted HTML on the server side, an attacker can trigger Server-Side Request Forgery by embedding these elements.Affected Versions
Vulnerable Behavior
By default, happy-dom has:
disableIframePageLoading: false— iframes fetch theirsrcURL via real HTTP requestsdisableCSSFileLoading: false—<link>stylesheets fetch theirhrefURL via real HTTP requestsWhen untrusted HTML is parsed, these elements trigger real server-side HTTP requests to whatever URLs are specified. No special configuration or opt-in is needed.
Proof of Concept
Verified test (attacker server receives requests):
Test output:
Both requests confirmed received by the attacker server. Tested on happy-dom v20.8.9, Node.js v22.17.0, macOS.
Cloud metadata attack scenario:
Impact
<iframe src="http://169.254.169.254/...">fetches AWS/GCP/Azure metadataSuggested Fix
Change defaults to disable external resource loading:
Or add URL validation to block private IP ranges and cloud metadata endpoints before fetching.
Severity
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:N/A:NReferences
This data is provided by the GitHub Advisory Database (CC-BY 4.0).
Release Notes
capricorn86/happy-dom (happy-dom)
v21.0.0Compare Source
💣 Breaking Changes
<iframe>or<link rel="stylesheet">elements in untrusted HTML to make Happy DOM send HTTP requests from the server to attacker-chosen URLs, including internal services. This could allow access to otherwise unreachable endpoints or trigger unintended actions, depending on the application and its network access.disableCSSFileLoadinghas been deprecated<=v20.14.6by sending in{ enableCSSFileLoading: true, enableIframePageLoading: true }as broswer settings (e.g.new Window({ settings }));v20.14.6Compare Source
👷♂️ Patch fixes
v20.14.5Compare Source
👷♂️ Patch fixes
v20.14.4Compare Source
👷♂️ Patch fixes
v20.14.3Compare Source
👷♂️ Patch fixes
v20.14.2Compare Source
👷♂️ Patch fixes
getComputedStyle()- By @klaesra in task #2344v20.14.1Compare Source
👷♂️ Patch fixes
v20.14.0Compare Source
🎨 Features
v20.13.2Compare Source
👷♂️ Patch fixes
v20.13.1Compare Source
👷♂️ Patch fixes
v20.13.0Compare Source
🎨 Features
v20.12.2Compare Source
👷♂️ Patch fixes
v20.12.1Compare Source
🎨 Features
CSSStyleDeclaration- By @capricorn86 in task #2256CSSStyleDeclaration- By @capricorn86 in task #2256👷♂️ Patch fixes
v20.12.0Compare Source
🎨 Features
Animation,AnimationTimeline,DocumentTimelineandKeyframeEffect- By @capricorn86Element.animate()- By @capricorn86v20.11.15Compare Source
👷♂️ Patch fixes
v20.11.14Compare Source
👷♂️ Patch fixes
v20.11.13Compare Source
👷♂️ Patch fixes
v20.11.12Compare Source
👷♂️ Patch fixes
v20.11.11Compare Source
👷♂️ Patch fixes
v20.11.10Compare Source
👷♂️ Patch fixes
v20.11.9Compare Source
👷♂️ Patch fixes
v20.11.8Compare Source
👷♂️ Patch fixes
adoptedStyleSheetarray should be validated - By @capricorn86 in task #2315v20.11.7Compare Source
👷♂️ Patch fixes
Document.adoptedStyleSheetsandShadowRoot.adoptedStyleSheetsshould validate it's value - By @capricorn86 in task #2313v20.11.6Compare Source
👷♂️ Patch fixes
v20.11.5Compare Source
👷♂️ Patch fixes
querySelector<HTMLInputElement>(".my-input")) - By @cyphercodesv20.11.4Compare Source
👷♂️ Patch fixes
fetch()to match origins instead of host and protocol - By @rexxars in task #1490v20.11.3Compare Source
👷♂️ Patch fixes
v20.11.2Compare Source
👷♂️ Patch fixes
v20.11.1Compare Source
👷♂️ Patch fixes
v20.11.0Compare Source
🎨 Features
v20.10.6Compare Source
👷♂️ Patch fixes
v20.10.5Compare Source
👷♂️ Patch fixes
v20.10.4Compare Source
👷♂️ Patch fixes
v20.10.3Compare Source
👷♂️ Patch fixes
v20.10.2Compare Source
👷♂️ Patch fixes
v20.10.1Compare Source
v20.10.0Compare Source
🎨 Features
Configuration
📅 Schedule: (in timezone Australia/Sydney)
🚦 Automerge: Enabled.
♻ Rebasing: Whenever PR is behind base branch, 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.