Skip to main content
Press slash or control plus K to focus the search. Use the arrow keys to navigate results and press enter to open a threat.
Reconnecting to live updates…
EPSS 0.8%top 47%

CVE-2026-33943: CWE-94: Improper Control of Generation of Code ('Code Injection') in capricorn86 happy-dom

0
High
VulnerabilityCVE-2026-33943cvecve-2026-33943cwe-94
Published: 03/27/2026 (03/27/2026, 21:15:19 UTC)
Source: CVE Database V5
Vendor/Project: capricorn86
Product: happy-dom

Description

Happy DOM is a JavaScript implementation of a web browser without its graphical user interface. In versions 15.10.0 through 20.8.7, a code injection vulnerability in `ECMAScriptModuleCompiler` allows an attacker to achieve Remote Code Execution (RCE) by injecting arbitrary JavaScript expressions inside `export { }` 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. Version 20.8.8 fixes the issue.

CVSS v3.1

Score 8.8high

Attack Vector
Network
Attack Complexity
Low
Privileges Required
None
User Interaction
Required
Scope
Unchanged
Confidentiality
High
Integrity
High
Availability
High
CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H

Affected software

happy-dom
pkg:npm/happy-dom
Affected versions
>=15.10.0 <=20.8.7

Run on your own infrastructure? Check whether these packages are installed with threat-finder — our free open-source scanner.

AI-Powered Analysis

Machine-generated threat intelligence

AILast updated: 07/15/2026, 09:01:02 UTC

Technical Analysis

CVE-2026-33943 is a high-severity code injection vulnerability (CWE-94) in the capricorn86 happy-dom JavaScript environment. The ECMAScriptModuleCompiler improperly controls code generation by directly interpolating unsanitized input into executable code within export { } declarations of ES modules. The sanitization mechanism fails to strip backticks, allowing attackers to craft payloads using template literals that bypass filters and achieve remote code execution. This affects happy-dom versions from 15.10.0 up to and including 20.8.7. The issue is fixed in version 20.8.8. The vulnerability has a CVSS 3.1 score of 8.8, indicating high impact on confidentiality, integrity, and availability.

Potential Impact

Successful exploitation allows an unauthenticated attacker to execute arbitrary JavaScript code remotely within the context of happy-dom by injecting malicious expressions into ES module export declarations. This leads to full compromise of the affected environment's confidentiality, integrity, and availability.

Mitigation Recommendations

An official fix is available in happy-dom version 20.8.8. Users should upgrade to version 20.8.8 or later to remediate this vulnerability. No additional mitigation steps are indicated by the vendor advisory.

Pro Console: star threats, build custom feeds, automate alerts via Slack, email & webhooks.Upgrade to Pro

Technical Details

Data Version
5.2
Assigner Short Name
GitHub_M
Date Reserved
2026-03-24T19:50:52.104Z
Cvss Version
3.1
State
PUBLISHED
Vendor Advisory Urls
[{"url":"https://access.redhat.com/security/cve/CVE-2026-33943","vendor":"Red Hat"}]

Threat ID: 69c6f6ca3c064ed76ff81bae

Added to database: 03/27/2026, 21:29:46 UTC

Last enriched: 07/15/2026, 09:01:02 UTC

Last updated: 07/31/2026, 19:22:58 UTC

Views: 137

Community Reviews

0 reviews

Crowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.

Sort by
Loading community insights…

Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.

Actions

PRO

Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.

Please log in to the Console to use AI analysis features.

Need more coverage?

Upgrade to Pro Console for AI refresh and higher limits.

For incident response and remediation, OffSeq services can help resolve threats faster.

Latest Threats

Breach by OffSeqOFFSEQFRIENDS — 25% OFF

Check if your credentials are on the dark web

Instant breach scanning across billions of leaked records. Free tier available.

Scan now
OffSeq TrainingCredly Certified

Lead Pen Test Professional

Technical5-day eLearningPECB Accredited
View courses